Shop OBEX P1 Docs P2 Docs Learn Events
pls help...how to controll servo motor using PIC 16f877 — Parallax Forums

pls help...how to controll servo motor using PIC 16f877

johnyjohny Posts: 1
edited 2010-11-28 14:51 in Robotics
i am newbie in programming... anyone can give any idea on how to control(program) servo motor using pic16f877.... the servo is dependent on the sensor(speed) output, if the speed is going faster the servo should rotate step by step with a certain position 1->8steps. then if the speed is going slower the servo should rotate reverse 8->1... plsss response asap... thnx

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-11-28 14:51
    Download and read the "Robotics with the BoeBot" tutorial (here). This has a section that explains how a servo motor works and the control pulses that you have to supply to it. There's sample code for the Basic Stamps which should be straightforward to understand. We can't help you with the specifics of programming a PIC. You'll have to look elsewhere for that (like the Microchip forums), but the tutorial should get you started. You might also look at the Wikipedia article on servo motors.

    Servos require a pulse (0->1->0) that repeats about 50 times a second and has a pulse width typically of 1ms to 2ms (sometimes wider ... up to about 0.5ms to 2.5ms). The pulse width controls the servo position with 1ms as one end of the mechanical range and 2ms the other end.

    Keep in mind that the tutorial is mostly talking about "continuous motion servos" that have been modified for use for propulsion and the pulse width specifies the servo speed and direction with widths less than 1.5ms specifying rotation in one direction and greater than 1.5ms specifying rotation in the other direction. 1.5ms is the stop setting and the difference between the stop setting and the pulse width supplied specifies the speed.
Sign In or Register to comment.