Speed control of standard servo with BlocklyProp?
DrPop
Posts: 227
I'm trying to familiarize myself with Blockly enough that I can help a group of students with it, so I used it last night to make a quick program for the ActivityBot roaming with a PING))) on a front servo bracket.
I can't seem to find a block that will allow me to control the speed that the standard servo sweeps the PING sensor back and forth. I can of course put a pause at the end of each arc, but that does nothing to slow the actual sweep movement in between 0 and 180 degrees. I'd like to slow it down a little so it gets a more accurate signal return.
Is there any way to implement speed control of a servo in Blockly? Or would I have to slow it down by decreasing the voltage to the servo?
Thanks!
I can't seem to find a block that will allow me to control the speed that the standard servo sweeps the PING sensor back and forth. I can of course put a pause at the end of each arc, but that does nothing to slow the actual sweep movement in between 0 and 180 degrees. I'd like to slow it down a little so it gets a more accurate signal return.
Is there any way to implement speed control of a servo in Blockly? Or would I have to slow it down by decreasing the voltage to the servo?
Thanks!
Comments
Don't reduce the voltage to your servo. Speed control has to do with pulses sent to it.
Ken Gracey
You have to allow the servo to reach the commanded angle before sending a command to go to a new angle. That will depend on the ramp function and the distance to be traveled to each angle. You might be able to determine this with math or even have the program figure it out, but trial and error can work as long as you realize the slower you make the motion, the longer the pause is required before the next angle command.
When using ping)) to measure distances to objects in a sweep (in a SimpleIDE program), I eventually chose to rotate the servo a couple of degrees, pause enough to let it get there, take a ping reading, (maybe I added another pause to make sure i accounted for the ping time delay -- not sure now) then rotate a couple more degrees, etc. One advantage was I was able to clearly correlate the angle with the distance measurement. If you try to collect ping data while the servo is rotating there will be some error.
Tom
The standard servo speed as it is in the PING))) bracket kit seems a little fast to get an accurate reading as the bot is cruising around.
Tom
I'm not sure if it's possible, but you might mention somewhere in the Servo help part of BlocklyProp that the CR Servo set ramp block works with a standard servo as well. (Unless that was already obvious to everyone but me.) If I had read that or known before hand, I might not have needed to waste everyone's time with this thread.
If anyone wants to share with their students, the simple navigating with slowed servo mounted Ping))) code is public here:
http://blockly.parallax.com/blockly/projectlink?id=3606&key=833dd3bc-1381-4bcf-9385-1b05f9d042de