Whoops! The title was supposed to be ServoSpeed Questions and Issues Unfortunately you can't change the title so we are stuck with "Questions and Questions", Sorry
Lately, I and Mickey666Maus have been working with recording the movements from a virtual robot in 3ds with the purpose of playing them back in EZ-Builder. This we can do. The problem comes in the timing. That is to say, the length of time it takes to perform a movement in the 3ds animation vs recreating that same timing in EZ-Builder. I can break up a given servo movement command into smaller increments and come up with an approximation of the time needed by fooling with the number of incremental movements and, if needed, add some sleep in between. But that tends to introduce jitter in the actual robot and it defeats the purpose of sending larger servo movement commands to the ARC to achieve smoother movement of the servo. For example:
#Assume we are starting at a servo position of 10 degrees.
Servo(D10,110) #Go to 110 degrees.
#The above command will move the servo smoothly.
#As opposed to:
Servo(D10,10) #Sending out many smaller servo movements.
The smaller increments solve the timing problem, but introduce jitter in the robot.
The obvious answer is to use the ServoSpeed instruction in EZ-Script. The current problem with that is the ServoSpeed has no fine increments between 0 and 1. You essentially go from full speed to less than 1/3 of full speed when going from ServoSpeed(D10,0) to ServoSpeed(D10,1). I did some time trials and found this relationship for the first 6 ServoSpeed numbers:
# To move 179 degrees
#Servo Speed =0 =550ms 1.00x (Base Speed) 3.07 ms/degree 0.326 Degrees/ms
#Servo Speed =1 =1940ms 0.28x (550) 0.28x (Base Speed) 10.84 ms/degree 0.092 Degrees/ms
#Servo Speed =2 =3880ms 0.50x (1940) 0.14x (Base Speed) 21.68 ms/degree 0.046 Degrees/ms
#Servo Speed =3 =5600ms 0.70x (3880) 0.10X (Base Speed) 31.29 ms/degree 0.032 Degrees/ms
#Servo Speed =4 =7400ms 0.76x (5600) 0.07x (Base Speed) 41.34 ms/degree 0.024 Degrees/ms
#Servo Speed =5 =9200ms 0.80x (7400) 0.06x (Base Speed) 51.40 ms/degree 0.019 Degrees/ms
#Servo Speed =6 =11100ms 0.83x (9200) 0.05x (Base Speed) 62.01 ms/degree 0.016 Degrees/ms
As you can see it goes from full speed to 0.28% of full speed at a ServoSpeed of 1. That's a huge difference. The difference is not so much between the rest of the number settings.
All this leads to my question:
Would it be feasible to break up the allowed values between 0 and 1 (at least) into finer increments? For example allowing decimal fractional values such as ServoSpeed(D10,1.2). ServoSpeed(D10,1.6) ... etc. ? This, so as to achieve more possible speed values between 0 and 1.
Using decimal fractions would maintain compatibility between the new and the old so no old scripts would be broken by such a modification
Also, a more general question:
Is the servo movement operation independent of what is going on in ARC at any given moment. That is to say, is it running on a separate C# thread such that the servo will move at a constant rate regardless of the load on EZ-Builder? Within reason, of course.
Upgrade to ARC Pro
Synthiam ARC Pro is a cool new tool that will help unleash your creativity with programming robots in just seconds!
Can't be done
No, it runs on the EZB firmware.
Next post more details.
When you have an analog servo attached to a micro-controller, the basic operation is to tell the servo to move to a specific position (microseconds).
The speed is implemented on the EZB firmware, something like this (pseudo-code):
each speed (1-10) has different values for speedMs and speedStep.
ARC transmits to the EZB the servo speed (byte): 0 to 10 associated to the digital port.
check my post #4:
Thank you very much for your reply. So the ServoSpeed thing is actually implemented in firmware on the EZB itself. Most unfortunate. For me that is. That leaves me with only couple of options. One, option being to implement it in a script. A method which will not be very accurate or repeatable. However, if the movements in the 3ds virtual robot can be constrained to a certain set of movement parameters, or made to fit those parameters as close to the desired movement as possible during post possessing, it may still work out. The trick will be coming up with those parameters.
The other option would be to write a C# program, either as a stand alone program or a Plug-in. At least that way I would have access to a real-time clock and interrupts. Choices, choices.
I am a mechanical guy just throwing a question in the mix. This may be dumb, but was just a thought.
If you use a stepper motor instead you can get about 1600 micro steps per 180 deg rotation.... Over 8 times the resolution of a hobby servo
It is my understanding that each script, while executing, is running it's own underlying C# thread. Is that correct?
We were also figuring that driving the servo movement with ARCs AutoPosition opposed to using EZ-Script might have some effect on getting better results.
Would it be possible to make an import function, just like the export function within the AutoPosition of ARC?
To generate the code that is needed for import should not be a problem on our side!
Just something that crossed my mind...
Thanks....I was not aware it is already build in! Sweeeeet!
*where config == EZ_B.Config.Sub.AutoPositioner
Thank you for your response. Good to confirm that since it answers a question I had on using a counter as a timer instead of the Sleep instruction.
Thank you as well for your posts. The information you provided opens some new and intriguing possibilities. Likewise thanks for your offer to assist on an exporter.
Of course! How stupid of me to not realize that. Forest for the trees kind of thing I guess.
If your servos and voltage is within spec, disregard this post - however, keep it in mind for future reference.