Continue to Site

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.

  • 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.

creating PWM using PIC

Status
Not open for further replies.
hi
i want to controlling my servo or to test it
i want it moving clockwise 360 degress then back anti clockwise 360 degress
im using 16 mhz resonator
how to do it ?
 
[qoute]just to roll it 180 dgrs then come back to 180 dgrs again and loop it forever[/qoute]
as i say , please i really need it :)
 
Last edited:
A standard servo uses a potentiometer for it's positioning, so has a theoretical absolute maximum travel of 270 degrees. But in practice it's a LOT less than that - they are designed for a specific job, and don't require massive movement.
 
Don't all servos move nearly 270° in each direction which is more than 180°? Is the OP saying he wants it to go from -90° to +90° then to -90° and repeat?

Edit, I don't have time now but tomorrow I'll post BoostC code to control a pot on a 16 series chip. Do you have a 16F88?

Mike.
 
Last edited:
Don't all servos move nearly 270° in each direction which is more than 180°? Is the OP saying he wants it to go from -90° to +90° then to -90° and repeat?

Edit, I don't have time now but tomorrow I'll post BoostC code to control a pot on a 16 series chip. Do you have a 16F88?

Mike.
no i dont , but i have 16F886
 
From you older posts, I understand, you have a continuous rotation servo. And that you need to rotate the shaft 180 degrees to the right and to the left, in a loop.
try this -
1) Write a subroutine to turn the motor to the left - say, goLeft();
2) Write another to turn to right - say goRight();
Find the time for the shaft to reach your 180 degrees. Write a subroutine for the time delay

call goLEft and goRight with the delay subroutine in between, and put the entire thing in a loop.

This is, assuming you know how to turn your motor to the left and to the right. If you have variations in the load at shaft, the time will change. If the positioning is critical, put a sensor at the 180 degree point. Then wait for the shaft to reach that point before you call either of the goLeft or goRight subroutines.
 
Don't all servos move nearly 270° in each direction which is more than 180°?

No, servos only have a fairly limited movement - which the specs don't seem to mention?.

It certainly couldn't be 270 degrees in each direction, that would require 540 degrees total movement, and the pot can only move a possible maximum of 270 degrees.
 
Status
Not open for further replies.

Latest threads

Back
Top