Implementing a software drag knife

More
29 Nov 2023 22:26 #286817 by chowderhead
I've read the QTPlasmaC with six axis post and follow most of the discussion regarding the shortcomings in calculating heading using dx and dy. I'm not sure what the state tags are as discussed by rodw , maybe it's a better approach? Will someone please point me in the right direction to learn more?

At any rate, I have a heading rt component working and would at least like to test, but I'm not clear about how to wire the heading output (in degrees) to the C-axis/joint. I'm using a 7i96 card, if that matters.

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

More
30 Nov 2023 12:22 - 30 Nov 2023 12:26 #286864 by timo
I have no idea how to do it :-) The a axis of Andy Pughs gear hobber runs synchronized with the spindle. I guess your problem is very similar to "electronic gearing",

I cannot find the thread right now, there was a complete hal file with a lot of useful tricks that might be worth reading through.

forum.linuxcnc.org/38-general-linuxcnc-q...er-slave-axes#256984 here might be something (I did not read it).

 
Last edit: 30 Nov 2023 12:26 by timo.
The following user(s) said Thank You: chowderhead

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

More
30 Nov 2023 17:17 #286890 by Aciera
This is example hal config for an open loop stepper axis, your angular position would come in place of 'joint.3.motor-pos-command'.
#*******************
# --- AXIS A ---
#*******************
# --- PID SETUP ---
setp     pid.a.Pgain                                  [JOINT_3]P
setp     pid.a.Igain                                  [JOINT_3]I
setp     pid.a.Dgain                                  [JOINT_3]D
setp     pid.a.bias                                   [JOINT_3]BIAS
setp     pid.a.FF0                                    [JOINT_3]FF0
setp     pid.a.FF1                                    [JOINT_3]FF1
setp     pid.a.FF2                                    [JOINT_3]FF2
setp     pid.a.deadband                               [JOINT_3]DEADBAND
setp     pid.a.maxoutput                              [JOINT_3]MAX_OUTPUT
setp     pid.a.error-previous-target                  TRUE
setp     pid.a.maxerror                               .01

# --- STEPGEN SETUP ---
setp     hm2_7i76e.0.stepgen.03.dirsetup              [JOINT_3]DIRSETUP
setp     hm2_7i76e.0.stepgen.03.dirhold               [JOINT_3]DIRHOLD
setp     hm2_7i76e.0.stepgen.03.steplen               [JOINT_3]STEPLEN
setp     hm2_7i76e.0.stepgen.03.stepspace             [JOINT_3]STEPSPACE
setp     hm2_7i76e.0.stepgen.03.position-scale        [JOINT_3]STEP_SCALE
setp     hm2_7i76e.0.stepgen.03.step_type             0
setp     hm2_7i76e.0.stepgen.03.control-type          1
setp     hm2_7i76e.0.stepgen.03.maxaccel              [JOINT_3]STEPGEN_MAXACCEL
setp     hm2_7i76e.0.stepgen.03.maxvel                [JOINT_3]STEPGEN_MAXVEL

#--- OPEN LOOP STEPPER SIGNALS ---
net a-index-enable <=> pid.a.index-enable
net a-enable        <= joint.3.amp-enable-out               => pid.a.enable       => hm2_7i76e.0.stepgen.03.enable
net a-pos-cmd       <= joint.3.motor-pos-cmd                => pid.a.command
net a-vel-cmd       <= joint.3.vel-cmd                      => pid.a.command-deriv
net a-output        <= pid.a.output                                               => hm2_7i76e.0.stepgen.03.velocity-cmd
net a-pos-fb        <= hm2_7i76e.0.stepgen.03.position-fb   => pid.a.feedback     => joint.3.motor-pos-fb

# --- SETUP HOME / LIMIT SWITCH SIGNALS ---
net a-home-sw-auto    <= hm2_7i76e.0.7i76.0.0.input-10-not
net a-home-sw                                                 =>  joint.3.home-sw-in
The following user(s) said Thank You: chowderhead

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

More
30 Nov 2023 17:20 #286891 by Aciera
The above is for a mesa 7i76e interface card.

State tags refers to an information channel in linuxcnc that would, ideally, publish the current heading of the trajectory.
Alas it does not do that because nobody has implemented yet.

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

More
01 Dec 2023 04:44 #286929 by rodw

The above is for a mesa 7i76e interface card.

State tags refers to an information channel in linuxcnc that would, ideally, publish the current heading of the trajectory.
Alas it does not do that because nobody has implemented yet.

I started that. It would be worth resurrecting by somebody with better skills than I had
github.com/LinuxCNC/linuxcnc/pull/900
The following user(s) said Thank You: Aciera

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

More
01 Dec 2023 17:45 #286979 by chowderhead
I'm definitely not that guy - my C skills are nonexistent.

The post by Aciera highlighted the non-triviality of this endeavor given the heading component output, which is really joint.n.pos-cmd, needs to be translated to joint.n.motor-pos-cmd, which includes offsets (or vice versa) quickly but in small steps to keep from tossing following errors. My hacky approach is to limit drag knife functionality to only when executing G1, G2 or G3 while running a g-code file. Here's my logic yielding that conclusion, please pick it apart:

My C-axis has tiny inertia and is therefore the fastest axis on the machine; it should be able to keep up with changes in heading that the trajectory planner (I think that's the right component) comes up with for the much slower x and y axes given coordinated moves. This can't work when jogging or running single lines in MDI as the machine goes from no heading (stationary) to some heading (moving) instantaneously, but it should work when executing conterminous G1, G2 or G3 while running a g-code file. I need to figure out how to deal with interstitial G0's...

This goes out the window if a correction is made causing the heading to make a wild turn, which was pointed out in the QTPlasmaC post. I should be able to trap for that and just not change the heading when it occurs, or calculate a moving average heading (noise reduction). It may also be a problem if the updates from the 7i96 are laggy?

My cracked head says this yields drag knife-like functionality when running a g-code file, with the knife offset being fperiod, yes?

Would it be possible to implement a slaved joint, akin the dual joints used by gantry machines to drive a single axis, except the slaved joint has a commanded position calculated from two masters? The trick is driving the slaved joint to its target heading as quickly as possible instead of synchronizing the move.

Thanks for the help!

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

More
01 Dec 2023 19:41 #286987 by Aciera
You could also try to use a custom kinematic.

I attach my sim config of a disc saw. The custom kinematic 'xyzc_tangetial.comp' is included you can try out the config by installing the custom component using halcompile.

 

File Attachment:

File Name: table-rota...-saw.zip
File Size:16 KB
Attachments:
The following user(s) said Thank You: chowderhead

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

More
05 Dec 2023 16:48 #287289 by chowderhead
Gotta say, this is the best forum I've ever been on. Thanks!

I actually got the open loop stepper component working pretty well, though it seems very hacky:

1) Set FERROR and MIN_FERROR ridiculously high, effectively eliminating any chance a following error will be thrown.
2) When the component is active, found that open loop eliminates MAX_VELOCITY and MAX_ACCELERATION from AXIS and JOINT, leaving only STEPGEN_MAX_VEL and STEPGEN_MAX_ACC active. Which makes sense.
3) Set STEPGEN settings to quite high values to get a quick reaction time; ends up being pretty damn quick.
4) Set threshold values for dx and dy, below which no heading update occurs, eliminating wild hairs on motion correction.

The only thing I don't like is, given the PID controller is P only, it has a noticeable overshoot. Any recommendations for minimizing it?

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

More
05 Dec 2023 17:40 #287294 by Aciera
Why is the PID p only? The PID hal component offers all you want.
# --- PID SETUP ---
setp     pid.a.Pgain                                  [JOINT_3]P
setp     pid.a.Igain                                  [JOINT_3]I
setp     pid.a.Dgain                                  [JOINT_3]D
setp     pid.a.bias                                   [JOINT_3]BIAS
setp     pid.a.FF0                                    [JOINT_3]FF0
setp     pid.a.FF1                                    [JOINT_3]FF1
setp     pid.a.FF2                                    [JOINT_3]FF2
setp     pid.a.deadband                               [JOINT_3]DEADBAND
setp     pid.a.maxoutput                              [JOINT_3]MAX_OUTPUT
setp     pid.a.error-previous-target                  TRUE
setp     pid.a.maxerror                               .01

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

More
05 Dec 2023 21:48 #287314 by chowderhead
Truth is, I tried the classic PID tuning routine and only made it worse. Stock from Pncconf seems to be best.

I find that I can pretty much eliminate overshoot by tuning STEPGEN_MAX_ACC and STEPGEN_MAX_VEL.

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

Time to create page: 0.220 seconds
Powered by Kunena Forum