I also can use the MC_Power FB to enable the drive ```
IF Axis.bRegulatorOn THEN
Β Β // Enable the drive with an SPI command
END_IF
```
I already see that the control loop of the SM_Drive_PosControl is working. The variable Axis.out.fSetVelocity is changed and when i move the stepper. When i write this variable via SPI as set velocity i see how the position control loop is already working.
The only problem is, when i call MC_MoveVelocity (or another motion FB) it sets the SM_Drive_PosControl Axis in "errorstop" immediately after calling the FB.
I see that fSetPosition is calculated the first time:
Screenshot before executing the FB (stopped in breakpoint):
Screenshot after executing the FB (stopped in breakpoint):
Why the Axis is set to errorstop? I dont find any errorcode?!
Hi,
i have a stepper motor with encoder and a custom hardware to control this stepper motor. This hardware is controlled as a SPI Slave in velocity mode.
I want to use CODESYS V3 SM_Drive_PosControl to control the stepper.
I already feedback the act position from the motor encoder by writing:
I also can use the MC_Power FB to enable the drive ```
IF Axis.bRegulatorOn THEN
Β Β // Enable the drive with an SPI command
END_IF
```
I already see that the control loop of the SM_Drive_PosControl is working. The variable Axis.out.fSetVelocity is changed and when i move the stepper. When i write this variable via SPI as set velocity i see how the position control loop is already working.
The only problem is, when i call MC_MoveVelocity (or another motion FB) it sets the SM_Drive_PosControl Axis in "errorstop" immediately after calling the FB.
I see that fSetPosition is calculated the first time:
Screenshot before executing the FB (stopped in breakpoint):
Screenshot after executing the FB (stopped in breakpoint):
Why the Axis is set to errorstop? I dont find any errorcode?!
Thanks for your help,
Regards,
Andreas
P.S.: I already read this documentation:
https://help.codesys.com/webapp/sm-example-poscontrol;product=CODESYS_SoftMotion;version=4.3.0.0
https://help.codesys.com/webapp/u_QTw72HcW4SW_lc4tlmE1hlxQs%2FSMC_AXIS_STATE;product=SM3_Basic;version=4.2.0.0
https://help.codesys.com/webapp/_sm_edt_drive_scaling_mapping;product=CODESYS_SoftMotion;version=4.3.0.0
https://help.codesys.com/webapp/yMh8bsZYTxWN3bfJc4A4zjmoLqc%2FMC_MoveVelocity;product=SM3_Basic;version=4.3.0.0
Ok i solved the problem by myself.
I had to change the bus cycle task to (in my case) "Profinet_IOTask" :
Regards,
Andreas