Asked — Edited

Servo Position

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?


ARC Pro

Upgrade to ARC Pro

Experience the transformation – subscribe to Synthiam ARC Pro and watch your robot evolve into a marvel of innovation and intelligence.

#1  

.... see my reply to your other post....

  1. Are you using a servo Movement Panel or camera panel in conjunction with a script?
  2. In a script have you been using ServoSpeed command at all?
PRO
Synthiam
#2  

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

#3  

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

  1. sayezb("PLEASE STEP BACK AS I CHECK OUT MY HEAD MOVEMENT.")
  2. SLEEP(4000)
  3. SAYEZB("LOOKING DOWN")
  4. SERVOSPEED(D6,2)
  5. SERVOSPEED(D7,2)
  6. SERVO(D6,182)
  7. sleep(2000)
  8. SAYEZB("LOOKING FORWARD")
  9. servo(D6,80)
  10. sleep(5000)
  11. SAYEZB("LOOKING LEFT")
  12. SERVO(D7,38)
  13. SLEEP(5000)
  14. SAYEZB("LOOKING RIGHT") SERVO(D7,163) sleep(10000) goto 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?

#4  

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.

#5  

@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!

#6  

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.

#7  

Here's a script I'm using that works well for me:


:Start

Servo(D1, 26)
ServoSpeed(D1,2)
Sleep(1000)
Set(D10,on)

Sleep(2000)

Servo(D1, 44)
ServoSpeed(D1,6)
Sleep(2000)

Servo(D1, 43)
ServoSpeed(D1,0)
Sleep(0112)
Set(D10,on)

Servo(D15, 100)
Sleep(0225)

ServoSpeed(D1,6)
Sleep(0225)
Servo(D1, 48)
Sleep(2000)

Servo(D1, 42)
ServoSpeed(D1,2)
Sleep(0225)

Servo(D15, 48)
Sleep(0500)

Servo(D1, 43)
ServoSpeed(D1,8)
Sleep(0500)
Release(D1)
Sleep(0500)

Goto(Start)

#8  

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" ?

#9  

@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!

United Kingdom
#10  

SERVO(D6,182)?

Is there a position 182?