Hobby servo issue - Page 1
Forum section: electronics / beginners

author: VEGETA
author_rank: Super Contributor
timestamp: February 19, 2016, 06:43:45 pm
content: Hi there,I am making a project that uses a servo motor which is Futaba 3003 one. I made a 50Hz PWM signal out of PIC16F877A module and verified it by Proteus simulation (I don't have a scope right now). I've modified the code to make the servo go to 90 degree then 0 then -90 each 2 seconds forever, and in simulation it is perfect.However, in real world it didn't work!I hear the servo but it doesn't go to positions, but sometimes when I replug its power cable it makes a higher sound. One of the times when I was testing the code, it did work for a short time then continued to make that low sound again.Everything is good like schematic, breadboarding, code, simulation, ...etc. Why do you think it doesn't work?My guess is: Power consumption!As I power the whole project from one of these Nokia 9v 350 mA adapters (measures about 7.5v) then followed by 7805 regulator (measures 4.89v). I suspect that it doesn't supply enough current, is that right? one indication is that continuous low sound gets a bit louder when connected to the 7.5v of the adapter.I am about to have on of these DP30v2A power modules that has more power than the damn nokia adapter, so please shed some light at my problem and tell me if power is the only issue? is it that simple? or is there more into it?See attachments for project file in proteus and mplabx. (code is from the first video of my channel with some adjustment of the testing code in it).thanks!

author: dferyance
author_rank: Regular Contributor
timestamp: February 19, 2016, 06:53:08 pm
content: While it's probably not it, don't rule out mechanical failure. Gears can break and / or get stuck. The fact it worked once could point in that direction. I've had brand new servos break right away before just randomly. You could always take it apart and turn the pot to test it out. They just can be tricky to put back together with all the gears.But yeah, I would strongly suspect your power system, especially with a linear regulator like that. Does the regulator get hot?

author: VEGETA
author_rank: Super Contributor
timestamp: February 19, 2016, 07:40:08 pm
content: Quote from: dferyance on February 19, 2016, 06:53:08 pmthe regulator does get warm, but "hot"? no.I just told you that the source to that regulator is the 9v 350mA nokia charger which is 350mA max... so regulator can not go over that.

author: Skimask
author_rank: Super Contributor
timestamp: February 19, 2016, 07:41:18 pm
content: Quote from: VEGETA on February 19, 2016, 06:43:45 pmNot hardly enough.Probably don't even have any capacitors in the circuit...right?

author: VEGETA
author_rank: Super Contributor
timestamp: February 19, 2016, 07:46:09 pm
content: Quote from: Skimask on February 19, 2016, 07:41:18 pmthere are input and output cap on the 7805 regulator. I thought they are straightforward so I didn't mention them.

author: Chalcogenide
author_rank: Regular Contributor
timestamp: February 19, 2016, 07:52:45 pm
content: A servo can easily pull 1A if you require some torque. The high pitch noise might be the servo trying to get in position, but not having enough current to generate the required torque.

author: Kilrah
author_rank: Unknown
timestamp: February 19, 2016, 08:45:01 pm
content: Are you sure of your pulses? If frequency is higher than 50Hz it can fail to work with a "high pitched sound". And are your pulses of the correct 1-2ms lengths?Quote from: VEGETA on February 19, 2016, 06:43:45 pmOr you burnt the servo out, because unless it is the HV type a servo won't stand more than 6-6.5V, some explitly should not even be powered with 6V, 5 only.

author: Skimask
author_rank: Super Contributor
timestamp: February 19, 2016, 08:50:15 pm
content: Quote from: VEGETA on February 19, 2016, 07:46:09 pmNot as straightforward as you'd think.How about some extra's where the servo plugs in...Besides, you say your power supply is apparently rated for 350mA. Probably 350mA on a good day.Again, not hardly enough. Little hobby servos like that will grab as much current as they can to get moving...more than 350mA for sure.

author: TheDirty
author_rank: Frequent Contributor
timestamp: February 19, 2016, 09:08:21 pm
content: It's likely your servo is taking too much power and resetting the PIC. The whole thing goes into a power reset loop.

author: VEGETA
author_rank: Super Contributor
timestamp: February 19, 2016, 09:11:06 pm
content: QuoteYes I am sure of them, you can look into my video in my channel to make sure of it. I wrote a test code in the while loop to make it t_on=1 ms for 2 seconds, 2 ms for 2 sec, 1.5ms for 2 sec. and loops forever. in proteus, it worked perfectly like expected.QuotePut a cap between + and - of servo plugs? I will, but I didn't think it is the problem.QuoteSo it is what I thought it is, Power. I doubted it from the first moment especially that I connected an LED without a resistor on a PIC pin and it is lighting good, but I notice it sometimes shut off (or dim for a moment) when I plug the servo (not always)... So that is due to power starving, no other way right?I've got one of these (http://www.aliexpress.com/item/1-44-inch-input-voltage-6V-55V-DP50V2A-LCD-display-votage-conerter-constant-volt-current-1/32542939280.html?spm=2114.01010208.3.11.sh2Iow&ws_ab_test=searchweb201556_6,searchweb201644_4_505_506_503_504_502_10001_10002_10017_10010_10005_10011_10006_10003_10004_10009_10008,searchweb201560_3,searchweb1451318400_-1,searchweb1451318411_6449&btsid=b8300665-3833-4372-b606-fc9131828073) but I don't have it right now (probably in a week or 2 I will)... So I plan to use it as a power supply (put a transformer + rectifier diodes before it). I think it is good enough for now.

author: Skimask
author_rank: Super Contributor
timestamp: February 20, 2016, 12:09:50 am
content: Really? You can't think of any other source of power for the purpose of testing. A wholebatteryof options out there, and no idea where to go?4braincellscan't work together to come up with an idea forpower? Really?

author: kezat
author_rank: Contributor
timestamp: February 20, 2016, 12:18:51 am
content: Try doubling (or more) the delay between each positive going pulse. Analog servos have less buzz with a slower pulse rate, for example my multi rotor control board (KK2) if setup for a servo and not on ESC mode rate low selected will give a 1ms pulse followed by a 11.5ms delay.If your using the PWM output you might not have the control to do this.

author: VEGETA
author_rank: Super Contributor
timestamp: February 20, 2016, 05:13:36 am
content: Quote from: Skimask on February 20, 2016, 12:09:50 amOMG so you think I don't know how to use a battery?! I can buy a 9v battery and use it but it is not going to be enough all the time, I would still need a power supply.For the purpose of testing?... well, maybe... the problem here is if I wanna buy some good and cheap power supply from outside, I will wait at least 3 weeks for it to arrive, then pay the damn customs! the problem is that you don't know how much will it be!Customs are very bad here in Jordan... As bad as they forced the team of Theeb movie to pay customs for their prize that they won in Britain!!! So if they can get 1$ from you, they will. That is why I want to buy that power module because it might go in without customs due to its size, and it very well did! I still need to go to my home town to get it cuz I am working in another one which is very very far.I posted this thread to make sure is it about low power or not, that is all. I will try today with a 9v battery source and see what happens.

author: Skimask
author_rank: Super Contributor
timestamp: February 20, 2016, 05:32:45 am
content: No, but likely can't, or don't want to, read the hints very well.And a 9V battery surely doesn't have enough punch to drive any servo...well, maybe a tiny micro-mini servo, but that would be about it, if the battery was fresh, with big capacitors, under no load, on a good day.

author: VEGETA
author_rank: Super Contributor
timestamp: February 20, 2016, 11:29:04 am
content: the servo is Futaba 3003. I am afraid 9v batteries are all the best available option for me right now... how about connecting 3 of them in parallel? this will increase the current.

author: OC71
author_rank: Contributor
timestamp: February 20, 2016, 04:31:05 pm
content: How about 3 D cells in series. Should give you around 4.8V and enough current.

author: Ian.M
author_rank: Super Contributor
timestamp: February 20, 2016, 05:52:26 pm
content: Get a 2A USB phone charger PSU and use that to power the servo and use your existing supply for just the PIC. (connect the 0V side of both together)If that fixes it you can try it on just the 2A phone charger PSU for both, but you may need a Schottky diode between the supply and PIC Vdd + a large capacitor from Vdd to Vss to stop the PIC's supply dipping and resetting it when the servo draws a large current spike from the PSU. I've used 470uF there to stop a PIC16F88 resetting when the servo moved.

author: Skimask
author_rank: Super Contributor
timestamp: February 20, 2016, 06:26:59 pm
content: Quote from: VEGETA on February 20, 2016, 11:29:04 amReally?You can come up with 9V batteries, but can't come up with 3 or 4 AA batteries and powering just the servos off those?Really?

author: VEGETA
author_rank: Super Contributor
timestamp: February 20, 2016, 07:43:24 pm
content: Quote from: Skimask on February 20, 2016, 06:26:59 pmit is not about "coming up with that idea", it is about if I can get to the market and buy them lolololol.No, I was doing ok with that supply for all other stuff and this servo was another story. that is it. I will stop working on the project and continue playing league of legends until the next week when I will get to my home town and receive that power supply module... then it will be good enough.

author: Skimask
author_rank: Super Contributor
timestamp: February 20, 2016, 07:46:57 pm
content: Quote from: VEGETA on February 20, 2016, 07:43:24 pmWell, you have to tell us these things.Don't know about anybody else, but my crystal ball is broke.

author: VEGETA
author_rank: Super Contributor
timestamp: February 20, 2016, 07:51:16 pm
content: Quote from: Skimask on February 20, 2016, 07:46:57 pmI thought all electronics engineers or hobbyists are too lazy. Maybe that is just me.I will update this thread when I do something.

author: Ian.M
author_rank: Super Contributor
timestamp: February 20, 2016, 08:06:17 pm
content: You could use the power supply for the servo and a 9V battery + a 5V LDO regulator for the PIC to see if it works better.

author: Psi
author_rank: Super Contributor
timestamp: February 20, 2016, 08:41:58 pm
content: Put a large cap on the 9V rail, so it can provide the high peak currents needed to get the servo arm moving.

author: Jeroen3
author_rank: Super Contributor
timestamp: February 20, 2016, 08:51:56 pm
content: Servo's do not tell their power usage on the specsheet since the power usage is relative to the requiredwork.https://www.pololu.com/blog/17/servo-control-interface-in-detailI you want more work than the battery can provide power, something will stop.I think work is the correct term.

author: Ian.M
author_rank: Super Contributor
timestamp: February 20, 2016, 09:22:24 pm
content: Quote from: VEGETA on February 19, 2016, 06:43:45 pmIts probably also not supplying enough voltage. The nominal dropout voltage of a 7805 is 2V, so it needs at least 7V in to regulate. If the 7.5V was measured off-load, the chances are that the input voltage is dropping below the 7V minimum required when more current is taken. To test this, disconnect it from the PIC and servo, and check the 7805 input and output voltages when loaded with a 15R or 18R resistor. Caution: the resistor will dissipate up to 1.5W and the regulator will need at least a small heatsink. Due to the dissipation, you may want to use 6x 100R 1/4 W or 3x 47R resistors in parallel.