Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   How to program servos (http://www.chiefdelphi.com/forums/showthread.php?t=25914)

bstempi 23-02-2004 19:30

How to program servos
 
That line was it......please help.
~Bstemp

ahecht 23-02-2004 19:48

Re: How to program servos
 
Treat them just like you would a motor, except that instead of outputting a speed from -127 to +127, you are outputting a position from -127 to +127. For fun, you can hook the servo to the PWM outputs for one of your motors, and play with the joystick to get a feel for how they work.

bstempi 23-02-2004 20:51

Re: How to program servos
 
didn't work....any possible problems/solutions?

Alan Anderson 23-02-2004 22:31

Re: How to program servos
 
Quote:

Originally Posted by bstempi
didn't work....any possible problems/solutions?

Have you connected a good 7.2v backup battery? That's where the servos get their power.

wun 23-02-2004 23:45

Re: How to program servos
 
Quote:

Originally Posted by ahecht
Treat them just like you would a motor, except that instead of outputting a speed from -127 to +127

-127 to +127?
I thought the readings had to be from 0 to 255...
Are you just adding 127 to the outputs at the end of your main loop?
Can you actually use +127 .. -127 and I just havent heard about it?
Quote:

Originally Posted by bstempi
didn't work....any possible problems/solutions?

What didnt work? Did the motors just not move?
If you hook a victor up to the outputs, does the little orange light go solid?
If it dosent, it means that theres a problem with the code (probibly), and if it IS solid orange, and changes from green to red when you change the signal being sent to it (moving the joystick), then your servo is probibly broken.
Also, I read somewhere that last years servos dont work. That might be it.

Gene F 24-02-2004 08:27

Re: How to program servos
 
Quote:

Originally Posted by wun
-127 to +127?
I thought the readings had to be from 0 to 255...
Are you just adding 127 to the outputs at the end of your main loop?
Can you actually use +127 .. -127 and I just havent heard about it?

You do need to send 0 to 254! You get about 120 degrees of motion from the servo with that range and yes the 7.2 battery is required.

Kevin Karan 24-02-2004 11:48

Re: How to program servos
 
it realy doesnt matter, as long as its a char variable, it doent matter weather is singed or unsigned. And make sure whatever pwms your using are enabled, not used anywhere else and arnt set as digital i/os

bstempi 24-02-2004 13:45

Re: How to program servos
 
Quote:

Originally Posted by Gene F
You do need to send 0 to 254! You get about 120 degrees of motion from the servo with that range and yes the 7.2 battery is required.

Gene F is the man and God of all hardware. I thought that battery was for back up purposes only. I haven't tried it yet, but I'll plug in that battery. I know my code is correct, so it should work. Thank you guys for your help.

~zBStem


All times are GMT -5. The time now is 14:13.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi