Servo Problem...

I’m using the Turnigy TGY-9018MG servo with the sample Sweep and Knob sketches (not at the same time of course). I have other servos that I need to control as well, but I’m trying to get everything figured out using the smaller servos so I can connect them direct to my Arduino Uno (or Mega).

When I’m powering the servos from the on board 5V (first picture), everything works fine with the Sweep and the Knob sketches. But, when I try to use a 9V battery (via L7805 circuit built per datasheet schematic), a 31V/3A HP power brick (via LM317 circuit built per datasheet schematic for ripple reduction, turned down to various voltages ranging from 4.2V-5.8V), or 4-AA batteries…each with a common ground to both the circuit, the servo, and the Arduino Uno/Mega (second picture)…I get nothing!

Also…in a robotic arm I’ll have to servos back to back on the same joint. In order for the servos to rotate in the opposite direction from one another, I need to ______? I haven’t had a chance to do many searches on that yet, so if someone to drop some links or some finite terminology, I’d GREATLY appreciate it!!

This is a very common problem - its best to search first, ask questions later.

Small 9V batteries have no chance of powering a servo, which can take an amp or so peak. PP3-sized 9V batteries barely handle 100mA.

You probably will have problems running the servo and Arduino from the same 5V rail - worst case you could damage the Arduino, but random resets are highly likely.

Re the back to back thing, not quite sure what you mean, but this might help.... if you have a variable say servoPos, then send one servo to servoPos and the other to 180-servoPos.

But then, I'm not really sure what you want to do.

Not to be rude but when responding to an OP, it’s best that you actually read what they wrote, “listen”, and not make assumptions. The most common problem, is someone not using a common ground…but if you’ll notice I am using a common ground. Other trouble shooting techniques I’ve learned during my 17 yrs in the military and one trip to the sandy beaches of Iraq, racking up enough hours to be ranked as a junior in college (but only a MCEG freshman), and while creating this vimeo.com/18418037 (I omitted the http and HTML tags to avoid a huge video in the middle of my post) by using the REN48LSD and Vixen (search for it, then ask. lol)…I tried using different power sources, different boards, and the smallest servos I have that use <500mA. And when I said that “everything works fine” when using the 5V rail for the small servos, that means neither board has reset itself. I’m only using the 5V rail until I’m able to discover what the problem is, then once that is corrected I’ll be able to drop the 5V rail (that currently works) and only use external power (which doesn’t work).

Others have successfully used 9V batteries during tutorials to demonstrate the use of off board power sources, with a caveat pertaining to their low mAh rating. So there’s a difference between “only for a few minutes” and “no chance”.

In addition to what I wrote in my OP, I’ve also tried uploading the sketch using different USB cables, different computers, and just about anything else you can think of except standing on my head, walking down the street, or the one thing I’m missing that will solve my problem. lol

I really hope that someone can help this Marine…as opposed to only offering arrogant smartalec comments, inaccurate information, or anything else that wouldn’t of needed to be said if they’d actually pay attention to the words in front of them.

Jimbo…I’m sure there is a better way for me to describe it than “back to back”, but my mind in totally wrapped around conquering step one and while I’m stuck with no where to go I’m beginning to look ahead to the next few steps so I’ll be ready. But with the way they’ll be positioned, one will need to rotate clockwise while the other rotates counter clockwise. What you stated is what I kind of anticipated, in just creating an inverse operation. Thank you for giving me a starting point to research! :slight_smile:

one will need to rotate clockwise while the other rotates counter clockwise

Worth asking this then just to make sure… are these conventional servos?- ie normal 0-180 and stop anywhere at a specific angle, or converted to continuous rotation (more like a dc motor) but under quasi-servo-control? In continuous servos, what was the “position” of a normal servo, becomes the direction and speed of a continuous one.

nitewing76: Not to be rude but when responding to an OP, it's best that you actually read what they wrote, "listen", and not make assumptions.

Yes, I read that you tried a 9V battery, and saw that you had connected a servo supply to the 5V pin in the first photo - both of these are common issues that crop up all the time here - which suggested a lack of research, causing me to re-iterate the posting guidelines on these forums.

I didn't say anything about the LM317 case since you didn't show that part of the circuit, nor did I say anything about common grounds.

