Shop OBEX P1 Docs P2 Docs Learn Events
How to DIY a CR servo? — Parallax Forums

How to DIY a CR servo?

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2012-12-24 20:39 in General Discussion
So I was playing with my BS2 and somehow the electronics in my servo. I checked in to the the data sheets for a BAL6686 and BAL6688 which are what is used in the parallax servos, they arent very usefull.

I put the servo back together and, cut the stops and greased it up really good. It makes a nice gear motor! It looks like it would be easy to stick a mechanical encoder where the pot use to be, and fit a few 2n2222 in there to make an h-bridge. I was wondering if anyone could explain the electronics involved in servo pulsing, I mean just running a regular PWM line to it seems like the easy thing to do but Id like it to work like a servo again, exactly how does the servo controller know what pulses turn a motor forward or back, how does 750 stop the servo etc.

Comments

  • ercoerco Posts: 20,259
    edited 2012-12-23 21:16
    That's an easy mod.

    Google's your friend.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-12-23 21:44
    It looks like it would be easy to stick a mechanical encoder where the pot use to be,

    So where's the pot now? There are a zillion instructions online on how to convert a servo to CR, many retain the original pot, some methods use a pair of resistors (not the good ones though) and some use a different pot than the original to allow finer control of the center position.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-12-23 22:07
    I think you guys are misunderstanding me, I dont want to mod a servo, i fried the board!! I accidently hooked 12 volts up revers to my BS2 homework board with the servo attached to Vin and fried the parallax controller board specifically the bal6686 chip.

    I put the thing back togather and threw a rotary encoder in it to make a nice little gear motor, what I want to know is the easiest way to make a controller that will convert RC pulses to into RC style motor control, I figured id uses a transistor based h bridge, but I have know Idea how to make a 1.5ms pulse equate to stop, or a 2ms second pulse go forward .5md go back like a servo. This could all be done using a micro but if a servo can do it using a few analog parts id think it wouldnt be that hard. Basically I want to make my own servo controller with a mechanical quadrature encoder. Id like to have a singal signal wire to pulse it like the original servo, I dont mind having the other two wires for the encoder
  • Martin_HMartin_H Posts: 4,051
    edited 2012-12-24 03:17
    The most cost effective thing to do is to buy a new servo. But there are third party servo control electronics like Open Servo https://www.sparkfun.com/products/9014 which uses I2C instead of servo pulses. A Pololu baby orangutan board might be small enough to fit inside the case as well. It includes a surface mount AVR 328p and H bridge, which could be turned into a control board with some work.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-12-24 11:49
    This idea was more about learning than being cost effective. I, have seen open servo and m fairly impressed with it but its a bit pricey. I suppose if I wanted an open servo type design I could fit 4 to92 transistors and an 8 pin dip mcu in the case along with rotary encoder pretty easy. which may acually be a cool idea to make smart cheap gear motors.

    What im really trying to figure out is how RC pulses are converted in to usable motion and position. Unfourtantely tearing the guts out of one wasn't as helpful as I thought it could be!! The two chips used in the servo have very limited data sheets, It shows there pin outs and gives about a sentence description of there function.. I also have an RC speed control I was hoping would help me solve the problem but the chip numbers are worn off, and it doesnt seem to pulse just like a servo 1.5ms stops it but I have to pulse between 2 and 4mS to set the speed and if I start at full speed I cant drop down any lower its very strange!
  • Mike GMike G Posts: 2,702
    edited 2012-12-24 12:08
    How do servos work? or Servo feedback schematic

    http://www.princeton.edu/~mae412/TEXT/NTRAK2002/292-302.pdf
    What im really trying to figure out is how RC pulses are converted in to usable motion and position.
    CR servos cannot be positioned with a PWM signal hence the name; Continuous Rotation.

    D
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-12-24 14:00
    No No I know that, Im crystal clear on that fact, but using an a rotary encoder on it could very easily add positioning, of course this part would obviously take a micro os some logic chips. I guess what I meant to say is how RC pulsing is converted in to usable signals, its so different from regular PWM. Is the PULSOUT signal just being amplified and driving the motor directly? It cant be that simple.

    EDIT:

    @MIKE that PDF is extremely helpful and ive never been able to find something like that... This basically explains what I want to know, although it may be a little over my head

    Ive tried the how does a servo work search many times with only vague information about how to control the servo not the kind of info posted in the quote below.
    Servos have their own proprietarycircuitry built inside the servo case.
    This circuitry consists of a pulse
    width comparator, which compares
    the incoming signal from the receiver
    with a one-shot timer whose period
    depends on the resistance of a
    potentiometer connected to the
    servo's drive shaft. This feedback is
    what provides the stability for the
    control circuitry. The difference
    between the control signal and the
    feedback signal is the error signal.
    This error signal is used to control a
    flip-flop that toggles the direction the
    current flows through the motor. The
    outputs of the flip-flop drive an HBridge circuit that handles the high
    current going through the motor.
  • PropabilityPropability Posts: 142
    edited 2012-12-24 14:55
    Have a look at his.

    http://www.seattlerobotics.org/encoder/200304/Futaba%20S148%20Servo%20mod%20for%20PWM.htm

    Note that the circuit at the bottom of page is not correct.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-12-24 15:31
    Well that's a shame because I need to figure out a way of using one pwm channel for forward and reverse in another circuit, that schematic would have been very helpful! But using an and gate is a good idea I hadn't thought of anyways.

    As far as the rest of the info on the page even though its the exact opposite of what im trying to do its still very useful!
  • Mike GMike G Posts: 2,702
    edited 2012-12-24 15:31
    @MIKE that PDF is extremely helpful and ive never been able to find something like that... This basically explains what I want to know, although it may be a little over my head
    Gears connect a feedback POT to the DC motors drive shaft. As the DC motor drive shaft spins, the gearing rotates the feedback POT.

    The PWM control signal acts as a reference voltage. The control signal (Vref) is compared to the voltage across the feedback POT. If Vref is larger than the POT feedback voltage the motor will turn one direction. If Vref is less than the feedback voltage the motor will turn in the other direction.

    When the voltages are equal, POT voltage equals Vref, nothing happens.

    The control signal is required for the servo to hold position as the circuit is always active.

    Sometimes servos twitch while holding position. That's because the internal circuit is always trying to reach equilibrium. If the PWM control signal, servos electronics, POT, or gearing are not good quality (or old) the servo might twitch as it tries to correct itself.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-12-24 20:25
    So then the last question I would have is when you pulse a CR Servo or ESC with a 3ms pulse then wait 20ms pulse again wait another 20ms, is this the acuall signal being amplified thaty drives the motor. It just seems to slow to me for that to be the case like the pulses are being interpreted then translated to a regular pwn signal or dac or something.
  • ercoerco Posts: 20,259
    edited 2012-12-24 20:39
    Once again, Google and Wiki Servo are your friends. :)
Sign In or Register to comment.