Maker Pro
Maker Pro

24v DC motor driver

overload

Oct 20, 2010
10
Joined
Oct 20, 2010
Messages
10
Hi guys im looking for idea on how to control a 24V dc motor, looking at around 30W, its a small motor from one of the pumps in my saltwater reef tank, it comes with a controller but im not happy and i want to build my own to pulse the pump, i want it to sort of run on
2v for and then ramp up to 24v for about 2 seconds, its a wavemaker pump so in other words i want to pulse it, what do i need and how do i do abut doing this, also how can i vary the duty cycle? i was thinking some sort of timer circuit and an FET to control the votage to the motor. how do i go about doing this?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
You have at least 2 options.

One is to vary the voltage, another is to use PWM and change the duty cycle.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
That's generally the poorer option. Are you sure the motor will have sufficient torque at 2V?
 

overload

Oct 20, 2010
10
Joined
Oct 20, 2010
Messages
10
i need to go home and test that, i want it turning slow inbetween the blasts caused by the 24v, because if its standing stll my fish might creep in to inspect or rest and then get shredded when it kicks on,
 

overload

Oct 20, 2010
10
Joined
Oct 20, 2010
Messages
10
or better yet steve what do you suggest i do the best method to get the results i want, it will be fed from a 24v dc supply
 

rob_croxford

Aug 3, 2010
262
Joined
Aug 3, 2010
Messages
262
I would personally use PWM. PWM also varys the amount of power sent to the load however it is a much more efficiant way of doin so. It works by creating a pulse train (usually at a set frequency for motor control - gerarally quite high) and you then vary the duty cycle to control the amount of power delivered to the load.

For instance a motor running with a PWM of 50% duty cycle with be "on" for 50% of the time and "off" for 50% of the time. This means that only 50% of the full power will reach the load therefore slowing ur motor down. However obviously if the frequency is high enough you will not be able to see this on and off period at least not noticably.

There are two main ways of doin this :-
1)
You compare the DC input voltage with a triange wave to create the PWM this is a fairly simple and robust method using a triangle wave and a comparator (also often a multiplexor and various voltage referances can be used but this is mainly for timing and so would probably not be nessasary)

2)
The second method is to use a PIC that has a PWM or CCP module built into it. It is a fairly simple task.

Either one you use i would suggest using a transistor to bump up the voltage if using the first method (then use a resistor to get required current). however having undertaken the second option myself recently i would use a Mosfet as your switch as this will work given the 5V output u will get out of a pic (the transistor may not switch as the current of the signal is so low - uA)

hope this helps!
 
Last edited:

overload

Oct 20, 2010
10
Joined
Oct 20, 2010
Messages
10
im a power systems engineer so if its possible you guys will have to simplify it for me, im not 100% with electronics,
 

rob_croxford

Aug 3, 2010
262
Joined
Aug 3, 2010
Messages
262
Ok take a look at this link for the analogue method - http://homepages.which.net/~paul.hills/Circuits/PwmGenerators/PwmGenerators.html

It seems to go through what is needed to create PWM quite well.

As for the digital method it is quite simple however if you have not dabled in programing before it may be a bit of an ambitious suggestion.

However;
The general idea is to use a potentiometer (variable resistor) to vary the DC vontage entering the pic. (bare in mind that the highest voltage that can safely be used with a pic is 5V so a divider circuit may be needed to drop down your voltage to a sufficent level) This 0-5V variable voltage is then taken by one of the pics analogue i/o pins and put through a ADC to give a digital value. Generally you will be using an 8 bit ADC withch will give you a possibility of 256 different digital values. This value is then assigned a Duty cycle and produces a PWM wave form with a relavant duty cycle to the input.

I would suggest picking an option and making sure u fully understand its option. Then experiment with it to see whether you can create your own PWM. once you have the required PWM the rest is fairly simple.
 

overload

Oct 20, 2010
10
Joined
Oct 20, 2010
Messages
10
ok i can see whats happening, but wont i need some sort of relay to drive the motor?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
A power MOSFET would be a reasonable device to use. 24V 30W is pretty low power, so a MOSFET rated for say 60V (or more) and 5A (or more) is probably what you would be looking for. (Remembering that the peak current may well exceed 1.25A)

