Slaving the second gantry motor (7i92)
05 Nov 2015 17:49 - 05 Nov 2015 17:51 #64800
by dannym
Slaving the second gantry motor (7i92) was created by dannym
I have a CNC router with linuxCNC 2.6 and a 7i92 control and independent limit switches for each side of the gantry. It's set up enough that the Z axis works and the carriage moves up and down the gantry but the gantry uses 2 motors and I only have one moving so far.
I understand I could hard-wire the step/dir together in software config, but that's not any good, it's impossible to fix a racking issue when it's done that way.
Just want to do what I did in Mach3 "slave" mode- normally they move in sync, but when you go to home the gantry, it drives both motors until one of the motors (either one) finds a home switch, then that motor stops while the other continues on until it finds its home switch, then both back off slowly and do the same thing at lower speed for accuracy.
I've seen stuff on "gantrykins" and "trivkins" but the a lot of the posts are years old and their info may be obsolete. What's the way to do this now? Is it just config or does new code need to be included or what?
I understand I could hard-wire the step/dir together in software config, but that's not any good, it's impossible to fix a racking issue when it's done that way.
Just want to do what I did in Mach3 "slave" mode- normally they move in sync, but when you go to home the gantry, it drives both motors until one of the motors (either one) finds a home switch, then that motor stops while the other continues on until it finds its home switch, then both back off slowly and do the same thing at lower speed for accuracy.
I've seen stuff on "gantrykins" and "trivkins" but the a lot of the posts are years old and their info may be obsolete. What's the way to do this now? Is it just config or does new code need to be included or what?
Last edit: 05 Nov 2015 17:51 by dannym.
Please Log in or Create an account to join the conversation.
05 Nov 2015 21:20 #64824
by andypugh
Replied by andypugh on topic Slaving the second gantry motor (7i92)
The information here is up to date
www.linuxcnc.org/index.php/english/forum...-the-same-axis#64415
One thing to be aware of is that LinuxCNC doesn't wait for the second axis to finish homing, so you need to configure so that the final rapid to home is as short as possible or you can have one axis doing a rapid one way while the other is doing a slow search in the other.
This is, admittedly, not ideal. The reason that it doesn't work as simply as Mach is because the situation is not as simple as Mach, as configurations with encoders homing to index have to be considered. Unfortunately in the absence of a truly general solution there hasn't been much effort expended on the not-quite-general solution of simply waiting between states for all simultaneously-homing axes to reach each change-over point.
www.linuxcnc.org/index.php/english/forum...-the-same-axis#64415
One thing to be aware of is that LinuxCNC doesn't wait for the second axis to finish homing, so you need to configure so that the final rapid to home is as short as possible or you can have one axis doing a rapid one way while the other is doing a slow search in the other.
This is, admittedly, not ideal. The reason that it doesn't work as simply as Mach is because the situation is not as simple as Mach, as configurations with encoders homing to index have to be considered. Unfortunately in the absence of a truly general solution there hasn't been much effort expended on the not-quite-general solution of simply waiting between states for all simultaneously-homing axes to reach each change-over point.
Please Log in or Create an account to join the conversation.
07 Nov 2015 17:42 #64954
by dannym
Replied by dannym on topic Slaving the second gantry motor (7i92)
I did spend considerable time trying to figure this out. I must confess I don't fully understand most of the files' contents and just winging it. I have the 7i92 plugged into a G540, X Y Z are plugged into their respective plugs as-labeled on the G540 and the A-channel is the second slaved axis for the X2.
LinuxCNC does load, but X2 (A) does not drive. In fact the drive has no holding torque either which seems to be something you see if there's just noise on the step/dir inputs, not a driven level.
ini/hal files enclosed, can you give me some help here?
LinuxCNC does load, but X2 (A) does not drive. In fact the drive has no holding torque either which seems to be something you see if there's just noise on the step/dir inputs, not a driven level.
ini/hal files enclosed, can you give me some help here?
Please Log in or Create an account to join the conversation.
07 Nov 2015 18:17 #64955
by andypugh
You normally only see that if the drive isn't enabled (but the other drives are, so that is unlikely). One possibility is swapped motor wires.
Replied by andypugh on topic Slaving the second gantry motor (7i92)
X2 (A) does not drive. In fact the drive has no holding torque either which seems to be something you see if there's just noise on the step/dir inputs, not a driven level.
You normally only see that if the drive isn't enabled (but the other drives are, so that is unlikely). One possibility is swapped motor wires.
Please Log in or Create an account to join the conversation.
08 Nov 2015 01:26 - 08 Nov 2015 01:32 #64961
by dannym
Replied by dannym on topic Slaving the second gantry motor (7i92)
Definitely not. That physical setup works fine on Mach3, so there's no wiring problem. I am simply replacing the Ethernet Smoothstepper cable with the 7i92 cable at the G540 input. There is no per-drive Enable pin on the G540, just the Charge Pump and I have that requirement turned off right now. The other 3 axes power just fine under LinuxCNC, and all 4 work just fine under Mach3.
Had this before- if the 7i92 output is unstable, the G540's output will drop its holding torque. Weird but that's the case.
IIRC last time it was because setup/hold times on the STEP weren't good. But I copied all that from axis 0 to axis 3 and renamed to 3 where it seemed appropriate. Clearly I screwed something up, but I really could use some help there, there's lots of elements in those configs I don't understand and I can't make meaningful progress just randomly changing them.
I was deleting the PID4 stuff related to the spindle. I thought it would conflict with axis3, not realizing that PID3 would go with axis 3, not PID4. I am using a Modbus VFD and AFAIK don't need that spindle PID at all.
On the # set PID loop gains from inifile for axis3, I just referenced [AXIS_0]. that's ok isn't it?
Had this before- if the 7i92 output is unstable, the G540's output will drop its holding torque. Weird but that's the case.
IIRC last time it was because setup/hold times on the STEP weren't good. But I copied all that from axis 0 to axis 3 and renamed to 3 where it seemed appropriate. Clearly I screwed something up, but I really could use some help there, there's lots of elements in those configs I don't understand and I can't make meaningful progress just randomly changing them.
I was deleting the PID4 stuff related to the spindle. I thought it would conflict with axis3, not realizing that PID3 would go with axis 3, not PID4. I am using a Modbus VFD and AFAIK don't need that spindle PID at all.
On the # set PID loop gains from inifile for axis3, I just referenced [AXIS_0]. that's ok isn't it?
Last edit: 08 Nov 2015 01:32 by dannym.
Please Log in or Create an account to join the conversation.
08 Nov 2015 04:42 #64962
by PCW
Replied by PCW on topic Slaving the second gantry motor (7i92)
It does no matter where ini values come from so AXIS_0 should be fine
Did you verify that axis 3 position is changing when you jog
Not sure what enables the G540 drive but it may need a first valid step pulse
Did you verify that axis 3 position is changing when you jog
Not sure what enables the G540 drive but it may need a first valid step pulse
Please Log in or Create an account to join the conversation.
11 Nov 2015 02:57 - 11 Nov 2015 09:38 #65098
by dannym
Replied by dannym on topic Slaving the second gantry motor (7i92)
OK, it appears that I've got "joint mode" and "world mode" confused.
When I select Joint 3 and hit the "+" button, the second gantry motor DOES move, by itself, and has holding torque.
I do expect it WOULD work in World Mode, except any attempt to move any axis gives "Following Error". I did have the speeds set high, although they should be correct. I reset MAX_VELOCITY to 5.0 but no change.
I tinkered with this for awhile, but no change. I don't quite get it. This is a "PID" .ini file which is different than other examples, is something inappropriate about that? (I included my .ini and .hal files earlier in the thread).
Hmm I increased FERROR to 0.005 and got axis 2 to move in World mode, but the other axes still generate Following Error even with the FERROR increased like that.
Then I increased FERROR to 0.2 and both X-steppers DO move in World mode... but only once. As soon as I release the + or - button, both Joint 0 and Joint 3 report "Following Error" and the system stops.
EDIT: Well, what I realized is I could move the gantry with MDI G0 without error at 300ipm. It was only manual jogging that caused the Following error.
300 ipm is abnormally slow. I bumped the max velocity up to 1200 ipm the router is meant to do. Now MDI G0 moves START working- but after a few inches it halts with a Following error. Which suggests to me it's breaking when it exceeds a certain speed and just took a few inches to reach that speed and broke.
I saw this could be an inappropriately long BASE_PERIOD, but that's not even used for 7i92 generators, is it?
When I select Joint 3 and hit the "+" button, the second gantry motor DOES move, by itself, and has holding torque.
I do expect it WOULD work in World Mode, except any attempt to move any axis gives "Following Error". I did have the speeds set high, although they should be correct. I reset MAX_VELOCITY to 5.0 but no change.
I tinkered with this for awhile, but no change. I don't quite get it. This is a "PID" .ini file which is different than other examples, is something inappropriate about that? (I included my .ini and .hal files earlier in the thread).
Hmm I increased FERROR to 0.005 and got axis 2 to move in World mode, but the other axes still generate Following Error even with the FERROR increased like that.
Then I increased FERROR to 0.2 and both X-steppers DO move in World mode... but only once. As soon as I release the + or - button, both Joint 0 and Joint 3 report "Following Error" and the system stops.
EDIT: Well, what I realized is I could move the gantry with MDI G0 without error at 300ipm. It was only manual jogging that caused the Following error.
300 ipm is abnormally slow. I bumped the max velocity up to 1200 ipm the router is meant to do. Now MDI G0 moves START working- but after a few inches it halts with a Following error. Which suggests to me it's breaking when it exceeds a certain speed and just took a few inches to reach that speed and broke.
I saw this could be an inappropriately long BASE_PERIOD, but that's not even used for 7i92 generators, is it?
Last edit: 11 Nov 2015 09:38 by dannym.
Please Log in or Create an account to join the conversation.
11 Nov 2015 09:54 #65104
by andypugh
Replied by andypugh on topic Slaving the second gantry motor (7i92)
It sounds like your stepgen acceleration is lower than your axis accelleration.
Is there any reason you chose to use a PID setup?
Is there any reason you chose to use a PID setup?
Please Log in or Create an account to join the conversation.
11 Nov 2015 10:15 #65105
by dannym
Replied by dannym on topic Slaving the second gantry motor (7i92)
I wasn't able to get any automated setup for the 7i92, and someone volunteered this file as a 7i92 config for use with a G540 and steppers. No, really, I don't even understand what purpose a PID has with steppers, but it was literally all I had to go on.
I did try to follow the "stepgen max" rule given.
MAX_VELOCITY = 20
MAX_ACCELERATION = 80
# Set Stepgen max 20% higher than the axis
STEPGEN_MAX_VEL = 24
STEPGEN_MAX_ACC = 96
I've tried other numbers since this.
I did try to follow the "stepgen max" rule given.
MAX_VELOCITY = 20
MAX_ACCELERATION = 80
# Set Stepgen max 20% higher than the axis
STEPGEN_MAX_VEL = 24
STEPGEN_MAX_ACC = 96
I've tried other numbers since this.
Please Log in or Create an account to join the conversation.
11 Nov 2015 10:33 #65109
by andypugh
Replied by andypugh on topic Slaving the second gantry motor (7i92)
It may be that the PID is maxing out. What are the PID limits set to?
Running a step/dir drive in velocity mode with a PID can have some significant advantages, but it does mean that you need PID tuning, just like any other pid-controlled system.
Running a step/dir drive in velocity mode with a PID can have some significant advantages, but it does mean that you need PID tuning, just like any other pid-controlled system.
Please Log in or Create an account to join the conversation.
Time to create page: 0.087 seconds