Changing INI JOINT SCALE online

More
01 Feb 2021 21:20 - 02 Feb 2021 01:13 #197335 by PCW
Replied by PCW on topic Changing INI JOINT SCALE online
Sure, you are just commanding velocities so all positioning is relative
Last edit: 02 Feb 2021 01:13 by PCW.

Please Log in or Create an account to join the conversation.

More
02 Feb 2021 01:13 - 02 Feb 2021 01:19 #197365 by PCW
Replied by PCW on topic Changing INI JOINT SCALE online
I should mention that changing to open loop if you have a standard
PID stepgen configuration would be as simple as setting the P gain to 0,
and looping LinuxCNCs commanded joint position back to
LinuxCNCs joint feedback position.
Last edit: 02 Feb 2021 01:19 by PCW.

Please Log in or Create an account to join the conversation.

More
02 Feb 2021 05:16 #197374 by AlessandroT
Thanks to your feedback i tried to re-wiring like that, but I guess I am still missing something, because using gmocappy I can't see the A values increasing if I jog the A axis ( and after a while the following error appears again :blink: ).
Maybe I forgot to set somewhere that I will use the velocity mode to the A axis?

net emcmot.03.vel-cmd <= joint.3.vel-cmd
net emcmot.03.vel-cmd => pid.6.command

net motor.03.pos-fb <= hm2_[HOSTMOT2](BOARD).0.stepgen.03.position-fb
net motor.03.pos-fb => joint.3.motor-pos-fb
net motor.03.pos-fb => pid.6.feedback

net motor.03.command <= pid.6.output
net motor.03.command => hm2_[HOSTMOT2](BOARD).0.stepgen.03.velocity-cmd
setp pid.6.enable 1

Please Log in or Create an account to join the conversation.

More
02 Feb 2021 06:25 - 02 Feb 2021 06:36 #197378 by PCW
Replied by PCW on topic Changing INI JOINT SCALE online
net motor.03.loopback <= joint.3.motor-pos-command   ## note command is looped back to feedback 
net motor.03.loopback => joint.3.motor-pos-fb        ## so no following errors are possible
net motor.03.loopback => pid.6.command               ## PID gets its position command from the joint command

net extruder_velocity <= pid.6.output
net extruder_velocity => hm2_[HOSTMOT2](BOARD).0.stepgen.03.velocity-cmd
setp pid.6.enable 1

Note that the PID 6 P term must be 0

Also using the PID allows a sneaky way to do the scaling by varying the FF1 term pin
and possibly things like FF2 may be useful for an extruder

Or if you dont want to use a PID at all, just

net motor.03.loopback <= joint.3.motor-pos-command   ## note command is looped back to feedback 
net motor.03.loopback => joint.3.motor-pos-fb        ## so no following errors are possible
net emcmot.03.vel-cmd <= joint.3.vel-cmd
net emcmot.03.vel-cmd => hm2_[HOSTMOT2](BOARD).0.stepgen.03.velocity-cmd

But this still needs the scaling added
Last edit: 02 Feb 2021 06:36 by PCW.

Please Log in or Create an account to join the conversation.

More
02 Feb 2021 18:21 #197460 by AlessandroT
Finally it works!! thanks to your help :)
I didn't have any pid before so I tried the direct link between commanded and feedback position. I tried also with PID but probably I need to tune other parameters because it didn't work well as the direct link did, that is my preferred option.
I prefer to not add any scale component (that can run only with a servo thread ) because I'd like to only adjust the parameter "hm2_7i76e.0.stepgen.03.position-scale" that exist yet.
Roughly i can modify it through "halcmd step", but i want to find a more elegant way through a gmocappy widget.

The new question now is, how can I wire a parameter? Or how can I modify a parameter from a GUI ?Is it possible? We will end this process:)

Please Log in or Create an account to join the conversation.

More
02 Feb 2021 18:25 - 02 Feb 2021 18:32 #197461 by PCW
Replied by PCW on topic Changing INI JOINT SCALE online
You cannot wire a parameter hence the need for the scale component
(Or PID component with its FF1 pin wired to your adjustment pin)

That is, if you use the PID component connected as shown in my first example
(and all terms 0 except FF1), if the PIDs FF1 pin is 1.0 it will behave the same
as connecting the joint velocity to the stepgen velocity pin, except that you can
now wire the PID FF1 pin to your variable extruder scale source.
Last edit: 02 Feb 2021 18:32 by PCW.

Please Log in or Create an account to join the conversation.

More
02 Feb 2021 21:58 #197482 by AlessandroT
Yes, it will be the best solution! I tried and it works. The only limit is the pid connection to the servo thread instead of the base one. It can affect the stepgen generation somehow?

Please Log in or Create an account to join the conversation.

More
02 Feb 2021 22:25 #197486 by PCW
Replied by PCW on topic Changing INI JOINT SCALE online
You dont need a base thread with Mesa hardware

Please Log in or Create an account to join the conversation.

Time to create page: 0.140 seconds
Powered by Kunena Forum