Adding presets to pwm motor controller

Thread Starter

skot9000

Joined Jan 28, 2009
18
I am working on a circuit to control a DC motor from a microcontroller. The motor needs to have 5 distinct speed settings that are manually set from 5 potentiometers. The microcontroller will be used to select from those 5 different speeds (over it's ethernet connection).

I have a PWM motor controller that works great on it's own. However this motor controller has just one pot used for setting the motor speed. I would like to modify the motor controller circuit to have 5 pots, and use the microcontroller to select which pot is active in the circuit.

see the original motor controller circuit diagram at http://www.skot9000.com/proj/fountain/pwmcircuit.jpg

I am using an input voltage of 12VDC to the circuit. The pot of interest in the diagram is labeled "VR 10K" and it's just left of center connected to the non-inverting op-amp terminal.

I am thinking I should use transistors as switches, possibly between R12 and "VR 10K" but I can't quite wrap my head around how it will work, and what the effect of not having any of the transistors switched on would be on the op-amp.

anyone have any thoughts?

thanks!!
-skot
 

BMorse

Joined Sep 26, 2009
2,675
you can try using an analog switch IC such as the 4066 Quad Bilateral Analog Switch, you can have the pots attached to the inputs and use the uc to switch to which one you want to use.

My .02
 

SgtWookie

Joined Jul 17, 2007
22,230
Well, the 4066 would be one possibility, but our OP would have to use a couple of them.

How about a 4000-series 4051 8-to-1 multiplexer/demultiplexer, or 74HC4051? That would save on PIC pins for addressing as well; only 3 would be required. They could also expand presets up to 8 by just adding three more pots if desired.
Here's a 74HC4051 at Digikey:
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=MC74HC4051ANGOS-ND
Datasheet is available here: http://www.onsemi.com/pub_link/Collateral/MC74HC4051A-D.PDF
The 74HC4051 will have a lower resistance than the 4000-series 4051.
 
Last edited:

Thread Starter

skot9000

Joined Jan 28, 2009
18
Excellent, the 74HC4051 looks like a good choice, and they're nice and cheap. Jameco has them for 25 cents. Thanks for your suggestions BMorse and SgtWookie! I'll let you know how it goes.

-Skot
 

SgtWookie

Joined Jul 17, 2007
22,230
I confess that I didn't look at your schematic until just now...

Are you really driving a pair of IRF1404 MOSFET gates with the 9012/9013 transistors, that in turn have 10k base resistors? If so, I'm afraid that your MOSFETs will spend a long, long time in the linear region unless your PWM is at a very low speed. The IRF1404 has a typical total gate charge of 160nC, max of 200nC; so double that. The 9012/9013 transistors with 10k resistors on their bases won't be in saturation for a fair portion of the charge/discharge cycles.

And are you really using a single FR302 diode for the flywheel diode? Your MOSFETs can sink up to 150A total (limited by the TO220AB package) but the diode is only rated for 3A. You're going to have a toasted diode once you get into around 50% PWM duty cycle, unless your motor is really low-current.
 

Thread Starter

skot9000

Joined Jan 28, 2009
18
I didn't design the motor controller. it is an off the shelf assembled "kit" http://www.electronickits.com/kit/complete/motor/CKMX067.htm

It claims it can do 30A, and my motor is 4.5A.

I've been running it at full speed (which would be 100% duty cycle, right?) for about 10 minutes now and the FR302 is still cold.

I wonder if the MOSFETs not being saturated has anything to do with this?

I should mention I have been running the PWM frequency at 100Hz, although the controller is adjustable upto 3kHz.
 

SgtWookie

Joined Jul 17, 2007
22,230
I didn't design the motor controller. it is an off the shelf assembled "kit" http://www.electronickits.com/kit/complete/motor/CKMX067.htm

It claims it can do 30A, and my motor is 4.5A.
I see that. Using a pair of IRF1404 MOSFETs is maximum overkill for a 30A load. The limiting factor is most likely the way they made the PCB (probably used 1 Oz copper and skimpy traces/connectors). The one heat sink is almost completely blocking the airflow for the other heat sink.

I've been running it at full speed (which would be 100% duty cycle, right?) for about 10 minutes now and the FR302 is still cold.
Correct; at 100% you won't see any heating of the FR302. It'll be midrange; somewhere between 50% and 75% or so when the motor is well saturated with current, and then the MOSFETs cut off.

I wonder if the MOSFETs not being saturated has anything to do with this?
The MOSFET gates rise/fall times will be quite slow. That's why they limited the PWM frequency to a range of 100Hz to 3kHz. If you keep the frequency low, the MOSFETs will spend less time in the linear region.

I should mention I have been running the PWM frequency at 100Hz, although the controller is adjustable upto 3kHz.
The faster you run that PWM controller, the hotter your MOSFETs will get.

I wouldn't run that controller on less than 11v, nor try to run it at more than a couple hundred Hz.
 

Thread Starter

skot9000

Joined Jan 28, 2009
18
okay, that is good to know. I certainly won't use this circuit for any other projects requiring higher loads or higher frequencies.

I will likely be running this at 50% for long periods of time, and i definitely don't want anything failing.. do you think I should replace the flywheel diode with a higher current one?
 

Thread Starter

skot9000

Joined Jan 28, 2009
18
I did some measurement on the circuit and found that the voltage at the wiper varied from 8.51V to 1.81V. With this in mind I was able to remove the pot and the 3k resistors on either side and replace it with this LM317 circuit from the datasheet;

http://www.skot9000.com/proj/fountain/lm317.jpg

I used at 1.6K resistor for R2 and 10K pots which gives a voltage range of 1.25V to 8.43V out of the LM317 which worked nicely fed into the opamp of the PWM motor controller.

there are now 5 manually set, digitally controllable, presets on the PWM motor controller.

thanks for your help!
 
Last edited:
Top