Linking Position Commands in a Gantry
- Sockheaven
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 48
- Thank you received: 10
13 Mar 2020 02:28 #159980
by Sockheaven
Linking Position Commands in a Gantry was created by Sockheaven
I've been working on a EtherCAT configuration with 4 joints, XYZX configuration (see attached config files).
Everything works fine until i add the extra X axis for a gantry configuration.
I can move up to teh FERROR limit, and then Joint 3 faults out with a position error limit.
After debugging what I'm finding is that while all the PDO information being sent is fine and drives are not getting position error faults, I think something is not configured correctly with the kinematics.
Looking at the HAL meter, it appears that joint.3.motor-pos-cmd is not being set equal to X command.
I tried manually setting it (see .hal file ~line 69) but every conceivable way i've tried to set it, LinuxCNC will error on startup saying the signal already has an output pin.
The feedback is working correctly, just not position command.
I did some searching and found the "kinstype=B" attribute you can add to the KINEMATICS variable in the .ini file, but I don't want to be forced to home individual joints at startup - I am handling that externally when i start up the drives in "service mode" then on using a digital input i switch modes to ethercat.
But I will say, it works correctly after homing if i use kinstype=B, not sure why though.
In fact, kinstype=B isnt horrible, but if you have to re-home, re-homing each individual joint ends up causing position error faults.
Anyone have an idea what may be configured incorrectly? I had previously used a similar configuration with step/dir, and didnt have this problem - but then again the step/dir configuration didn't have feedback.
Everything works fine until i add the extra X axis for a gantry configuration.
I can move up to teh FERROR limit, and then Joint 3 faults out with a position error limit.
After debugging what I'm finding is that while all the PDO information being sent is fine and drives are not getting position error faults, I think something is not configured correctly with the kinematics.
Looking at the HAL meter, it appears that joint.3.motor-pos-cmd is not being set equal to X command.
I tried manually setting it (see .hal file ~line 69) but every conceivable way i've tried to set it, LinuxCNC will error on startup saying the signal already has an output pin.
The feedback is working correctly, just not position command.
I did some searching and found the "kinstype=B" attribute you can add to the KINEMATICS variable in the .ini file, but I don't want to be forced to home individual joints at startup - I am handling that externally when i start up the drives in "service mode" then on using a digital input i switch modes to ethercat.
But I will say, it works correctly after homing if i use kinstype=B, not sure why though.
In fact, kinstype=B isnt horrible, but if you have to re-home, re-homing each individual joint ends up causing position error faults.
Anyone have an idea what may be configured incorrectly? I had previously used a similar configuration with step/dir, and didnt have this problem - but then again the step/dir configuration didn't have feedback.
Please Log in or Create an account to join the conversation.
13 Mar 2020 13:15 #160011
by andypugh
Replied by andypugh on topic Linking Position Commands in a Gantry
One thing I notice is that you have a bad tag in the INI.3HOME_SEQUENCE isn't valid.
Also, you probably want both joints of X to have -1 as the home sequence.
Why do you have a separate "float-thread"? It would be usual to use servo-thread for everything.
Anyway, the problem is here:
You need to pass joint.3 commmand to X' and joint.0 command to X.
With an XYZX config the joints are driven separately to the same real-world position (which will generally be slightly different absolute motor positions)
You have join.3 command commented out in the HAL.
It looks like you need another scale for it too.
(Are you sure that lcec doesn't support scaling internally?)
[JOINT_3]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = -0.001
MAX_LIMIT = 200.0
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 750.0
SCALE = 80.0
FERROR = 100
MIN_FERROR = 10
HOME_OFFSET = 0.0
3HOME_SEQUENCE = 1
Also, you probably want both joints of X to have -1 as the home sequence.
Why do you have a separate "float-thread"? It would be usual to use servo-thread for everything.
Anyway, the problem is here:
# Translate X / X' Position Command
net xpos-cmd joint.0.motor-pos-cmd => scale.0.in
#net xpos-cmd => joint.3.motor-pos-cmd
#net xposprimepos-cmd joint.0.motor-pos-cmd => joint.3.motor-pos-cmd
setp scale.0.gain 10000 #invert of above
setp scale.0.offset 0
net PosCmdX-Scaled conv-float-u32.1.in <= scale.0.out
net PosCmdX-IntOut conv-float-u32.1.out => lcec.0.0.TxPositionCommand lcec.0.1.TxPositionCommand
You need to pass joint.3 commmand to X' and joint.0 command to X.
With an XYZX config the joints are driven separately to the same real-world position (which will generally be slightly different absolute motor positions)
You have join.3 command commented out in the HAL.
It looks like you need another scale for it too.
(Are you sure that lcec doesn't support scaling internally?)
The following user(s) said Thank You: Sockheaven
Please Log in or Create an account to join the conversation.
- Sockheaven
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 48
- Thank you received: 10
13 Mar 2020 14:12 #160017
by Sockheaven
Replied by Sockheaven on topic Linking Position Commands in a Gantry
Ah you found it, by fixing the INI file error (3HOME...) everything started working as expected.
You're right about the HAL file commented out line - I had left that in there to show what i was trying to do.
If I uncomment that line, then LinuxCNC starts up with a HAL error saying that xpos-cmd already has an output pin.
Thanks Andy!
You're right about the HAL file commented out line - I had left that in there to show what i was trying to do.
If I uncomment that line, then LinuxCNC starts up with a HAL error saying that xpos-cmd already has an output pin.
Thanks Andy!
Attachments:
Please Log in or Create an account to join the conversation.
13 Mar 2020 16:14 #160037
by andypugh
Replied by andypugh on topic Linking Position Commands in a Gantry
You will need to use xprime-pos-cmd or something similar.
Treat the two X joints as entirely different entities, different command, different scale, different signals.
Treat the two X joints as entirely different entities, different command, different scale, different signals.
Please Log in or Create an account to join the conversation.
Time to create page: 0.094 seconds