Go Down

Topic: [SOLVED]Drive servo with BJT (Read 414 times) previous topic - next topic

surepic

Apr 07, 2019, 08:52 am Last Edit: Apr 08, 2019, 05:34 am by surepic
Couple days I cant solve the problem with driving servo via S8050 npn bjt.

Configurations is common emitter. When connecting hobby servo directly to +5v and GND rails I can control it without any issues. power to 5V rail is supplying Arduino uno through +5v pin. As far as I know uno`s power regulator can supply up to 800ma peak current. Uno`s 328p is bypassed with shorting reset pin to ground.

when testing with multimeter I can clearly see peak current of 1A and dimming leds on uno board as well but servo is working pretty good like that.

Now the main part of the problem.

I connected S8050 to servo. Base is pushed by 3.3v Attiny pin with 270ohm resistor on the way. So current to the base is 12ma.

Motor is connected this way vcc pin to +5v rail powered by arduno uno. servo ground to collector of bjt. Emitter to common ground. flyback diode also installed across servo.

The problem is that it seems servo is not getting enough voltage or current sometimes. When sending pwm its rotating to same direction always. pwm signal is good … tested hooking up servo VCC and GND directly to rails.

tried Darlington configuration with 2xS8050 didn't help either.


any advice to solve this problem ? I am thinking of increasing voltage to servo to 6v don't know yet if this will help with this issue.


thanks.

can draw and post a schematic if needed.

neiklot

can draw and post a schematic if needed.
You should have started with that, since I (maybe it's just me?) can't picture what you're trying to do.

Just get an external supply for the servo, 4x AAs for example, hook the grounds together, and Sorted.


slipstick

Can you explain what you're trying to achieve with that transistor? It sounds like you're trying to switch power to the servo on and off by effectively disconnecting the ground. I'm having trouble seeing any reason to attempt that (ignoring for the minute that low-side switching doesn't work in this context).

Steve

Paul__B

As far as I know uno`s power regulator can supply up to 800ma peak current. Uno`s 328p is bypassed with shorting reset pin to ground.
None of that makes sense.

To use a BJT transistor to switch 800 mA - if indeed the servo does not require more that that - you need to supply 80 mA to the base which the Arduino cannot do.

You need a logic-level pFET to switch the positive rail.


surepic

#4
Apr 07, 2019, 03:55 pm Last Edit: Apr 07, 2019, 03:56 pm by surepic
@neiklot schematic now is attached. external supply directly to servo without control will waste more current than leakage current of transistor if its switched off.

@slipstick you are right I`m trying to drive servo from low side.

@Paul_B explanation of the quoted part:
If my assumption is right then power regulator of uno board is providing 800ma peak current. If 328p will be powered it will suck current while being powered on but by bypassing power to 328p via reset to gnd I`m eliminating current path to 328p.

Servo does require supply to deal with stall current. I measured stall current and startup current is around 1A. Motor is towerpro MG995 and as per their datasheet min voltage is 4.8v and stall current 1.25A. But if thats true then why arduino uno regulator with 800ma is dealing with servo stalls without any problems? I connected directly to power rails without bjt and servo is working like a charm. I`m thinking can it be that transistor voltage drop is enouvgh to lower voltage to servo more than 0.2v then it will be around 4.7v or lower which can cause erratic behaviour.

Amplification of 10 can be corrected via darlington config which I did but again that didnt help.

What I didnt tried yet is +6v to motor and sziklai pair.


neiklot

Why don't you just do a myServo.detach()?

Then it won't be getting the continual pulses to remind it where to go, and as far as I'm aware, won't be drawing any current.



surepic

Because myservo.detach has nothing to do with motor coils.


"@neiklot schematic now is attached. external supply directly to servo without control will waste more current than leakage current of transistor if its switched off."

neiklot

Because myservo.detach has nothing to do with motor coils.

We live and learn: I just measured 6mA on a myservo.detach()-ed HK13158 servo, so about the same as an led.

But what's your application that the power consumption is a thing?




larryd

OP image:


If you are powering the servo from the UNO,       DON'T.

You will damage the UNO in short turn.




No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

surepic

#9
Apr 07, 2019, 04:51 pm Last Edit: Apr 07, 2019, 04:53 pm by surepic
Larry currently i dont have voltage regulator i know its not smart to use unos output to power servo. Its jst for experiments. I will get one regulator for 6v tomorrow.

@Neiklot currently its not battery powered but i need to finish this part to switch to bms. So transistors will be swapped to fets eventually but as i am stucked in bjt problem i want to solve it and understand the issues then proceed.

tjones9163

Im probably wrong but dont you need a signal pin being fed with pwm and power hooked to V+  and ground hooked to V-? I only see 2 pins for your motor in the schematic? shouldn't there be 3?

neiklot

Im probably wrong
You're right, but what I think the OP is getting at is how to cut the power to the servo, as opposed to controlling it. So yes, the third wire is needed to control the servo, but I guess not relevant to a discussion about cutting the power.


surepic

#12
Apr 07, 2019, 06:25 pm Last Edit: Apr 07, 2019, 06:27 pm by surepic
Thats right i draw the part which has issue. Not to make things even more complicated.

Motor is getting its pwm through 3rd wire.

Small update:
Checked vce and its 0.28-0.3v when motor is running so i think motor is starving voltage as per datasheet minimum should be 4.8v but with collector to emitter drop its getting 4.7v.

tjones9163

Thats right i draw the part which has issue. Not to make things even more complicated.

Motor is getting its pwm through 3rd wire.

Small update:
Checked vce and its 0.28-0.3v when motor is running so i think motor is starving voltage as per datasheet minimum should be 4.8v but with collector to emitter drop its getting 4.7v.
gotcha, just making sure im not going crazy, and by reading this post i also know how high and low side switching work.(After a quick google search).
Thanks

slipstick

Checked vce and its 0.28-0.3v when motor is running so i think motor is starving voltage as per datasheet minimum should be 4.8v but with collector to emitter drop its getting 4.7v.
4.7V is very unlikely to stop a servo working. A specification of 4.8V for hobby servos really means 4 x 1.2V nominal NiMH rechargeable batteries and people regularly run them down to 4.2-4.4V before recharging without any problems.

Steve

Go Up