PAUSE: Question about delay times for servos
RoboticsProfessor
Posts: 54
My line follower uses something like...
Do
...ReadSensors()
...At intersection?
......Yes (Left-hand rule)
........."T" = turn left
.........straight-right = go straight
.........straight-left = go left
......No - Interpret sensors, set motor speeds
Loop
Thinking that I might speed up the robot a bit, I removed the PAUSEs after each motor command.
I figured that the other code for interpreting the sensors and setting motor speeds were effectively a delay anyway, so the loop itself had a built in pause.
It worked with no apparent change in the robot speed. So I was probably sending the pulses a little more often than the 20 ms, or maybe a little less often, but in either case there was no change in performance, so I left the PAUSEs out.
So the question.....
How can I find out exactly how often the servo pulse is generated?
In this case, it might not matter, but I would like to know how to do this.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Richard Vannoy
Programming and Electronics Instructor
www.PICRobots.com
www.SailingStrategy.info
www.TeachingTechnicalTraders.com
·
Do
...ReadSensors()
...At intersection?
......Yes (Left-hand rule)
........."T" = turn left
.........straight-right = go straight
.........straight-left = go left
......No - Interpret sensors, set motor speeds
Loop
Thinking that I might speed up the robot a bit, I removed the PAUSEs after each motor command.
I figured that the other code for interpreting the sensors and setting motor speeds were effectively a delay anyway, so the loop itself had a built in pause.
It worked with no apparent change in the robot speed. So I was probably sending the pulses a little more often than the 20 ms, or maybe a little less often, but in either case there was no change in performance, so I left the PAUSEs out.
So the question.....
How can I find out exactly how often the servo pulse is generated?
In this case, it might not matter, but I would like to know how to do this.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Richard Vannoy
Programming and Electronics Instructor
www.PICRobots.com
www.SailingStrategy.info
www.TeachingTechnicalTraders.com
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
I've used the pause time to scan sensors and check inputs. That way you don't include a pause, then waste a few milleseconds checking for inputs, then pulse, pulse,·then pause, etc. Saves a little bit of time if you are building a competitive robot or something that has to react quickly.
Daryl
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering