Advantage of closing the position loop in LinuxCNC
- tommylight
-
- Away
- Moderator
-
Less
More
- Posts: 19843
- Thank you received: 6717
26 Oct 2022 23:23 #255155
by tommylight
Both of our examples are feeding position info back to LinuxCNC, so the loop is closed in LinuxCNC.
New step/dir drives close the loop in the drive, and when there is no feedback to LinuxCNC it can not know machine moved while drives are disabled or enabled, hence open loop.
Replied by tommylight on topic Advantage of closing the position loop in LinuxCNC
Yes it is, all the good drives will keep encoders working and supplying feedback.Hmm, I have limited experience, but both my old Yaskawa drives (±10V) and my more modern Omrons (EtherCAT) continue to supply encoder info when disabled. Is that not common?
Both of our examples are feeding position info back to LinuxCNC, so the loop is closed in LinuxCNC.
New step/dir drives close the loop in the drive, and when there is no feedback to LinuxCNC it can not know machine moved while drives are disabled or enabled, hence open loop.
Please Log in or Create an account to join the conversation.
- arvidb
-
- Offline
- Platinum Member
-
Less
More
- Posts: 512
- Thank you received: 158
26 Oct 2022 23:36 - 26 Oct 2022 23:38 #255157
by arvidb
Replied by arvidb on topic Advantage of closing the position loop in LinuxCNC
You can have feedback to LinuxCNC without closing the loop there. And if I'm not mistaken LinuxCNC will internally set actual (i.e. commanded) position to fed back position while drives are disabled.
I do know that I can run my EtherCAT drives like that: the loops are closed in the drive (no pids loaded in HAL at all), I get actual position feedback from the drive (that works also when the drives are disabled), and there is no problem with turning the drives back on again after they've been moved; LinuxCNC keeps track of where they are also while disabled.
I do know that I can run my EtherCAT drives like that: the loops are closed in the drive (no pids loaded in HAL at all), I get actual position feedback from the drive (that works also when the drives are disabled), and there is no problem with turning the drives back on again after they've been moved; LinuxCNC keeps track of where they are also while disabled.
Last edit: 26 Oct 2022 23:38 by arvidb. Reason: Clarity
Please Log in or Create an account to join the conversation.
- Ausschuss-Manufaktur
- Offline
- New Member
-
Less
More
- Posts: 18
- Thank you received: 10
27 Oct 2022 10:50 #255175
by Ausschuss-Manufaktur
Replied by Ausschuss-Manufaktur on topic Advantage of closing the position loop in LinuxCNC
Thanks for all the opinions.
I think I’m going to use a 7i76e for now and go with Step/Dir controlled Delta Servos.
Moving the Schaublins axis by Hand is probably not necessary I think. But I never really thought about it before.
If I’m going to encounter problems with the Index signal or want to be able to move the axis like tommylight likes, I can always add a 7i85 and use the encoder signal like arvidb does
I think I’m going to use a 7i76e for now and go with Step/Dir controlled Delta Servos.
Moving the Schaublins axis by Hand is probably not necessary I think. But I never really thought about it before.
If I’m going to encounter problems with the Index signal or want to be able to move the axis like tommylight likes, I can always add a 7i85 and use the encoder signal like arvidb does

The following user(s) said Thank You: arvidb
Please Log in or Create an account to join the conversation.
- tommylight
-
- Away
- Moderator
-
Less
More
- Posts: 19843
- Thank you received: 6717
27 Oct 2022 12:09 #255179
by tommylight
You can also set LinuxCNC to show the position from that feedback and use the other feedbacks for inner workings.
But i am also sure that if inclined, it can be made to do just that.
Replied by tommylight on topic Advantage of closing the position loop in LinuxCNC
Yes, of course.You can have feedback to LinuxCNC without closing the loop there.
You can also set LinuxCNC to show the position from that feedback and use the other feedbacks for inner workings.
I do not think so, changing feedback while LinuxCNC is running would cause a lot of issues in a lot of situations.And if I'm not mistaken LinuxCNC will internally set actual (i.e. commanded) position to fed back position while drives are disabled.
But i am also sure that if inclined, it can be made to do just that.
In that case, it is a closed loop system at the LinuxCNC side, also most probably loop is closed in the drives so LinuxCNC gets just the actual position.I do know that I can run my EtherCAT drives like that: the loops are closed in the drive (no pids loaded in HAL at all), I get actual position feedback from the drive (that works also when the drives are disabled), and there is no problem with turning the drives back on again after they've been moved; LinuxCNC keeps track of where they are also while disabled.
Please Log in or Create an account to join the conversation.
- arvidb
-
- Offline
- Platinum Member
-
Less
More
- Posts: 512
- Thank you received: 158
27 Oct 2022 16:38 #255203
by arvidb
No, the loops are closed only in the drives. That LinuxCNC receives feedback does not mean it's closing the loop since it does not use that feedback to produce a control signal. (It only outputs an open-loop position reference.)
I guess you could argue that it's kind of a time-shared control where the drive closes the loop while the servos are active and LinuxCNC closes the loop when the servos are inactive.
But besides being a bit silly it also misses the point that you can get the performance benefits of closing the loops in the drives and still be able to move the joints by hand without any problems.
Replied by arvidb on topic Advantage of closing the position loop in LinuxCNC
It does, here is the code:
I do not think so, changing feedback while LinuxCNC is running would cause a lot of issues in a lot of situations.And if I'm not mistaken LinuxCNC will internally set actual (i.e. commanded) position to fed back position while drives are disabled.
case EMCMOT_MOTION_DISABLED:
/* set position commands to match feedbacks, this avoids
disturbances and/or following errors when enabling */
emcmotStatus->carte_pos_cmd = emcmotStatus->carte_pos_fb;
for (joint_num = 0; joint_num < ALL_JOINTS; joint_num++) {
/* point to joint struct */
joint = &joints[joint_num];
/* save old command */
joint->pos_cmd = joint->pos_fb;
/* set joint velocity and acceleration to zero */
joint->vel_cmd = 0.0;
joint->acc_cmd = 0.0;
}
In that case, it is a closed loop system at the LinuxCNC side, also most probably loop is closed in the drives so LinuxCNC gets just the actual position.I do know that I can run my EtherCAT drives like that: the loops are closed in the drive (no pids loaded in HAL at all), I get actual position feedback from the drive (that works also when the drives are disabled), and there is no problem with turning the drives back on again after they've been moved; LinuxCNC keeps track of where they are also while disabled.
No, the loops are closed only in the drives. That LinuxCNC receives feedback does not mean it's closing the loop since it does not use that feedback to produce a control signal. (It only outputs an open-loop position reference.)
I guess you could argue that it's kind of a time-shared control where the drive closes the loop while the servos are active and LinuxCNC closes the loop when the servos are inactive.

Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 23213
- Thank you received: 4892
27 Oct 2022 21:51 #255250
by andypugh
The LinuxCNC PID had a "command-deriv" pin that can be connected to the joint motor velocity output for direct feedforward. ( joint.N.joint-vel-cmd )
Replied by andypugh on topic Advantage of closing the position loop in LinuxCNC
How is this different from using feed forward in the drive's controller? (LinuxCNC's HAL pid component calculates the feed forward values reactively too, from the derivative of the command signal.)
The LinuxCNC PID had a "command-deriv" pin that can be connected to the joint motor velocity output for direct feedforward. ( joint.N.joint-vel-cmd )
The following user(s) said Thank You: arvidb
Please Log in or Create an account to join the conversation.
- Ehsan_R
- Offline
- Premium Member
-
Less
More
- Posts: 88
- Thank you received: 1
24 Apr 2024 20:14 #299021
by Ehsan_R
Replied by Ehsan_R on topic Advantage of closing the position loop in LinuxCNC
I am controlling a robotic arm using a few servo motors
Sometimes it is necessary to disable the motors and move the arm manually. In this case, I want to receive the position change from the motor encoder.
Does anyone know how to do this?
Sometimes it is necessary to disable the motors and move the arm manually. In this case, I want to receive the position change from the motor encoder.
Does anyone know how to do this?
Please Log in or Create an account to join the conversation.
- tommylight
-
- Away
- Moderator
-
Less
More
- Posts: 19843
- Thank you received: 6717
24 Apr 2024 20:59 #299025
by tommylight
Replied by tommylight on topic Advantage of closing the position loop in LinuxCNC
Yes, you wire the "machine-is-enabled" or "amplifier-enable" pin to actual drive enable.
But first, are the encoders wired back to LinuxCNC in any way?
But first, are the encoders wired back to LinuxCNC in any way?
The following user(s) said Thank You: Ehsan_R
Please Log in or Create an account to join the conversation.
- Ehsan_R
- Offline
- Premium Member
-
Less
More
- Posts: 88
- Thank you received: 1
25 Apr 2024 05:47 #299042
by Ehsan_R
Replied by Ehsan_R on topic Advantage of closing the position loop in LinuxCNC
Yes, I can see the encoder data in the show hal congratulations menu
Can you explain in detail how to do this?
Can you explain in detail how to do this?
Please Log in or Create an account to join the conversation.
- tommylight
-
- Away
- Moderator
-
Less
More
- Posts: 19843
- Thank you received: 6717
25 Apr 2024 08:52 #299051
by tommylight
Replied by tommylight on topic Advantage of closing the position loop in LinuxCNC
Start a new topic with details about the hardware in use.
Please Log in or Create an account to join the conversation.
Time to create page: 0.084 seconds