Asked — Edited

Servo Accuracy (70 Positions), More?

With Firmware V13 came "70 servo Positions (double resolution!)", from DJ's announcement, and this is mentioned on the "Step 7 Standard Servo" tutorial.

I would like to ask if the EZ-B can do better than 70 positions? If I use my 12 bit servo, can I get better accuracy in position control? Or with my 10 bit servo?

70 seems like an arbitrary number, (n^2) should yield numbers like 64 or 128 positions which would seem like a number that would come from a hardware limit; how did the 70 position number come about?

I am making a pan/tilt laser-beam pointer, and want to shoot those flies out of the sky (not really, but if I wanted to, I would need precise movement). Any suggestions for getting more precise position control?

Thanks for comments.


ARC Pro

Upgrade to ARC Pro

Subscribe to ARC Pro, and your robot will become a canvas for your imagination, limited only by your creativity.

PRO
Synthiam
#1  

@riledo 70 positions is because the EZ-B is doing many things at once. That is the fastest the servo pid can run and continue offering 8 ADC, 20 digital i/o, 20 servos, 20 Serial, 20 PWM. :)

#2  

Thanks for the quick reply and seeing all the things that must occur - at the same time - thanks for the 70.

Can you help me understand the 70 better?

Is that 70 positions over the full range (say 180 degrees) of the servo?

Or if I specify I want the servo to be in "high resolution" mode (by using the programmer for the digital servo to make the full range say 120 degrees), would I get 70 positions in the 120 degree range?

Or as an example, can the EZ-B tell the servo to only travel within a 70 degree range and then could I get 1-degree position control over that reduced range?

Thanks.

PRO
Synthiam
#3  

Here's the technicals.

A servo operates on pulse width that is repeated every 20ms. The pulse width varies between 1 and 2 ms. The EZ-B runs at 40mhz. There are multiple PIDs doing a variety of tasks. One smart task keeps track of each pin's configuration (digital in, digital out, servo, serial, pwm, etc). Then there is a pid for each task for each pin. Because timing is super duper important, each pid has NOOP's to simulate the timing of empty tasks. That is why with the EZ-B, you can turn on and off servos and digital ports without the PWM signal swaying or moving around like the Arduino.

The EZ-B holds 100% steady.

Now, servos are "supposed" to follow the rule of 1-2 ms from stretch to stretch.. However, they don't. So! To provide support for every servo i've ever tested, the EZ-B PWM range is further than 1-2ms.

When you ask about a Digital Servo, that has no difference in range in relation to an analog servo. The only difference between a Digital servo and an Analog servo is the electronics inside. A digital servo has a little program that runs and watches the pulses and "predicts" and "smooths" the positioning of the servo motor. Because a servo signal repeats every 20 ms, the digital servo electronics smooth out the signal and hold the servo motor into position.

Where an analog servo only updates its position on every pulse.

So... Digital servo: continuous servo motor updating Analog servo: updates on every pulse (every 20ms)

That is why Analog servos BUZZZZZZZZZZZZZ lots

For more information about a servo, and the exact PWM's that the EZ-B transmits, read this: https://synthiam.com/Tutorials/Hardware.aspx?id=4 (tutorial section is your friend)

There is absolutely no way to increase the servo resolution of the EZ-B. That is as high as it will ever be at 40mhz. One cycle of the servo pid runs every 25.6 us.

I don't see 70 servo positions as being a fault. I'm proud to have 70 accurate servo positions while there are dozens of other tasks being executed :)

#4  

Thanks for your further explanation, but I am still puzzled about the 70 steps over what range?

For example, the range I discussed above is based on programming the servo, for example hitechrcd's digital servo programmer states: (program manual)

"Traditionally the servos used for RC radio systems have approximately 120 degrees of travel angle. The Hitec HS-7XXX servos are adjusted 120 degrees as default setting for maximum performance. However for some applications, a wider travel angle is desirable. If you want to use up to 180 degrees of travel for RC Applications, adjust the maximum travel angle within 180 degrees using the EPAneuFS function."

Then it states:

"Please note : Increasing the travel angle will decrease the servos resolution. There is a finite number of "steps of resolution" and widening the angle of travel will increase the distance of each step. So you can choose one between high and low resolution for your application. That is, maximum travel angle is 120 degrees in High Resolution mode, and 180 degrees in Low Resolution mode."

Thus my question above was related to will the EZ-B give me 70 positions in the 120 range (if the servo is set in that mode) or would it give me 70 positions in the 180 degree range (if in that made)?

Also, somewhat related, the SDK has functions:

Field:EZ_B.Servo.SERVO_MAX

  • The maximum value for a servo

Field:EZ_B.Servo.SERVO_MIN

  • The minimum value of a servo

If the MIN was set to 0, and the MAX to 70, would I be able to get 70 positions within that 70 degrees rotation range, or be able to control the servo in 1-degree increments, based off of 70 positions controllable in the 70 degrees between MAX and MIN?

Again, thanks for your reply.

PRO
Synthiam
#5  

Ah I see. So the servo you would like to use has an adjustable range. Then I would "assume", based on the documentation, that the 70 positions from the EZ-B will control a smaller range, at higher resolution, if the servo is configured that way.

I would "assume" so. But I am not the manufacturer of that servo, so I can't 100% guarantee. In this case, all you can do is trust their documentation :)

What I can guarantee is that the EZ-B follows the servo timing resolution rules to the more accurate specification available. It also extends the specification by a few microseconds to accommodate all servos. This means if their documentation is correct, then the EZ-B will behave within their specifications - And all will be good

#6  

Can you comment on the last part of my question in post #5?

When using your SDK with MIN and MAX servo value settings (on any general servo), would the 70 positions be spread out over the range between min and max?

Thanks.

PRO
Synthiam
#7  

My question answers the last part too:) You will have to reference the documentation of your servo. The ez-b transmits static pwm within the specifications of servo protocols. How your servo uses that information is relative. :)

The servo pulse widths and explanations of how a servo works can be found on the tutorial page, under hardware. You may consult the pwm charts and compare against your servo documentation. With some maths, you can determine the angle.

If you are using the sdk, simply multiple or divide the servo position to obtain the calibrated position of your servo. As a programmer, you will create a custom method to do the work, then call our setservoposition method within it.