school project help
jessp118
Posts: 3
I'm in need of some help. I am using a stepper motor to open and close a gate depending on how far an object is from the ping sensor. My problem is that the motor will "pulsate" insted of staying at one location. Is there a way to have the server wait until the ping distance change and put it back through the if/elseif?
Comments
There are a variety of reasons for the servo to "twitch". One problem with your program is that you're producing the control pulses too fast. They need to happen once every 20ms or so. Add a PAUSE 20 after each PULSOUT for the servo and see what happens.
If the servo is refreshed every 20ms, this gives you 50Hz refresh rate.
It's amazing what can be done at 50Hz. The 50Hz calculation rate is mentioned at 1:22 in the video.
Does your system need a reaction time faster than the robots in the video?
I'm don't really understand what you mean for the program. I am leaning toward getting the 4-phase unipolar stepper motor. Would that work better than the servo I'm currently using?
I have updated the program with a single PAUSE 20 after the ENDIF.