Motor won't run at a constant speed (keeps accelerating and decelerating)

12 years 2 months ago #29526444 by Anonymous
I want my motor to run at 600 RPM for 10 seconds. I used a DO LOOP function to do this. But the motor didn't run at a constant speed but kept accelerating and decelerating. The following is the part of the code.

SetTimerCount(1,10000)
SetTimerState(1,0)
DO
SetCommand(_G, ChannelNumber, 600)
Loop Until GetTimerCount(1) = 0

Please Log in or Create an account to join the conversation.

12 years 2 months ago #29526445 by Roboteq
I think that what is happening is a watchdog timeout: if no command is received within 1000ms the motors will stop.
You can fix this either by sending commands more often or by changing the RS232 timer.
Put 0 to disable. Put 10000 to change to 10s.

Please Log in or Create an account to join the conversation.

12 years 2 months ago #29526446 by Anonymous
I used a loop to send the command. How can I send the command more often? Actually, how can I send a continuous command in script like the command in the Run tab?

Please Log in or Create an account to join the conversation.

12 years 2 months ago #29526447 by Roboteq
You could loop 20 times and have each loop be 500ms. In the loop, you'd have a counter and when you hit 20, you know the 10s have passed.

Please Log in or Create an account to join the conversation.

Time to create page: 0.052 seconds