PID for spindle with 7i76e A/B encoder AND index (Z)
30 Oct 2023 10:48 #284114
by jogger
PID for spindle with 7i76e A/B encoder AND index (Z) was created by jogger
Hi folks!
I'm using LinuxCNC for a longer time and I'm now switching from a 5i25 to a 7i76e.
All is running smooth but I have a - small - problem with connecting and programming the main spindle.
The spindle is a professional HSD ES950, 5kW asynchronous motor, with ISO30 tool changer and up to 24000/min. In the past with 5i25 I used a frequency control of the spindle but now I want to use the 0-10V provided by the 7i76e. It works but the U/f curve is not very linear, even at low speeds below 1000/min.
But ok - I always wanted to do a PID control of the spindle speed (e.g. for thread machining) - there shouldn't be any problems with that.
My problem is, that the spindle encoder in my spindle is a 800 teeth gear, so the encoder gives me 3200 A/B pulses/revolution but the driver is limited to 200kHz, which gives a limit of 15000/min (this value can also be found in the manual). But of course I also want to use the spindle with higher speeds up to 24000/min.
So my idea is to use the normal encoder with A/B from 0-15000 and then use the Z index mark (one pulse per revolution - so that would lead to 400 pulses/s for maximum speed at 24000/min) for the PID.
I would implement a switch depending on the choosen S value and if it's higher than 15000 then switch the PID values and the feedback input from A/B to only Z.
But I have no real idea how to do this
So my question is: how can I implement this in HAL - especially taking the Z pulses for feedback?
Thank you for your ideas,
Chris
P.S.:Another "ugly" way would be using PID up to 15000/min and then lincurve for extrapolating from 15000 to 24000/min. but this is not a PID - of course.
I'm using LinuxCNC for a longer time and I'm now switching from a 5i25 to a 7i76e.
All is running smooth but I have a - small - problem with connecting and programming the main spindle.
The spindle is a professional HSD ES950, 5kW asynchronous motor, with ISO30 tool changer and up to 24000/min. In the past with 5i25 I used a frequency control of the spindle but now I want to use the 0-10V provided by the 7i76e. It works but the U/f curve is not very linear, even at low speeds below 1000/min.
But ok - I always wanted to do a PID control of the spindle speed (e.g. for thread machining) - there shouldn't be any problems with that.
My problem is, that the spindle encoder in my spindle is a 800 teeth gear, so the encoder gives me 3200 A/B pulses/revolution but the driver is limited to 200kHz, which gives a limit of 15000/min (this value can also be found in the manual). But of course I also want to use the spindle with higher speeds up to 24000/min.
So my idea is to use the normal encoder with A/B from 0-15000 and then use the Z index mark (one pulse per revolution - so that would lead to 400 pulses/s for maximum speed at 24000/min) for the PID.
I would implement a switch depending on the choosen S value and if it's higher than 15000 then switch the PID values and the feedback input from A/B to only Z.
But I have no real idea how to do this
So my question is: how can I implement this in HAL - especially taking the Z pulses for feedback?
Thank you for your ideas,
Chris
P.S.:Another "ugly" way would be using PID up to 15000/min and then lincurve for extrapolating from 15000 to 24000/min. but this is not a PID - of course.
Please Log in or Create an account to join the conversation.
30 Oct 2023 14:07 - 30 Oct 2023 14:08 #284129
by PCW
Replied by PCW on topic PID for spindle with 7i76e A/B encoder AND index (Z)
I think for simplicity, I would ignore PID control and just use lincurve to linearize
the spindle speed control. PID is not needed for threading as the Z axis is
"electronically geared" to the spindle rotation during threading so spindle speed
accuracy and speed variations are not very important.
I would also check that you do have sufficient torque for threading with a 24K RPM spindle
That said, its probably possible to use the hardware encoder Index to count revolutions since
it can function as a latch triggered by the index, if hal logic is set up to create
a software encoder counter and the counter counts the index enable signal, and further
there is hal logic to set the index enable whenever its detected in a false state,
The index hardware can effectively be used to stretch out the index pulse (which
would be too short to be detected at the 1 KHz servo thread rate by an all software
hal setup.)
the spindle speed control. PID is not needed for threading as the Z axis is
"electronically geared" to the spindle rotation during threading so spindle speed
accuracy and speed variations are not very important.
I would also check that you do have sufficient torque for threading with a 24K RPM spindle
That said, its probably possible to use the hardware encoder Index to count revolutions since
it can function as a latch triggered by the index, if hal logic is set up to create
a software encoder counter and the counter counts the index enable signal, and further
there is hal logic to set the index enable whenever its detected in a false state,
The index hardware can effectively be used to stretch out the index pulse (which
would be too short to be detected at the 1 KHz servo thread rate by an all software
hal setup.)
Last edit: 30 Oct 2023 14:08 by PCW.
The following user(s) said Thank You: jogger
Please Log in or Create an account to join the conversation.
31 Oct 2023 13:37 #284184
by jogger
Replied by jogger on topic PID for spindle with 7i76e A/B encoder AND index (Z)
Thanks for your reply
Yes, I thought about it over night and: you are right. I have implemented the lincurve now and from 1000/min to 24000/min it works really well. I think below 1000 it is hard for a U/f based converter to hold a precise speed (my converter also offers vector based control, but only up to 320Hz) - but I will check the voltage of spinout the next days.
Regarding the torque: I can use 5Nm so for small threads (up to M6) it should work. I'm machining only aluminium/plastics. But the direct thread machining is future. Currently I will stay with thread milling ... which of course is much more flexible: one cutter for many thread sizes and deeper threads.
Yes, I thought about it over night and: you are right. I have implemented the lincurve now and from 1000/min to 24000/min it works really well. I think below 1000 it is hard for a U/f based converter to hold a precise speed (my converter also offers vector based control, but only up to 320Hz) - but I will check the voltage of spinout the next days.
Regarding the torque: I can use 5Nm so for small threads (up to M6) it should work. I'm machining only aluminium/plastics. But the direct thread machining is future. Currently I will stay with thread milling ... which of course is much more flexible: one cutter for many thread sizes and deeper threads.
Please Log in or Create an account to join the conversation.
Time to create page: 0.146 seconds