QTPlasmaC with fourth axis - rotary

More
20 Jun 2023 09:25 #273911 by rodw
Replied by rodw on topic QTPlasmaC with fourth axis - rotary

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.

Slave or Joint Axis ?

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

  • mariusl
  • mariusl's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
20 Jun 2023 10:11 #273912 by mariusl
Replied by mariusl on topic QTPlasmaC with fourth axis - rotary
I just set the machine up for normal three axis operation but then I duplicate the X axis stepper function to serve a slave motor only. The same joint is connected to both steppers. This way you don't have to drive two motor drives with the same output signal. Each motor on the X axis (which has two motors) is driven by their own stepper function and physical output pins.

Regards
Marius


www.bluearccnc.com

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

  • mariusl
  • mariusl's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
20 Jun 2023 10:24 #273914 by mariusl
Replied by mariusl on topic QTPlasmaC with fourth axis - rotary
This is typically what I do.
#*******************
#  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.

More
20 Jun 2023 12:32 #273926 by rodw
Replied by rodw on topic QTPlasmaC with fourth axis - rotary
Maybe you have done it this way but since V 2.8 Linuxcnc supports Joint axes and auto squaring on homing if both sides have a home switch
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
So the first gantry end to hit a home switch stops and waits for the other to catch up, then the homing happens in unison.
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.

  • mariusl
  • mariusl's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
20 Jun 2023 14:42 #273935 by mariusl
Replied by mariusl on topic QTPlasmaC with fourth axis - rotary
The auto squaring is not always desirable especially if the gantry is very stiff and in most cases we only have one home switch per axis. I prefer to build the gantry to be square or worst case have a mechanical stop to square the table.
But I take note of the your suggestions.

Regards
Marius


www.bluearccnc.com

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

More
21 Jun 2023 07:55 #273984 by phillc54
Replied by phillc54 on topic QTPlasmaC with fourth axis - rotary

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?
The following user(s) said Thank You: tommylight, Clive S, snowgoer540

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

More
22 Jun 2023 11:29 #274037 by LesNewell
Replied by LesNewell on topic QTPlasmaC with fourth axis - rotary
I have attached updated code plus the post and a sample SheetCam job file in a zip file.
The tube is 100mmx100mm
Attachments:

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

More
24 Jun 2023 06:12 - 24 Jun 2023 06:16 #274162 by phillc54
Replied by phillc54 on topic QTPlasmaC with fourth axis - rotary
The first motion test seems to have gone reasonably well. A few things to note:
  • 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.

 
Last edit: 24 Jun 2023 06:16 by phillc54.
The following user(s) said Thank You: mariusl, tommylight, Clive S, snowgoer540, caretech

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

  • mariusl
  • mariusl's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
26 Jun 2023 06:39 #274225 by mariusl
Replied by mariusl on topic QTPlasmaC with fourth axis - rotary
Wow Phill. That looks really impressive. Thanks for all the hard work you put into this software. It is much appreciated.

Regards
Marius


www.bluearccnc.com

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

More
26 Jun 2023 10:36 #274235 by LesNewell
Replied by LesNewell on topic QTPlasmaC with fourth axis - rotary

The G-code file was missing the #<_hal[plasmac.float-switch-travel] subtraction from the G92 line. I added it in for this test. 

Oops, I thought I added this. Fixed in the attached post.

The G04 P0.5 is not required after the spindle on command as we use the delay from the temporary material. 

Good point. This is now fixed.

Would it be best to end the file with a G92.1 to rest the offsets rather than just a G92 A0 

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.

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.
Attachments:
The following user(s) said Thank You: phillc54, mariusl, tommylight, Clive S

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

Moderators: snowgoer540
Time to create page: 0.083 seconds
Powered by Kunena Forum