With PWM you turn the motor on and off many times per second. A relay wouldn't cope, and the buzzing would drive you crazy.
 

rob_croxford

Aug 3, 2010
262
Joined
Aug 3, 2010
Messages
262
as the Voltage is not to high you could simply use the FET as a switch. one pin of the FET is connected to ground, another pin is conected to the - of the motor and the gate pin of the FET is connected to your PWM signal. when the signal is high the FET provides a route to ground for the motor therfore turning it on, when the signal is low the path is broken and the motor is off.
 

overload

Oct 20, 2010
10
Joined
Oct 20, 2010
Messages
10
ok making sense to me now, im gonna look into this and call around and see where i can get the parts
 

overload

Oct 20, 2010
10
Joined
Oct 20, 2010
Messages
10
from what i can tell i will have to manually change something to vary the frequency coming from the PWM to drive my motor at say 20% and then alter something to change the frequency and then drive the motor at 100%, so how do i go about making the circuit drive the motor at 20% for about 10seconds, ramp up to 100% for about 1 second and then go back to 20% for 10 seconds......., by itself?
 

rob_croxford

Aug 3, 2010
262
Joined
Aug 3, 2010
Messages
262
You will never need to change the frequency the frequency remains constant, you need to vary the DUTY CYCLE. This is the % of time the pulse train is at "1" (on) compared to the amount of time the pulse train is at "0" (off).

can you explain why you want your motor to do this??

For this application i would think the easiest method would be to use a pic and simply create a program that runs a pwm signal at 20% for 10 seconds and then 100% for 1 second in a continuous loop. you could also add a push button to and create different programs what will come into effect if that button were to be pushed.

Another way you could do it would to be to design a circuit that outputs 2VDC (20% duty) for 10 seconds and then switches to 10VDC (100%) this would mean you could still use the analogue method. however it would increase the size of your circuit.

Or you could use feedback control. It all depends on what exactly you are goin to use it for and how precise it needs to be.
 

overload

Oct 20, 2010
10
Joined
Oct 20, 2010
Messages
10
well rob the pump is a wave maker in my saltwater tank i want to drive it with a custom controller to create a wave surge effect similar to wave in the ocean if you get what im saying. i like the idea of a pic, but then i would need the hardware to programme it as well as the programme, another major problem with be i dnt have any knowledge about programming but i would be able to learn that easily. also prescision is not an issue in the application
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Have a look at the PICAXE chips.

The programming hardware is very cheap. The software is free. And you program it in a form of BASIC (or by pictures).

The chips themselves are also pretty cheap, not much more than a PIC.
 

rob_croxford

Aug 3, 2010
262
Joined
Aug 3, 2010
Messages
262
Ok i understand your idea. My personal suggestion would be to download MicroC pro from microelectronica.com. This is a C compiler however it has a very very user friendly library of codes and PWM is covered (enough for your application).
here is my idea (i dont have a copy of MicroC to hand so it is just the basic idea)

You set up your pwm for say 5000Hz and itialise it.
You then set the duty cycle to 20%
Delay for 10 seconds
Set duty cycle to 100%
delay 1 second
in an endless loop.
this will give you the basic program for your pic and will not require anything but a 5v power supply to power the chip and the PWM output from the chip that will be initiated for you. I would suggest the PIC12f683 as it has only 8 pins, costs arround 70p and has PWM or CCP built into it. i really shouldnt be any more difficult than that if i get a few minuites i will set it up and give it a go.

You will then need the hardware to program your chip. I would suggest PICkit 2 for hobby projects, its cheap and easy and relativly reliable.

Make sure you read arround the subject and maybe buy a book, the C programing language is a brilliant book it all depends on whether you would consider this an investment for further projects or you simply are only interested in this one project.

Other people will disagree but i think the C language is the easiest and probably the most efficiant (alot of people will disagree on that) for programing. but the decision is up to u.

hope this helps
 
Top