• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC PWM servo

Status
Not open for further replies.

gilardino

New Member
hi, i am using PIC16F877A, 2 servo motors (360degress) are used as the car movement. The servo motor is controlled using relays as the H-bridge. The car must follow the black line. So, the car must be able to turn right and turn left. I need PWM to control the speed of the servo motor. My question is, how i can control the PWM to the servo?
 

Nigel Goodwin

Super Moderator
Most Helpful Member
If you're using servos modified as motors, then they already include an H-bridge, you don't need the relays. Just provide the required width pulses for forward, stop, and reverse.
 

gilardino

New Member
my servos are 360 continuous rotation and it only has 2 pins. So it is like a normal dc motor needed to be connected to relays. PIC16F877A only got 2 pins for PWM ccp1 and ccp2. I use 2 servos and total of 4 relays (2 for each). I need to use PWM because i want the car to turn right and turn left. So right motor must be faster than the left motor to turn left. But how to achieve this?

Thanks.
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Why are they "servos" then, it's just a motor?.

You don't really need to vary the speed, to turn left just stop the left motor - but if you want PWM routines check my tutorials which show how to do just what you want with a 16F876/7 - 127 speeds forwards or backwards, and either one or two pins per channel for direction control.
 

Sceadwian

Banned
I'm not sure why you ripped out all the electronics gil. If you want 360 degree rotation out of a servo all you do is set the POT to the center position, glue it in place and remove the gears that attach the output shaft to the POT, then you remove the physical stops on the servo that keep it from rotating 360 degrees. Then you can use the standard servo signals to drive it only instead of getting absolute position as in a standard servo you get proportional speed. Exactly what Nigel was talking about .
 

osyim

New Member
hello. i need help with my final year project - self-balancing robot.

i googled all about servo but dont quite get to clear understanding.

if i use 2 servo motors, is that mean i need two channel? what this channel means anyway?
pwm is needed to have the servo works, do i need external circuit to have the servo works? or just programming code is enough?
 
Last edited:
Status
Not open for further replies.

EE World Online Articles

Loading
Top