QTPlasmaC with fourth axis - rotary
Slave or Joint Axis ?The only hand coding I have to do is to duplicate one stepper config in the HAL file to make a slave axis for the X axis right hand motor.
Please Log in or Create an account to join the conversation.
Regards
Marius
www.bluearccnc.com
Please Log in or Create an account to join the conversation.
#*******************
# AXIS X JOINT 0
#*******************
setp pid.x.Pgain [JOINT_0]P
setp pid.x.Igain [JOINT_0]I
setp pid.x.Dgain [JOINT_0]D
setp pid.x.bias [JOINT_0]BIAS
setp pid.x.FF0 [JOINT_0]FF0
setp pid.x.FF1 [JOINT_0]FF1
setp pid.x.FF2 [JOINT_0]FF2
setp pid.x.deadband [JOINT_0]DEADBAND
setp pid.x.maxoutput [JOINT_0]MAX_OUTPUT
setp pid.x.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp pid.x.maxerror 0.012700
net x-index-enable <=> pid.x.index-enable
net x-enable => pid.x.enable
net x-pos-cmd => pid.x.command
net x-pos-fb => pid.x.feedback
net x-output <= pid.x.output
# Step Gen signals/setup
setp [HMOT](CARD0).stepgen.00.dirsetup [JOINT_0]DIRSETUP
setp [HMOT](CARD0).stepgen.00.dirhold [JOINT_0]DIRHOLD
setp [HMOT](CARD0).stepgen.00.steplen [JOINT_0]STEPLEN
setp [HMOT](CARD0).stepgen.00.stepspace [JOINT_0]STEPSPACE
setp [HMOT](CARD0).stepgen.00.position-scale [JOINT_0]STEP_SCALE
setp [HMOT](CARD0).stepgen.00.step_type 0
setp [HMOT](CARD0).stepgen.00.control-type 1
setp [HMOT](CARD0).stepgen.00.maxaccel [JOINT_0]STEPGEN_MAXACCEL
setp [HMOT](CARD0).stepgen.00.maxvel [JOINT_0]STEPGEN_MAXVEL
setp [HMOT](CARD0).stepgen.00.direction.invert_output true
# This is the slave motor
setp [HMOT](CARD0).stepgen.01.dirsetup [JOINT_0]DIRSETUP
setp [HMOT](CARD0).stepgen.01.dirhold [JOINT_0]DIRHOLD
setp [HMOT](CARD0).stepgen.01.steplen [JOINT_0]STEPLEN
setp [HMOT](CARD0).stepgen.01.stepspace [JOINT_0]STEPSPACE
setp [HMOT](CARD0).stepgen.01.position-scale [JOINT_0]STEP_SCALE
setp [HMOT](CARD0).stepgen.01.step_type 0
setp [HMOT](CARD0).stepgen.01.control-type 1
setp [HMOT](CARD0).stepgen.01.maxaccel [JOINT_0]STEPGEN_MAXACCEL
setp [HMOT](CARD0).stepgen.01.maxvel [JOINT_0]STEPGEN_MAXVEL
setp [HMOT](CARD0).stepgen.01.direction.invert_output true
# ---closedloop stepper signals---
net x-pos-cmd <= joint.0.motor-pos-cmd
net x-vel-cmd <= joint.0.vel-cmd
net x-output <= [HMOT](CARD0).stepgen.00.velocity-cmd [HMOT](CARD0).stepgen.01.velocity-cmd
net x-pos-fb <= [HMOT](CARD0).stepgen.00.position-fb
net x-pos-fb => joint.0.motor-pos-fb
net x-enable <= joint.0.amp-enable-out
net x-enable => [HMOT](CARD0).stepgen.00.enable [HMOT](CARD0).stepgen.01.enable
Regards
Marius
www.bluearccnc.com
Please Log in or Create an account to join the conversation.
In your .ini file coordinates= sets the joint mapping to axes.
[KINS]
KINEMATICS = trivkins coordinates=XYYZ
JOINTS = 4
setting the home sequence to a negative number on both sides of the gantry, tells Linuxcnc that they are joined together.
HOME_OFFSET = 43
HOME_SEARCH_VEL = -100
HOME_LATCH_VEL = 10
HOME_FINAL_VEL = 50
HOME_USE_INDEX = NO
HOME_SEQUENCE = -2
finally home_offset is used to square the gantry in software. if one side is 2mm out, then just have a 2mm difference between the home_offset values
This is supported in pncconf hence my question.
Please Log in or Create an account to join the conversation.
But I take note of the your suggestions.
Regards
Marius
www.bluearccnc.com
Please Log in or Create an account to join the conversation.
Does this look reasonable? It currently uses a switch offset that is hard coded in the post.
I "think" that I have a "working" config.
Some changes to the G-code I made are:
- replace #<keep-z-motion>=1 with #<tube-cut>=1
- use spindle 0 instead of 3
- replace ph with pd for temporary material
I can only test on a sim and it is a bit hard to tell if it is correct. I hope to rig up a goofy rotary axis with a little rotary table I have here in the next week or so which may allow some reasonable testing. In the meantime I will clean up this code and make a test branch if anyone wants to give it a try.
What size tube was the last G-code written for?
Please Log in or Create an account to join the conversation.
The tube is 100mmx100mm
Please Log in or Create an account to join the conversation.
- The G-code file was missing the #<_hal[plasmac.float-switch-travel] subtraction from the G92 line. I added it in for this test.
- I didn't have any 100x100 tube so I used 50x50 and roughly scaled the G-code to suit.
- The G04 P0.5 is not required after the spindle on command as we use the delay from the temporary material.
- I won't be doing any cutting with the flimsy setup I cobbled together.
Would it be best to end the file with a G92.1 to rest the offsets rather than just a G92 A0, maybe even have that at the beginning as well for a known starting point. I have not had much to do with G92 offsets but they seem to accumulate with each run of this code.
There is still quite a bit of work to do, mostly in the GUI to disable/hide some functions that are not able to be used while a tube cutting job is loaded.
I hope to get time tomorrow to push a test branch with just the basics that we have so far.
Please Log in or Create an account to join the conversation.
Regards
Marius
www.bluearccnc.com
Please Log in or Create an account to join the conversation.
Oops, I thought I added this. Fixed in the attached post.The G-code file was missing the #<_hal[plasmac.float-switch-travel] subtraction from the G92 line. I added it in for this test.
Good point. This is now fixed.The G04 P0.5 is not required after the spindle on command as we use the delay from the temporary material.
Hmm, I'm not sure why that G92 A0 is in there. It has the potential to get the A axis out of sync. I have removed it.Would it be best to end the file with a G92.1 to rest the offsets rather than just a G92 A0
The attached example ngc file is now set up for 50mm square. The circle is still about 184mm diameter so it wraps nearly all the way around the tube.
Please Log in or Create an account to join the conversation.