Page 1 of 1

Oak Spindle positioning for tool change

Posted: Fri Aug 22, 2025 7:07 am
by pascalken
Hi,

to change the tool, the spindle has to move to a dedicated position.
In CNC 12 this is normally done by outputting a “INVERTER/ORIENT”.
Then it waits for an “INVERTER/ORIENTED” signal that signals that the position is reached.

Our drive (Siemens SIMODRIVE 611 with UNIVERSAL control board, see annex) does not have this method available while in an analog control mode (+10V to =10V) for the speed. Changing to another mode appears only possible using the ProfiBus, which is not easily done from the centroid.

However the encoder of the spindle drive is connected to the OAK input and there is a proximity sensor giving the approximate position around the exact position of the spindle for changing the tool. It should be possible to orient the spindle using this information.

Can you help me to adapt the PLC for this?

The routine should run the spindle with a slow speed until the above mentioned proximity switch is triggered and then continue to rotate until the encoder matches a certain predefined position or angle at which moment it should stop the spindle. Speed is not critical, accuracy is.


In particular I do not know how to read the spindle position or angle from the encoder in the PLC program.

Thank you for your help.

Re: Oak Spindle positioning for tool change

Posted: Sun Aug 24, 2025 8:11 pm
by cncsnw
You can read the spindle encoder position in the PLC program using PLC system variables SV_MPU11_ABS_POS_n.

Those variables count axes from zero. For example, if you have configured your spindle encoder as axis #6 (P35 = 6) then you would read the spindle encoder counts in SV_MPU11_ABS_POS_5.

The value is cumulative counts from power-up, or from the last M150 command. If you save a snapshot of SV_MPU11_ABS_POS_n at the rising edge of your prox sensor, then you can add your offset amount to find out the desired counts at the orient position.

If the drive does not have a stop-and-hold-position command available in analog mode, then you will probably have to implement a PID position loop in the PLC program.

Re: Oak Spindle positioning for tool change

Posted: Wed Sep 10, 2025 8:52 am
by pascalken
Indeed I can move the drive using e.g. S2 M3 to rotate the drive to a certain position.
Then I issued an M5 command to stop the drive, but this does not work since the belt moves the spindle slightly out of position.
S0 M3 should keep it in position, however due to offset errors the drive moves slowly (probably temperature dependent since correcting the offset only works briefly).
So, you are right, I need a stop-and-hold-position command with feedback.

Can you help me to implement a PID position loop?
It should be something similar as for the X Y Z axis.

Thank you for your help.