USA
Asked — Edited

Servo Synchronization: Servospeed Delay Values

I need to synchronize the servo movements between a EZ-Script and an external device.

ServoSpeed (Dx, speed)

The speed is 0 = (fastest) and 10 (slowest)

Q1: it's possible to know the delays in milliseconds for each speed ?

Servo( Dx, Position)

Q2: When the servo sweeps between current position and a new position is the incremental value 1/-1 or varies per speed ?

Thanks


ARC Pro

Upgrade to ARC Pro

Unlock the true power of automation and robotics by becoming a proud subscriber of Synthiam ARC Pro.

PRO
Synthiam
#1  
  1. The millisecond is arbitrary, as with all physical motors without feedback because there is no idea to know the position.

  2. The servo sweep size is unknown because the servo will decode the pwm. The software does not control the ramping, that's done through pwm - and the pwm simulates an analog signal which has no "positioning" reference.

You can find out more how a servo works with videos explaining what PWM is here: https://synthiam.com/Tutorials/Lesson/48?courseId=6

Because all servos respond to an analog pulse with (even digital servos), to have degree positioning requires software calibration. The EZ-Robot servos are calibrated to the pulse width that the ARC softare provides. The ramping and sweeping of pwm is not performed in the ARC software, so there is no reference for positioning.

If you wish to control positioning by degrees and speed, use the Auto Position Control - which is designed for exactly that.

PRO
Synthiam
#2  

Also - since servos will move to a position at different speeds based on unknown variables such as voltage, amperage, gearing, current loss in connectors, multiple motors running at once sharing current, weight of object being lifted, etc... and if you wish to use ServoSpeed() instead of an auto positioner, or set the speeds manually... build the robot first and calculate the speeds once built.

The trouble as a programmer is assuming hardware works the same way:) Moving a motor by software is a flick of a bit... in hardware, there's a bunch of variables which encompasses an entire field of study called Physics.

PRO
USA
#3  

Auto Position Control: good tip, It seems very easy to do more with less (script), to be honest i never explored the control, probably i'll use it to simply the process.

Right know i'm tackling the crazy stuff:

  1. Query if the servo is moving, and if is sweeping to estimate where he is, to trigger other external motions.

  2. After every ARC connect i want to know the servos position & speed (if not the first time/ezb power on) to avoid losing their position, and restarting the servo sequences.

  3. Frequent wifi disconnections, but that is another issue ;)

coming to the servos, regarding the delays i'm ignoring the power, load/weight conditions and other physics (like you said is too much), in equal conditions i measured 3 types of analog servos, using the same EZB4 and the values seem to me constants.

I believe these values must be hard coded at least per EZB firmware (3/4):

The numbers if useful for any other project:


Speed : Delay
===========
10 = 100 ms 
9   = alternating between 80, 100 ms
8   = 80 ms 
7   = alternating between 60, 80 ms
6   = 60 ms
5   = alternating between 40, 60 ms
4   = 40 ms
3   = alternating between 20, 40 ms
2   = 20 ms
1   = 20 ms, but the angle step is 2 or -2

The logic/implementation seems well done, delays on multiples of 20 ms, alternating when needed and in last option changing the step.

I have a solution for points 1 & 2, i'm still working to make it more bullet proof.

PRO
Synthiam
#4  

1 and 2 can never be possible because there is no way to "read" a servo position. Servos are positioned by a repeated pwm signal, as per the how servos work tutorial.

What you could do is modify the servo. Open the servo up and connect a fourth wire to each servo. Connect it to the center pin of the potentiometer. And connect the other end of the wire to an ADC port on the ezb. This will let you query the position.

Also, you could switch the pcb out with open servo: http://www.openservo.com

Although, it works as i2c... Which is a pain to wire for. Not sure why they choose that shrug

#5  

This should help you out with #2... It's very easy to open the servo, solder a wire to the centre pot contact and run it back to the ezb's analog port...

PRO
USA
#6  

Thanks guys, for the tips, last time i open a servo i end up buying two... ;-)

i'm very clumsy with tight spaces. I didn't give up, i'll try a cheap one, to practice.

@DJ: I agree, no doubts, there are at least 2 options:

  1. connect the servo signal to micro controller and the micro can read the modulations, i did that last night to measure the speed delays and to identify angle increments when EZB is sweeping. Although can work probably with a few more servos/ports, can't escalate to monitor all the EZB ports with a single micro. It works if the ports are attached, but can't be used to read a detached/cold servo.

  2. the other option like Richard mention, is read pot feedback, i never tried successfully hack an existent servo, but is doable if you have enough analog ports.

my solution for point 1 & 2 does not use any of the above options, point 2 is done, i'm still working on point 1 (synchronization) i'll keep you guys posted hopefully in the next few hours.

PRO
USA
#7  

I just published (public access) my test project, to show the scripts:

  1. recovering the servo positions after a explicit/implicit disconnect (initialization)
  2. tracking the real position of a servo while the servo is moving (sweeping)

First the output window of the initialization script (recovering servo positions after a previous disconnect)

#10  

Just curious... What are you using to power your ezb and servos? Most disconnects are caused by power supply problems...

PRO
USA
#11  

i'm using a power adaptor 7V, 5A. I only have two servos for testing, but the disconnects are frequent event when idle for a few minutes.

I'm not sure ... i think someone near by me must have some crazy wifi routers i

i'll need to find a solution (i have some ideas is the next step)

#12  

How many servos? 5amps is barely good enough for an ezb, camera and maybe 1 servo... I suggest a Lipo or Nimh battery or an power supply rated for at least 20amps...

If you pull too many amps from a under rated power supply (moving too many servos at once) the ezb will "brown out".. This is a condition where the voltage drops below 4.5V temporarily staving the ezb of power... It will disconnect and reboot when this happens... This is what may be causing your disconnects...

edit I see you have two servos... You have a poer problem my friend... More specifically lack of... You need a better power supply of switch to using Lipo batteries

PRO
USA
#13  

I'm not good with pictures... and yes is a Iphone picture (just like Mr cook)

The hardware solution, it can track all the ports (0..23) User-inserted image

PRO
USA
#14  

For this experience only one servo, you can see the servo in the picture is a EZ-Servo do you think 5A is short ?

The kids use a EZ/Kit lipo battery.

#15  

Power supplies manufacturers never lie, right? I am still going with you don't have enough power dude... Use a 7.4 lipo battery or a larger power supply (20 amp I suggested) ... if the disconnects stop then you have your answer...

PRO
USA
#16  

i have a 12V 10A, but t i need to get one 7v something because of the servos i don't want more cables.

But i had the idea 5A was enough how much EZB drains ?