Go Down

Topic: Controlling Speed of DC Motors (Read 1 time) previous topic - next topic

CantSayIHave

Hi!

I'm building a very small car using two
DC motors, a dual h-bridge driver, and an ATtiny84.

Because I don't really have room for a speed controller, I decided to try transistors for the job.

I found when I applied gradual PWM to the transistor, the motor also increased gradually, which is what I want.

My question is, is PWM on a transistor a good option for speed control, or are the constant pulses bad for the motors?

russellz

My question is, is PWM on a transistor a good option for speed control, or are the constant pulses bad for the motors?
It's fine, a common method of speed control.

Russell.
Retired after 40 years as a chartered engineer working mostly with RF and analogue electronics.

TomGeorge

Hi,

Quote
DC motors, a dual h-bridge driver, and an ATtiny84.

Because I don't really have room for a speed controller, I decided to try transistors for the job.
Are you using the H-bridge driver or a separate transistor.

Can you post a picture of your project.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Can you please post a copy of your sketch, using code tags?
Please use code tags.. See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html

Tom..... :)
Everything runs on smoke, let the smoke out, it stops running....

MarkT

You have an inductive load, therefore you need a means to prevent inductive
voltage spikes, usually free-wheel diode across the motor terminals for one-way
motor control with PWM.

Is your transistor rated adequately for the max current from the motor?

Is it being driven to saturation properly?

If the answer to either of those questions is no, it could easily fail.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Paul__B

Because I don't really have room for a speed controller, I decided to try transistors for the job.
Ah!  There's the problem!

CantSayIHave

I don't exactly have a circuit diagram but the wiring isn't very complex.

I'm using 7.4v to power the 7.5v battery, and a separate power source for the board, so to get them working together, I connected their grounds together.

The transistor I'm using is a 2N2222a, and the motors draw 200-300mA.

I simply placed the transistor between the motor and ground.

JimboZA

Do you have room for a small controller like this?
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

CantSayIHave

Like I said, I'm using one like that, a dual H-bridge l293d.

I would put a PWM to the enable pins, but they never seem to accurately control speed.

CantSayIHave

I don't know, I'll test the enable pins tonight and get back to you

russellz

Like I said, I'm using one like that, a dual H-bridge l293d.

I would put a PWM to the enable pins, but they never seem to accurately control speed.
Driving the enable input will not work as disabling it gives a high impedance output.

Russell.
Retired after 40 years as a chartered engineer working mostly with RF and analogue electronics.

Go Up