Asked — Edited
Resolved Resolved by DJ Sures!

Servo Speed - Only Fast, Medium And Dead Slow Available

Hi gang,

I have no problem getting servos to change speed using the ServoSpeed command in scripts and if I don't set the speed they run at 100%. However, I've had an issue with servos not using the full speed range available. In the scripting manual for this command it tells us:

" The servo speed is a number between 0 (fastest) and 10 (slowest)". 

With some of my smaller servos like the Micro sizes Hitec HS-85MG or the Mini HS-225MG I only have a couple speed settings with the ServoSpeed command that works: 0 is full speed, 1 is 1/2 speed and 2 will let the servos move as slow as the minute hand of a clock. Anything above that is as good as stop. I have noticed with other bigger servos I'll get better speed changes as I go toward 10.

Is this normal with different brands or sizes of servos? Is there any way to stretch this out so I can get better speed choices between 0 and 10?


ARC Pro

Upgrade to ARC Pro

Your robot can be more than a simple automated machine with the power of ARC Pro!

#17  

Awesome detailed response @DJ.

My problem is I am trying to control LEDs (eyes) instead of servos. The LEDs are directly connected to servo ports, controlled using PWM scripting. Works great to turn on-off and control intensity, but I can't figure out how to slow down the on-off. Tried initializing servo (LED) [Servo(d9, 90)], followed by setting the speed [ServoSpeed(d9, 0-9)], then turning on and off [PWM(d9,0-100]. The result is always switching on-off fast.

What am I missing ?

#18  

kazabond

You don't use servo commands with LEDs, just PWM.

Here are two scripts to ramp up and down an LED on port D11. You can change how fast it ramps by adjusting the sleep and by adding or subtracting more than 1 from the current PWM variable


#ramp up an LED
$pwmset = getpwm(d11)
:loop
IF(getpwm(D11) < 100)
$pwmset = $pwmset + 1
pwm(d11,$pwmset)
else
goto(end)
EndIf
Sleep(150)
Goto(loop)
:end


#ramp down an LED
$pwmset = getpwm(d11)
:loop
IF(getpwm(D11) > 0)
$pwmset = $pwmset - 1
pwm(d11,$pwmset)
else
goto(end)
EndIf
Sleep(150)
Goto(loop)
:end

Alan

#19  

Alan, I thought you had a HoneyDo list to take care of? What are you doing hanging out here on the forum all morning? Better not let the wife catch you helping all these other people and ignoring her needs. :D

#20  

Worse than that, I am supposed to be at work. I have a huge document to finish, but I can't get my head in it so I keep browsing the forum and seeing questions I can answer.....

Alan

#21  

Alan, it's guys like you that make this hobby fun for the rest of us. ! :)

You should just quit your day job and hang out here on the forum and help the masses. You don't really need to eat and have a roof over your head, do you?;)

#22  

heh.... I wish I could do nothing but robotics all day. I enjoy my job, but also looking forward to retirement (in 17 years, after the house is paid off....) so I can spend my days playing.

Alan

#23  

I ran my own business and made some decent money... My friends used to comment... "hey, why don't you buy a nice car now that you have the money?" or you should buy a bigger house" ... you have the money so live it up, trips etc...... I usually respond not a chance... You see I am really lazy... They just looked at me puzzled... Fast forward to age 45... My house is paid off, no debt with decent investments... I am pretty much retired so I do get to play with robots most of the day:)... All my other friends are still doing the 9 to 5 and still paying for their houses and cars and things...

The moral of the story is yes, I am lazy... I hated working so I saved my money, bought stock/investments and stayed out of debt. All so I could stop work as soon as possible... I traded "things" for free time.... So long to the rat race...