Sounds interesting. Do report on what you find out.JohnSent from my Samsung S10
-------- Original message --------From: andrew beck <[email protected]>
Date: 2025-12-31 4:12 p.m. (GMT-06:00) To: "Enhanced Machine Controller
(EMC)" <[email protected]> Subject: [Emc-users] setting up dual
PID loops for servo encoders and scales hey guysjust looking for a config
example if possible for a mesa card from someonethat has this nested PID loop
setup.internal PID loop uses servo motor encoder and the outer Pid loop only
usesthe Intergral value with the scale and then they get summed together
todrive the motorI found this link here on the forum and want to try set it
uphttp://wiki.linuxcnc.org/cgi-bin/wiki.pl?Combining_Two_Feedback_Devices_On_One_AxisThis
page shows how to combine two position feedback devices into two PID'sfor the
tuning and positioning of one axis. 1. This example has one high resolution
linear scale on the axis table and one rotary encoder on the axis drive
motor. 2. This could also be a rotary encoder on the ballscrew and a rotary
encoder on the motor 3. This assumes the PID's are loaded and connected to
the servo thread 4. linear scale position feedback connects to the input of
the pid.4 PID 1. net X-linear-pos-fb 'linear position feedback'
pid.4.feedback 5. motor encoder position feedback connects to the feedback
input of the pid.0 PID 1. net X-motor-pos-fb 'axis motor position
feedback' pid.0.feedback 6. position command signal from LinuxCNC axis
connects to both PID command inputs 1. net Xpos-cmd axis.0.motor-pos-cmd
pid.0.command pid.4.command 7. bit signals from LinuxCNC axis connnects to
enable/disable both PID loops 1. net Xenable axis.0.amp-enable-out
pid.0.enable pid.4.enable 8. set PID loop output limits as specified in ini
file 1. setp pid.0.maxoutput [AXIS_0]PID_MAX_VEL 2. setp
pid.4.maxoutput [AXIS_0]PID_MAX_VEL 9. set the motor encoder PID loop gains
10. NOTE - I gain is set to zero - it would fight the other PID 1. setp
pid.0.Pgain [AXIS_0]P 2. setp pid.0.Igain 0 3. setp pid.0.Dgain
[AXIS_0]D 4. setp pid.0.bias [AXIS_0]BIAS 5. setp pid.0.FF0
[AXIS_0]FF0 6. setp pid.0.FF1 [AXIS_0]FF1 7. setp pid.0.FF2
[AXIS_0]FF2 8. setp pid.0.deadband [AXIS_0]DEADBAND 9. setp
ppmc.0.DAC.00.scale [AXIS_0]OUTPUT_SCALE 11. set the linear scale PID loop
gains 12. NOTE - it has only I gain - all other gains are set to zero 1.
setp pid.4.Pgain 0 2. setp pid.4.Igain [AXIS_0]I 3. setp pid.4.Dgain
0 4. setp pid.4.bias 0 5. setp pid.4.FF0 0 6. setp pid.4.FF1 0
7. setp pid.4.FF2 0 8. setp pid.4.deadband [AXIS_0]DEADBAND 13.
connect both PID output signals to sum2.4 inputs 14. sum the outputs of pid.0
and pid.4 15. pid.0 is using motor encoder feedback 16. pid.4 is using
linear scale feedback 1. net Xoutput-motor pid.0.output sum2.4.in0 2.
net Xoutput-linear pid.4.output sum2.4.in1 17. the summed PID output is
connnected to the DAC input signal 1. net Xoutput sum2.4.out 'DAC input'
18. repeat as necessary for more
axes_______________________________________________Emc-users mailing
[email protected]https://lists.sourceforge.net/lists/listinfo/emc-users
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users