Weird servo problem
jaeg
Posts: 156
I'm not sure if this is a problem with the Prop or the servo but here goes. I'm working with a Lynxmotion Brat and in the past I've controlled it with an Arduino no problem but at first I tried a GadgetGangster with a servo module and for some strange reason one of the servos has difficulty locking into a position. This is hard to describe but but if you tap on the limb in one direction the servo pans all the way to one side then tries to move back to it's original position. A lot of the times it fails to do this and pans all the way back again and tries again. However it doesn't do this if you tap the other direction on the limb. I've tried swapping which pin it is on be it doesn't seem to matter.
Any ideas?
Any ideas?
Comments
You might want to take a look at this thread for some ideas.
It might also help if you output an increasing number to a terminal window so you can see if the Prop is resetting or not.
Your discription "A lot of the times it fails to do this and pans all the way back again and tries again" makes me think the Prop is resetting.
I have had servos work with the Prop without series resistors that wouldn't work with series resistors. This might be the case with your servos.
Servos would normally receive a signal line that pulses 5V. The Prop IO pins only output 3.3V. I think for some servos, an added resistor is enough to keep the servo from "seeing" the 3.3V signal.
I often see advice (from people who know a lot more about this stuff than me) to use series resistors on the signal line. I personally have found series resistors can cause problems and I don't use them when I use a servo with a Propeller.
Please don't assume your servos don't work with the Prop. I bet a dead Propeller chip they will.
Please discribe what you are using to power the Propeller and servos. If possible use a separate power supply for the servos than the Prop. Make sure the grounds of the two power supplies share a common ground.
I still think your problem falls within the 90%.
I've had many "wall-wart" power supplies not work with servos controlled by a Prop. This has happened to me several times when I was sure the power supply wasn't the problem while people on the forum kept saying it was. It turned out they were right.
A good battery pack can often be a better power supply than a transformer. A 9V battery is not a good battery pack. You want AA or larger cells of freshly charged NiMH batteries or something similar.
Also make sure you are only testing one of your larger servos at a time (at least until you get the one working). Two servos will increase the chance of power supply trouble.
Edit: Here are a few of my Propeller servo projects. 32 servos driven by QuickStart. Popsicle Stick Hexapod. QuickStart Servo Tester.
My power supply is 5 recharable 2500mAh NiMh cells. They worked with the Arduino and the Propeller wasn't resetting. However I don't think it's getting the run time like it was with the Arduino which is strange. It could run the Arduino till it reset itself but with the Prop it seems the servos stop before the micro resets. I'm guessing it's because of the Props lower operating voltage? And what would cause the increase power drain? There are built in USB and SD card ports could the be contributing?
Since not all servos are created equal... some can leak a lot of electrical noise from the motor back through the signal line. That would be one reason. Another reason would be for long runs (greater than a foot) from the micro controller. Long electrical runs can act like an antenna to the micro controller I/O pin and inject unwanted electrical noise.
If your servos are electrically 'quiet' and are located a short distance from the micro controller then a resistor isn't necessary.
Note: Another attenuation option is to use the resistor to Ground instead of in series with the Servo signal line.
Very good. I was afraid you thought the Prop could only control the small servos.
It also sounds like you've got the battery issure covered. I've just seen too many servo problems caused by trying to use a 9V battery to power the whole system (not that I wouldn't have tried it when I was new to this stuff).
As you can see from my list of projects, I've been on a bit of a servo craze lately. They're a lot of fun and a great match for the Prop's parallel processing abilties (I don't know of many other uCs that can run 32 servos without some sort of external controller or ICs).
Short answer is no.
But I do have some guesses. Analog servos only power their motors when refreshed. So if the Prop is refreshing the servos at the normal 50Hz it will use more power than a uC that refreshes the servos less frequently. Other uCs often have a lower refresh rate than 50Hz because they can only refresh the servo with each loop of the program. The main loop in a program can easily take longer than 20ms causing the delay in refresh pulse.
If you're using digital servos, then I'm clueless as to why there is a run time difference.
This isn't me being anal or anything. I use to get 25 minutes run time and right now I'm getting 6.
I changed the zone timing in the servo driver and drastically improved my running time. Thanks for everyone's help!