Shop OBEX P1 Docs P2 Docs Learn Events
Trouble running a servo. — Parallax Forums

Trouble running a servo.

Private19872Private19872 Posts: 61
edited 2014-04-28 14:15 in Propeller 1
I was working with my Demo Board and I tried to put on a servo. It twitched when the power went on, so I knew that the servo was working right. I loaded one of the demo files that came with propeller tool to test the servo, but it twitched and then did nothing else. Later I did a test and found that my propeller was brownout-ing. I replaced my old AA batteries with a new 9 volt battery but to no avail. I then tested with another servo. I was getting a bit more functionality than twitching with it, but then it stopped working like the first one. Can the Demo Board handle servos or do I need to make some kind of external circuit to use them? I realized that I wasn't using the resistor in between the prop and the servo. Is that dangerous to do or the cause of my problem? Thank you for your time.

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-04-27 20:18
    A 9V battery (the kind in smoke alarms) are not good for running servos. A servo draws a lot of power right when it begins to move and this will cause the voltage to drop since the battery can't provide enough current. The low voltage causes the Propeller to brown out.

    I've done lots of servo projects and and I'm sure the Demo board can drive servos just fine with the proper power supply.

    I'll edit this post with links to some of my Propeller servo projects.

    While I often see resistors suggested on the signal line of a servo, I very rarely use one. If you do use one, I suggest you no greater than 4.7K. I've had several servos not accept the 3.3V logic when a 10K resistor was on the line. 4.7K might be too much for some servos.

    Propeller Driving 32 Servos
    QuickStart Servo Tester
    Popsicle Stick Hexapod
    Small Hexapod
    Cheap Bot Using Two CR Servos

    I have some servo related links in post #10 of my index.
  • twm47099twm47099 Posts: 867
    edited 2014-04-27 20:31
    I had similar problems with my QuickStart board. I had a program controlling 2 servos. When the program directed the servos to move to the zero position, if they were not initially near zero, the QS would reset. I revised the program so that at start it only directed one servo to zero, waited a few ms, the directed the other to zero.

    I eventually bought a 4 AA cell holder and use that to to the servos' power voltage. Ground is connected to the QS board ground. With that power supply for the servos, I can run multiple servos at the same time.

    Tom
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-04-27 21:00
    twm47099 wrote: »
    I revised the program so that at start it only directed one servo to zero, waited a few ms, the directed the other to zero.

    This is a good idea when using more than one servo.

    I use this technique in my hexapod. Rather than start all the servos at once, I bring them online one at a time.

    A big capacitor on the servo power line can also help. In the QuickStart servo tester video I'm powering two small servos off the USB supply. I can only get away doing this by adding a big capacitor to the 5V line.
  • Private19872Private19872 Posts: 61
    edited 2014-04-28 13:14
    Would I be able to add another 9 volt in parallel with the first until I get more AA's or should I just try my 9 volt with a capacitor I have? (I have 2 4700uf capacitors and one 3300uf)
  • Private19872Private19872 Posts: 61
    edited 2014-04-28 13:17
    I just tried my 3300uf and got the servo to work for a bit, but I can't run it too long before it quits again.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-04-28 13:23
    Would I be able to add another 9 volt in parallel with the first until I get more AA's or should I just try my 9 volt with a capacitor I have? (I have 2 4700uf capacitors and one 3300uf)

    What kind of servo is it?

    If the servo is small enough you might be able to get by with adding a capacitor or two (the sizes you list should help).

    I'm not sure if two 9V in parallel would work or not. I'm inclined to think they would. You can always try it.

    I used to teach high school chemistry so I'm big advocate of safety glasses. If one of your 9V batteries or your capacitors blow up you don't want any or it in your eyes.

    I personally wear safety glasses almost all the time (though they double as reading glasses).

    I hope you report back on your progress (or lack there of).
  • Private19872Private19872 Posts: 61
    edited 2014-04-28 13:38
    Like I said before, I got my servo to work by using my 3300uf capacitor. I also just tried putting my 2 9 volts in parallel but I didn't get any results. Thanks for your suggestions.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-04-28 13:51
    Like I said before, I got my servo to work by using my 3300uf capacitor.

    Our posts had crossed paths. I hadn't seen post #6 prior to making post #7.

    I suppose having the servo work for a little while is progress?

    Finding an adequate power supply for servos is often a major part of a project involving servos.
  • Private19872Private19872 Posts: 61
    edited 2014-04-28 13:58
    Yes, I sort of just wanted to play around with my servo a bit, but I guess I can't be doing anything for too long until I get new batteries. Thanks, for your help.
  • infoinfo Posts: 31
    edited 2014-04-28 14:15
    Batteries should NEVER be connected in parallel. It is a FIRE HAZARD. I know people do it, even some manufacturers did it in the past, but it is looking for trouble - possibly costly lawsuit.

    If you can't get the right power supply and decide to parallel batteries, use at least diodes to "OR" the batteries. That way one (stronger) battery can not backfeed the other (weaker) battery, overheat and explode or start smoldering and eventually burn in flames. Even fuse on both positive terminals is better than nothing, but the fuse would have to be fairly high current for your motors, so it would provide very little or no protection.

    This is not a joke. You turn the switch OFF, put the device in a closet, but the batteries remain paralleled. They don't discharge at the same rate. One of them becomes the weak, the other the strong. Next thing you see is electrolyte leaking all over your device, maybe smoke coming out of closet, or you wake up in heaven, Not good.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-04-28 14:15
    Yes, I sort of just wanted to play around with my servo a bit, but I guess I can't be doing anything for too long until I get new batteries. Thanks, for your help.

    You're very welcome.

    I used to do some computer animation but once I learned how to move a servo with a microcontroller, having things move on a computer screen just didn't seem as much fun has having objects in the real world move around.

    You'll want to get rechargeable batteries for your servo projects. NiMH are good Lithium Ion and Lithium Polymer are even better. The rechargeable batteries often can source more current than alkaline cells can.

    There's a lot of bad information about batteries on the internet. I think the website BatteryUniversity.com has good information. I've learned a lot from the site (if I remember the correct URL, the site looks a bit different than I remember it looking).
Sign In or Register to comment.