I really hope that someone can help this Marine…as opposed to only offering arrogant smartalec comments, inaccurate information, or anything else that wouldn’t of needed to be said if they’d actually pay attention to the words in front of them.

Well then you need to prove it for yourself that a small 9vdc battery cannot power a servo properly due to lack of current capacity. Put a scope on the output or input of the regulator that is wired to the servo power pin (and ground of course) and see what it does as the servo tries to work with the sweep or knob sketches. I’m pretty sure you will see the source of your problem.

Lefty

@Jimbo…All of the servos I have are conventional servos that rotate that do rotate from 0-180 degrees. The only place that will require continuous rotation will be at the base and I have a NEMA 17 stepper motor to handle that.

@MarkT…I wasn’t asking for comment on the LM317 circuit because like I said, I went by the LM317 datasheet. So you read that I am using common grounds (which would indicate research), then make other assumptions that I’m not doing research? Contradictive…

@RetroLefty…The only reason why I even tried a 9V battery was because in my research I have seen a few people rotate their servos successfully by using a 9V battery); while saying the 9V was only being used for demonstrations purposes. If the 9V was the problem, then why will the servo not operate under 31V/3A power brick? Granted the LM317 is only rated for 1.5A, it’s still 3x the amperage of a USB. And I did forget to mention that one thing I did try was unplugging the Uno from the USB port and using a 9V battery to run the Uno and the servo… while it did take a few seconds to get started, after that everything operated fine. I know I could have blown the Uno up and that’s why I didn’t try it on the Mega.

I do not want to use the 5V rail, a 9V battery, AA’s, or anything else besides the 31V/3A (with a different voltage regulator circuit when I try to run all of the servos) on a permanent basis. During the final stages of the project, after everything is up and running and all the bells and whistle have been added, I’ll be able to calculate the requirements for a LiPo or other more appropriate battery.

Since the servo runs fine on the 5V rail, but no other power source I’ve mentioned…that tells me that the Arduino software and libraries running fine and no corrupted data, there are no obvious issues with the Uno, Mega, or my laptop (Dell Latitude E6520 Win7 x64), and a whole list of other things I’m able to cancel out as possible reasons. One power source I didn’t try was using a different surge protector or one of the two UPS battery backups I have.

Heck…might as well head to the garage and grab some jumper cables! lmao I’m well aware of the weakness of alkaline batteries and the 5V rail. And it all would make sense if the servos worked on the HP power brick (which then I wouldn’t even need those others). I asked one of the Elec Eng professors if I could put it on a scope, but I have to wait two weeks until finals are over before I can check the quality of the power brick.

I really hope that someone can help this Marine...as opposed to only offering arrogant smartalec comments, inaccurate information, or anything else that wouldn't of needed to be said if they'd actually pay attention to the words in front of them.

I suggest decaf. 8)

Zoomkat...truth be told I haven't had a cup of coffee in months. lol I just get enough of the "hearing, but not listening" from my ex. What got me fired up was that it seemed as if that person merely skimmed through my post and made assumptions. I do understand his perspective, because in the gearslutz.com forum at least once every other week someone will ask the same question about acoustic panels. However, that does not explain his contradictory assumptions.

Anyways....problem solved. One would think that anything with the letter's HP on the cover would work correctly every time, right? (sarcasm) The short version of the story is that eventually I discovered that the 31V/3A power brick was not delivering up squat. Because as soon as I grabbed an old Motorola 5V/550mA wall wort and snipped the plug...the servos worked fine. So I grabbed the multimeter and discovered that with the Arduino 5V rail and the wall wort, the servo was drawing ~240mA with no load. But, when it was attached to the HP paper weight (cause that's a it is until I get time to troubleshoot it), it was only drawing 40mAw with no load.

So thanks to Jimbo for giving me starting point on the clockwise/counterclockwise rotation and thanks to Lefty for suggesting I put the 9V battery and servo on a scope. While I won't have access to an oscilloscope for a week or so and already knew the weakness of a 9V...it did get me thinking more about the power source. And no, I did not make it far enough in the progression to use the jumper cables. lol

See, who said Marines are stubborn? It's just not true, in all cases. ;)

Ex USAF. We USAF enlisted were a bit smarter then the average Marines. We sent our officers off to combat in our airplanes while we stayed back at base ready to repair whatever they broke. ;)

Lefty