ZERRADI

Hello everybody

 

I try to run STEP MOTOR using Ladder program but it runs in very slow motion (I tried full step and half step but it run very slow like 1 rpm ) some of you have some idea to run it faster?

Reply 1 0
Glenn
Maybe u can try to lower the cyclic time of the program. The default is 20ms. 

  cyclic time.jpg 
Reply 1 0
thiagoralves
I wouldn't recommend you to control a stepper motor straight from PLC code. This is something that should be handled by a more lower level driver or something like that. If you really want to implement this in PLC code, then maybe it would be better to create a second task on your Resources that handles just the step control. Make it run super fast with a very low cycle time (1ms or less depending on your hardware). Then use global variables to make the communication between the main task (running slower, on the default 20ms task) and the fast step control task.
Reply 3 0
garyliong
I wouldn't recommend you to control a stepper motor straight from PLC code. This is something that should be handled by a more lower level driver or something like that. If you really want to implement this in PLC code, then maybe it would be better to create a second task on your Resources that handles just the step control. Make it run super fast with a very low cycle time (1ms or less depending on your hardware). Then use global variables to make the communication between the main task (running slower, on the default 20ms task) and the fast step control task.


Agree, link up as PLC code <==> StepMotor drive controller <==> StepMotor  
Reply 2 0
ZERRADI
Thank you for your help,
i wanna make global variable but i didn't find it, please can you make definition of external  variables output input its not very clear the meaning.

thank you again for your help
Reply 0 0
thiagoralves
https://openplc.discussion.community/post/can-we-share-variables-between-programs-12240185?highlight=global%20variable&pid=1331605916

https://openplc.discussion.community/post/how-to-use-global-variables-10399118?highlight=global%20variable&pid=1310474215
Reply 1 0
Reply