WayneA
USA
Asked
— Edited
Good Morning,
I think I have noticed or at least I seem to think I have, but when I ask a servo to move to a predefined location, it does it at least 50 percent of the time. I have to disconnect and remove power on my V4 board to get my project to do what I want it to do.
Thoughts?
.... see my reply to your other post....
Also, is there an audible message that the battery is low? That will stop the servos and all I/O.
If you share your project on here (using the Attach File option to the right of the edit box), someone can take a look and see what's up. The only reason I can imagine this situation is if the battery is low and you will hear a warning message. Otherwise, perhaps there is a disconnection occurring in relation to your other post
My idea ; script is for my robot's head to look down and look forward, and look left and look right. Now keep in mind that i am learning and trying to figure all this scripting out: please be gentle.
:start
When I run this the first time the script does what I want it to do. I want the head to look forward a certain way and look left and then look right a certain way. I have to stop the loop and power down the ARC software and my robot. Bring it all back up and re run this script and it works. I guess I am asking things to do what it cannot do.
Not sure.
So, which comes first the chicken or the egg?
I could be wrong but In my experience you need to place the ServoSpeed() command after the Servo() command. For each Servo() command you need to place the ServoSpeed() command after it or your move will be at the same speed as the prier move.
Also, I'm not sure you can have two ServoSpeed() commands in a row and have the speed change. You may be able to do this id you place a sleep command between them but I've never tried it. Give that a shot.
@Dave
I tried that Dave! I put the servo speed command right after the servo command. My servo operated wide open. There was no "control" of the speed. I guess I could do a $D7speed variable and make that "global" thru out my script.
I will place a sleep command right after the first servo speed command and give that a shot. Thanks for the tip Dave!
Humm, I'm really no expert but in the past if I put the commands like you listed them I wouldn't get the speed control I needed. Also I found a Sleep command between the two would stall the servo.
Here's a script I'm using that works well for me:
Something else to consider. When getting ready to make the movements you want the head to do shouldn't there be a series of setup movements to place the head at the correct orientation prior to your example commands. Kinda like "Home position" or "Known starting position" ?
@Dave Your script makes sense. I guess the default speed for the servo command is assumed 10?
@Robot-Doc: I really did not think of that. I will give that a try and thank you!
SERVO(D6,182)?
Is there a position 182?