- LinuxCNC
- General LinuxCNC Questions
- Tunning PID Loop, encoder on the linear axis, not on the motor shaft
Tunning PID Loop, encoder on the linear axis, not on the motor shaft
- rbobey1989
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 117
- Thank you received: 29
05 Jun 2025 23:25 #329775
by rbobey1989
Tunning PID Loop, encoder on the linear axis, not on the motor shaft was created by rbobey1989
Well once again here, ready to continue learning, I have obtained some ethercat modules ek1100, el4032 and el5151, el1008 and el2024, I have a Mecal sw453 machine, I continue with mitre saws haha, until now I had carried out all the tests with (H-Bridge PWM) + (DC Motor with encoder coupled directly to the shaft), for the case in question a servo amplifier is used which I have already talked about here in the forum at another time (Maxifet AF 60 10/20) it takes a control signal +/- 10V and also requires a tachometer the motor power supply is 60V, the motor is coupled to a reducer which could verify the transmission ratio, the encoder is 250 ppr and when connecting it to the 5151 module I was able to make some measurements such as the encoder-scale is 10 since for 2000mm I got 20,000 counts.After this hardware introduction, I can add that I've run tests tuning the control loop, and although I've managed to move the axis, I frequently get tracking errors. Some time ago, I asked here on the forum if it was possible to configure this without the encoder on the motor shaft. Based on some exchanges with Tommylight (thanks a lot for everything), he told me that a control loop with this configuration was viable and that Linuxcnc didn't care where the encoder was. Obviously, everything has its difficulties. I've run some tests, including: I increased the servo-thread frequency to 2 kHz. I tried tuning the PID loop by adding P with I and D set to zero, but the system oscillates with gain P=1. Finally, after much trial and error, I arrived at P=6, I=3, D=:4-6, FF1=1, which produces movement, but at the moment of braking, it begins to oscillate. If anyone can contribute ideas on how to improve the loop response for this configuration they would be very welcome,
Please Log in or Create an account to join the conversation.
- tommylight
-
- Away
- Moderator
-
Less
More
- Posts: 20302
- Thank you received: 6907
05 Jun 2025 23:45 #329777
by tommylight
Replied by tommylight on topic Tunning PID Loop, encoder on the linear axis, not on the motor shaft
This is just a stab in the dark, but try
P=0.2 up to 0.5
D=0.01 up to 0.05
FF1=0
Everything else PID related to 0 except some deadband, like 0.001
-
This is not an assumption, this is the only thing that properly works for my Mazak with Mitsubishi drives
And, yes i did a lot of head scratching, it did not help
P=0.2 up to 0.5
D=0.01 up to 0.05
FF1=0
Everything else PID related to 0 except some deadband, like 0.001
-
This is not an assumption, this is the only thing that properly works for my Mazak with Mitsubishi drives
And, yes i did a lot of head scratching, it did not help

The following user(s) said Thank You: rbobey1989
Please Log in or Create an account to join the conversation.
- rbobey1989
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 117
- Thank you received: 29
05 Jun 2025 23:54 #329779
by rbobey1989
Replied by rbobey1989 on topic Tunning PID Loop, encoder on the linear axis, not on the motor shaft
Hi Tommy, thanks for your quick response. These are my ini and hal files if you'd like to take a look.
Please Log in or Create an account to join the conversation.
- rbobey1989
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 117
- Thank you received: 29
06 Jun 2025 00:00 #329781
by rbobey1989
Replied by rbobey1989 on topic Tunning PID Loop, encoder on the linear axis, not on the motor shaft
In this case the encoder resolution is 10 counts/mm (0.1mm) so I use a deadband = 0.05, This eliminated the oscillations that occurred simply by enabling LCNC.
Please Log in or Create an account to join the conversation.
- LinuxCNC
- General LinuxCNC Questions
- Tunning PID Loop, encoder on the linear axis, not on the motor shaft
Time to create page: 0.077 seconds