PDA

View Full Version : centering servomotor using 16F84A



saturnX
- 1st October 2005, 15:07
i was wondering if some one could help me check if this piece of code works. I got this picbasic pro code from a book to center servo motors and prototyped the schematic onto a breadboard. when i applied power nothing happened but i did notice that if i were to pull off the wire connected to the +ve of the servo motor and plug back it moves a little. If possible can some one take a pic of the completed circuit of what it looks like on the breadboard so i can check it against mine? Can't take a picture of mine as my digicam is in the shop for repairs. Please help!

Servo Motor - HiTec HS-322HD



start:
PulsOut portb.0, 150 'Send pulse out on rb0
Pause 18 'Delay needed to send pulse at 55hz
GoTo start 'repeat


<font color=red>Here is the schematics</font>
<img src="http://i3.photobucket.com/albums/y77/drewandangel/fig02.gif">

Acetronics2
- 1st October 2005, 15:51
Hi, SaturniX

try this first ...


start:
Low PortB.0
PulsOut portb.0, 150 'Send pulse out on rb0
Pause 18 'Delay needed to send pulse at 55hz
GoTo start 'repeat

END

- Be sure your 5v supply can handle more than 500 mA for the servo ...
- connect servo to Portb.0 via a 220 ohms resistor to protect the PIC.
- Check all connexions and be sure servo ground and Pic ground connected.

then apply Power ...

Alain

saturnX
- 2nd October 2005, 05:20
hi Acetronics,

thanks for the reply, i will try your suggestion later on as i was playing around with the schematics last night and managed to get it to work. I incorporated a voltage regulator to regulate the power supply to the pic and the motor and guess what it worked. But i never thought of your way Acetronics and will try it later. Thanks again...

saturnX
- 7th October 2005, 18:12
alain, hoping you do read this thread still. i was just reading through wat you posted and i was just wondering, is it necessary to have a resistor between the IC and the servo? I am not that good in electronics yet and slowly learning so your help is much appreciated. :)

Acetronics2
- 7th October 2005, 19:11
Hi, Saturnix

Resistor is not compulsory ... but protects the pic from little things : bad cord connexion and servo input capacitor's discharge in the pic's pin ...

consider a servo input is often a 1 to 4.7µF cap in series with the amplifier ... so plugging the servo when power is on gives strange things ( reason of the LOW command before PULSOUT ...)

Alain