Maker Pro
Maker Pro

Powering DC geared mmotor from cordless drill.

Hello all, I am trying to power a DC motor from my cordless drill and I
am having some troubles with it. First not that I have used two
different motors one rated at 14.4 V and one at 18 V. I am trying to
run the motor from a 120VAC to 15VDC adapter. When I do this, the
motor runs, but at very low speeds and torque. Any ideas? I know the
adapter is rated at 300 mA. Do you think the motor needs more current?
If this adapter will not work, how could I power the motor without
using a battery? I do not want to use an AC motor because I have found
speed control for DC mmotors is much easier that for AC. Anyway thats
it. Thanks in advance for any help. Lucas
 
C

Chris

Hello all, I am trying to power a DC motor from my cordless drill and I
am having some troubles with it. First not that I have used two
different motors one rated at 14.4 V and one at 18 V. I am trying to
run the motor from a 120VAC to 15VDC adapter. When I do this, the
motor runs, but at very low speeds and torque. Any ideas? I know the
adapter is rated at 300 mA. Do you think the motor needs more current?
If this adapter will not work, how could I power the motor without
using a battery? I do not want to use an AC motor because I have found
speed control for DC mmotors is much easier that for AC. Anyway thats
it. Thanks in advance for any help. Lucas

Hi, Lucas. I'll bet your adapter gets hot, too. ;-) Your adapter is
bogging down, and I'd guess you'll let the smopke out if you let it run
for any time.

Cordless drills require a lot more current than that. Your power
supply should be good for 2 amps minimum. Find a bigger adapter
(probably shouldn't use a switcher here -- you might come to grief with
an inductive load), or find a big 12VAC 4 amp min. secondary
transformer (rated at least 4 amps), and do something like this (view
in fixed font or M$ Notepad):

|
| SW1 12.6VAC 0.5 ohm 5 watt
| _/ FU1 Sec. .---. ___ +
| L1 o--o/ o-o_/ \o--. ,- |~ +|---|___|--o----o
| )|( | | +|
| )|( | | C1 ---
| L2 o----------------' '- |~ -|----. ---
| '---' | |
| BR1=50PIV(min), 6A(min) BR1 '-----o----o
| T1 = 12.6VAC sec. 4A min -
| C1 = 10000uF 25V
|
|
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

Don't forget the slow-blo fuse (3AG 1ASB should do for a transformer
this size). This will get you close enough to 15VDC at 2 amps --
you'll be controlling speed with PWM, anyway.

Speed control for the AC motors you mentioned in an earlier post is
very iffy at low speeds. Your cordless drill with PWM drive will give
you great torque at low and high speeds.

You haven't mentioned whether this is a project or whether you just
need something to run, say, a lab experiment. If you want/need an
inexpensive canned kit, you could look at the Velleman K8004
DC-to-Pulse Width Modulator.

http://www.vellemanusa.com/downloads/0/illustrated/illustrated_assembly_manual_k8004.pdf

It's a one IC solution on a board that can run your cordless drill
without any problems. If you're looking for a project, it might also
give you some ideas as to what a feature-rich solution (preset minimum
and maximum outputs, soft-start, adjustable frequency) would look like.
Look up the data sheet on the IC for more information.

Go Illini!
Chris
 
Thanks, chris, as always, you're tons of help. I like you ideas, and I
think i can get it to work. I am planning on using this drill to
actuate a long acme thread from a car jack to create a simple linear
actuator. I need to however, use my PC to PWM the drill. I have
already tested my idea on a small 3v DC motor and an Hbridge IC
(L293DNE). Anyway thanks for your help, Ill see what I can do with
that.
 
C

Chris

Thanks, chris, as always, you're tons of help. I like you ideas, and I
think i can get it to work. I am planning on using this drill to
actuate a long acme thread from a car jack to create a simple linear
actuator. I need to however, use my PC to PWM the drill. I have
already tested my idea on a small 3v DC motor and an Hbridge IC
(L293DNE). Anyway thanks for your help, Ill see what I can do with
that.

OK. One big difference between standard PWM and an H-bridge is that
you don't have bidirectional capability. You can use a DPDT relay to
do this (make sure your output duty cycle is zero percent (off) before
you switch:

|
| ||/ NC
| ||--------o -------.
| PWM+ /|| | |
| o----| | |
| C || NO | |
| ||-----. | / \
| || | | ( M )
| | | \_/
| ||/ NC | | |
| ||-----o--)--------'
| PWM- /|| |
| o----| |
| C|| NO |
| ||--------'
| ||
|
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

This will allow your lead screw to go in both directions. You should
use a good-sized relay in case of accidental switching while the motor
is on during development, or in the event of a power down situation.

Go Illini!
Chris
 
So, for the above circuit, would the PWM voltage be the driving voldage
for the motor? I don't think so, but I don't see where the driving
voltage comes into play. If my printer port is able to output 5 v or
so, i don't think that would do.
 
C

Chris

So, for the above circuit, would the PWM voltage be the driving voldage
for the motor? I don't think so, but I don't see where the driving
voltage comes into play. If my printer port is able to output 5 v or
so, i don't think that would do.

OK, Lucas. We're back to the printer port.

Well, if you're just interested in one speed, it should be fairly easy
to turn the Velleman PWM controller on and off (I believe there's an
unused Shutdown pin on the PWM chip you could pick off and use with a
reed relay). But if you want speed control of the motor too, you might
have a little more difficulty.

A lot of what you can do with the printer port output bits is dependent
on what else is going on with the computer. If you're using MSDOS with
a SPP, and you're not using the port for anything else, you can just
set it up for 8 output bits and 5 input bits, and modify things with C
inportb() / outportb() instructions, or whatever their equivalent in
the language you're using.

If you had this, you would be able to use a timing loop for one bit to
get a PWM output, and another bit to turn on and off an analog
transmission gate (you can't keep the DOS CPU timing loop going forever
-- there are undoubtedly other things to do). You could then use a low
pass filter and an op amp buffer to give your analog output to the
K8004.

|
| .-----------.
| | VCC |
| 1/4 4066 | + |
| | |\| |
| |\/| '---|-\ | +
| + |/\| ___ | >----o--o
| o---< |---|___|-o------|+/
|PRN |\/| 10K +|1uF |/| K8004
| |/\| --- ===
| | --- GND o
| | | |-
|PRN | === ===
| o---' GND GND
|
|
|
| o
| |
| ===
| GND
|
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

However, if you're using Windows, things get dicey right away. You
need drivers and a library for a high-level language that plays nice
with Windows like Visual Basic, and you don't have the precise timing
control you might have with DOS, just because the PC OS is trying to
get so many things done at once. It's an output port bit, not an
independent timer IC.

Given that, there are several options that will work well in a Windows
environment, especially considering you may not need very accurate
analog control (we're talking from the framework of the Velleman K8004
using analog speed control input here).

* If you only need a couple of speeds, you can have your output bits
drive reed relays, which would switch different analog input voltages
to the K8004. Each output bit from the printer port can directly
source current to drive a 500 ohm, 5V coil reed relay (be sure to get
ones with diodes across the coil). This is a good option if you only
need SLOW, MED, and HIGH speed, and one bit for shutdown.

* If you only have a few bits to spare and need a few more speeds, you
might want to consider using a 3-to-8 decoder IC, like a 74HC138 to
drive 8 reed relays (again, you should be able to directly source the
current to turn on the relays). 4-to-16 decoders also exist.

* Another option would be to have several bits driving a DAC. You
could also use a serial DAC IC, if you only have two bits to spare
(you'll need clock and data).

I'm also wondering if you might not be able to take advantage of some
of the I/O boards and other gadgets you probably have available,
instead of relying on the printer port. It's difficult to help when we
have to keep guessing here.

Feel free to post again with more information.

Go Illini!
Chris
 
W

Wildepad

I am planning on using this drill to
actuate a long acme thread from a car jack to create a simple linear
actuator. I need to however, use my PC to PWM the drill.

The others are far more qualified on the circuitry end of things, but
I'd like, if I may, to throw in my two cents on your project.

Long ago I built something similar but found several problems which
may or may not apply to your situation, most disconcerting of which is
that the screws and nuts lack precision -- even with a good stepper,
it was hard to repeatedly put the slider within 0.0625. With a DC
motor, starting at a slow speed while under load was always a problem.

Depending on how much travel you need, you might want to consider how
I handled it -- a trip to the local 'automotive recycling center'
(aka: junkyard). The electric motor and positioning unit from a power
seat was ideal -- high torque at low speeds, and surprisingly the rack
was far more precise than the jack screw. An added benefit in my case
was that the long drive cable (one of those that went the full width
of the bench seat) let me put the motor and electronics a considerable
distance from the working head. A rotary indicator on an otherwise
unused cable gave me reliable position feedback.

I'm afraid I wimped out on the control circuit -- my PC controlled a
small stepper motor that turned the knob on a switch taken from a
variable-speed tool. :)
--
 
Simply a question on the above power suply, why are my resistors
getting so hot? Im using two 1 ohm 5 watt resistors in parallel in
order to achieve the .5 ohm that you suggested, chris. Also, im only
using 6800 pf capacitor because that is the largest i could find.
Thirdly, I could only find a 25.2 V transformer, but im using the CT
wire to achieve the 12.6 V. Im sure one of my substitutions is causing
the hot resistors. Any help?

Thanks, Lucas
 
C

Chris

Simply a question on the above power suply, why are my resistors
getting so hot? Im using two 1 ohm 5 watt resistors in parallel in
order to achieve the .5 ohm that you suggested, chris. Also, im only
using 6800 pf capacitor because that is the largest i could find.
Thirdly, I could only find a 25.2 V transformer, but im using the CT
wire to achieve the 12.6 V. Im sure one of my substitutions is causing
the hot resistors. Any help?

Thanks, Lucas

Hi, Lucas. Power resistors are supposed to run hot -- much hotter than
transistors. It's a little shocking the first time you touch a hot
power resistor. You can run a power resistor at its rated wattage and
get a first degree burn and a blister from momentarily touching it.
But the suggested wattage was based on the assumption that your motor
is using less than 3 amps. Measure the resistors, measure your
voltages, measure the current. Use Ohm's Law to work it out, it's
simple. Trust your calculator.

If you're using a 25.2VCT transformer and a simple full wave rectifier
(2 diodes), make sure it's rated for at least 1.2 times your measured
DC current. For instance, if you measure 2.4ADC at full motor speed
and maximum load, make sure you've got a transformer rated for 3A or
more of secondary current.

|
| 25.2VCT
| Sec. +
| -. ,-------->|----o----o
| )|( | |
| )|( | |
| ) ,---. | |
| )|( | | ---
| )|( | | ---
| -' '---)---->|----' |
| | |
| | |
| '---------------o
| -
|
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)


I hope you meant a 6800uF (microfarad) rather than pF (picofarad) cap.
Just check your unregulated voltage at no load, and then at full load.
You also might want to try just shorting out the resistor, and seeing
if the no load and full load voltages are too high. If they're not too
high with the smaller filter cap, you don't need the resistors.

Go Illini!
Chris
 
Ok, I have all the bugs worked out but one. Im sure this is common
sense but the dpdt relay canm't really handlde PWM. Lesson learnde i
guess. I can turn the relay on with my printer port but trying to turn
the relay on and off so fast doesn't seem to work. Any ideas on what I
could use besides a dpdt relay?
 
C

Chris

Ok, I have all the bugs worked out but one. Im sure this is common
sense but the dpdt relay canm't really handlde PWM. Lesson learnde i
guess. I can turn the relay on with my printer port but trying to turn
the relay on and off so fast doesn't seem to work. Any ideas on what I
could use besides a dpdt relay?

Hi, Lucas. I guess I wasn't too clear on this. The relay is only used
for reversing direction with the PWM off to give you the capabilities
of an H-bridge driver, like you mentioned on Wednesday morning. You
would still need a PWM controller of some kind. A power relay isn't
going to be very useful over about 10Hz, and with an inductive load
you'll wear it out in minutes.

I already gave you several pieces of advive on how to go, with a PWM
controller IC, and you might want to reread the whole thread carefully.

For my part, I'd like to know

* what operating system you're using for the computer here

* what programming language you're using to exercise the printer port

* whether you're going to be doing anything else while you're moving
the motor,

* how much current your motor is using,

* what you decided to use for a power supply,

* and any other information you would care to mention, including
whether you're going to be graded on the project, or on what it's
doing.

Just trying to help here.

Chris
 
Sorry, I havn't been very clear on my project. Basically, I am trying
to make a spring coiling machine. I plan on using two motors, one to
spin a center metal rod and one to guide the wire lineraly. Right now
I am working on the linear actuator. Im using Microsoft Windows XP and
do all my programming in C. I don't think this part of the project
(the linear actuator) is going to carry that much of a load. The power
suply i made was similar to the schematic you showed me with a
transformer, some capacitors, some resistors, and a bridge rectifier.
The power suply works nicely. The drill motor can run at full speed
and i can even aply load to the drill and nothing seems to get too hot
nor does the slow blow fuse go out. This project isn't for a grade
although I may show my professor when im done. As for how much current
my motor is using, I don't know. I don't have an ammeter that goes
above 200 mA. Anyway, I hope that helps. Lucas
 
C

Chris

Sorry, I havn't been very clear on my project. Basically, I am trying
to make a spring coiling machine. I plan on using two motors, one to
spin a center metal rod and one to guide the wire lineraly. Right now
I am working on the linear actuator. Im using Microsoft Windows XP and
do all my programming in C. I don't think this part of the project
(the linear actuator) is going to carry that much of a load. The power
suply i made was similar to the schematic you showed me with a
transformer, some capacitors, some resistors, and a bridge rectifier.
The power suply works nicely. The drill motor can run at full speed
and i can even aply load to the drill and nothing seems to get too hot
nor does the slow blow fuse go out. This project isn't for a grade
although I may show my professor when im done. As for how much current
my motor is using, I don't know. I don't have an ammeter that goes
above 200 mA. Anyway, I hope that helps. Lucas

Hi, Lucas. Thanks for taking the time to answer some questions.

This sounds a lot like other kinds of winding I'm familiar with, like
winding resistors. Have you ever considered just letting the wire ride
on the top of the screw? That's an easy solution, and would work well
if you can establish and keep tension on the wire (which you're going
to have to do, anyway). If that doesn't do it, you may want to
consider having a clamp assembly riding on the screw (you'll need
stabilizing load-bearing runners for this).

Now if you're winding a spring, you'll need good coordination between
the winding chuck (turns) and the traverse assembly (pitch of the
spring). Gearing the two together is the best way of doing this, of
course, but it has the limitation of being a bit unwieldly, and is also
dependent on having a lot of different gears for different gear ratios.

If your spring wire isn't too bulky, you may not need all that much
torque to spin the chuck. One better way to achieve the coordination
between chuck and traverse would be to use two stepper motors. If this
is slow speed, you could then just punch in the two speeds, have the
motors take off, and slam to a stop when they're done. There are some
physical problems with this at speed (the dreaded mid-point resonance,
usually around 0.7 to 2.0 rev.sec), and also the torque capability of
the motor to bring the chuck or traverse instantaneously into motion.
This is doable (I've done it with steppers), but it's not as easy as it
first looks. It may be better to develop a motion profile to ramp
things up to speed.
From a project standpoint, I'd be very interested in knowing how you're
driving the chuck. Trying to get coordination between these two is
obviously a central part of the automation problem.

Let's get back to the traverse assembly, though. If you've got a
series resistor, you can always get the current just by measuring the
voltage across it, and then using Ohm's Law to calculate. Even a
cheapie DMM will give you an average voltage reading across the
resistor that you can use for sizing things and getting a first cut on
which transistor or MOSFET to use -- that's why I asked. Remember,
we're just guessing as to current at this point.

An engineering problem isn't like a puzzle, where the parts will really
only fit together in one way, and there's only one good solution.
There can be, and usually are many different ways to get a satisfactory
solution. That's one of the good things about s.e.b. -- different
people come up with different ways to skin the cat, and you sometimes
end up with a lot of different ways to get something done. Obviously,
if you have more information about a problem, it narrows things down
and reduces the chances of going down rabbit trails.

Mr. Gates' tens of millions of lines of code in WinXP make their own
demands, and a lot of them are fairly insistent. If you were running
DOS with TurboC or QuickC, and you weren't doing anything else while
you were running the motor, you could write a loop in assembler to just
turn the PWM power transistor on and off directly. A printer port bit
can easily source and sink enough current to quickly charge and
discharge a logic level power MOSFET gate.

But since your PC is busy, busy, busy, you're going to have to figure
out a way to set the speed and forget it while your PC moves on to
other things like watching the mouse and ripping CDs and playing SIMs 2
University in other windows. Also, setting and forgetting your PWM
speed may give your PC the chance to do other real-world parts of your
automation project simultaneously, like reading limit switches, a turns
counter, setting outputs and reading inputs, &c. So the best chance
here is fairly straightforward. You have to be able to set the PWM
speed indirectly.

Not a problem -- there are several ways of doing this. The classic
digital way is by using a preset on a down-counter, and having another
down-counter with a larger initial value. These are clocked
independently with a 555 or another method of getting a cycle time of,
say, 0.5ms. The first counter has further counts inhibited on zero.
Both counters are automatically reset by the carry of the second
counter. By ANDing the two, you can have a pulse width that's
determined by the length of the first counter.

The disadvantage of this is that you require one bit for every bit of
resolution of the counter. You can use data latches to share bits, of
course, but it still seems a bit wasteful of printer port bits and/or
hardware, unless that's all you're doing with the printer port. The
advantage is that you have precise control of speed, and your
resolution is basically dependent on how many bits you're willing to
throw into the pot.

There's another limitation with this setup -- unless you're using
precision feedback, you generally don't need very precise control of
motor speed. 6 bits of resolution (1 part in 64 of full speed) is
usually more than enough for real-world speed control of a motor.

Given that, you then might want to look at other, less bit-intensive
methods of setting and forgetting the PWM speed. Another classic is
generate a triangle wave or sawtooth wave ramping from near 0V to a
reference voltage and back, and then using a comparator to compare it
with an analog input voltage. PWM rate is set by the frequency of the
triangle wave or sawtooth wave. The comparator output can be used to
drive a transistor or power MOSFET. This is easy and straightforward.
One disadvantage is that there can be some difficulty getting the
sawtooth or triangle all the way down to zero with a single supply.
And of course, that the printer port only provides digital I/O --
you'll have to cobble together a digital-to-analog converter (DAC)
yourself. Either that or, as I mentioned above, you might just want to
run your motor on 3 speeds (LO, MED, HIGH) and use reed relays to
switch analog voltages to your PWM controller.

Now if you want to have a DAC from the printer port, there are a number
of serial DAC ICs available that can give you an 8-bit resolution
output. You can also use the "home brew" method of doing a
short-duration PWM output from a bit, and turning it on and off with a
4066 gate controlled by another bit as shown above. There are many
other ways of doing this, too. It's mostly dependent on your other
project requirements.

The PWM controller itself, as I said, can be a simple triangle wave
generator and voltage comparator (easily made from a dual comparator
like the LM393 and a handful of passive components). You can also use
an inexpensive one IC solution like the SG3525, if you want. It has
several features which might make your trip a little easier, including
voltage translation down to zero, a shutdown pin, soft start, and
independently settable min and max speed. Your call. If the
construction of the device is not part of the grade (in other words, if
this isn't a class project in EE), and you've got a few bucks, you
might just want to go with the Velleman kit based on this IC. You've
got everything right there, all you have to do is solder the thru-hole
parts on the circuit board, and you're good to go.

All of this stuff kind of indicates we've got a ways to go in firming
things up here. If you're using the printer port and you've still got
time (there are other easier canned possibilities here, including using
premade interfaces with the USB port like the LabJack which have
digital I/O, and ADCs and a DAC built-in), you'll have to evaluate what
you're doing. How many I/O of what kind do you need? What kind of
latency do you have on your process (can you afford to ignore it for
1ms., 10ms., 100ms., 1 second?). Are there any other special
requirements for your project? A good answer for your PWM may end up
hogging up PRN resources you may need for something else.

In general, trying to run real-time automation directly from Windows
has always had big limitations, which people generally try to avoid.
Many times, if a PC is required in an automation project, an engineer
will generally install a Programmable Logic Controller (PLC) for the
time-critical I/O gruntwork, and then connect the PLC to the PC with a
USB or Ethernet connection, to have the two communicate and have the PC
provide any necessary upper-level control functions (such as operator
interface, Statistical Process Control and interface with any
instruments).

This is starting to sound like a somewhat more complicated project. I
look forward to hearing from you. Feel free to email me.

Go Illini!
Chris
 
Hello again, here is what i've got. I took your advice and tried to
use a power MOSFET to switch on and off my motor using PWM. This idea
worked like a charm on a small DC motor, but when I hooked it up to my
power supply and drill motor i ran into some problems...It seems that
no matter what (rather my Prt port pin is set to high or low) the drill
motor runs. any idea why? here is my circuit.



12.6VAC 0.5 ohm 5 watt
FU1 Sec. .---. ___ +
L1 o--------o_/ \o--. ,- |~ +|---|___|--o------------.
)|( | | +| |
)|( | | C1 --- |
L2 o----------------' '- |~ -|----. --- |
'---' | | |
BR1=50PIV(min), 6A(min) BR1 '-----o------------)--------.
T1 = 12.6VAC sec. 4A min - o----. |
C1 = 9000 uF 25V | | |
.-. | |
Motor ( X ) - |
'-' ^ |
| | |
o----' |
___ | D1 |
-----|___|----------------. | |
| | | ||-+ |
| 100k .-. | ||<- PM |
| | | '----||-+ |
+5V from ------' | | | |
PC prt '-' 1M | |
port. | | |
---------------o--------'





Power MOSFET IRF510
D1 1N4001



(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

My MOSFET is heat sinked. One other thing that isn't in the circuit
diagram is that I am using an opamp to amplify my computer signal such
that I can initiate the power MOSFET. Any obvious problems? any help
would be great!


On a side note, i am an engineering student and the university. I am
in mechanical engineering not EE or CE so forgive my mistakes. I have
taken in intro course in electronics, but I think i have learned more
in the last few day than in that whol course, thanks to your patience,
chris.
 
C

Chris

Hello again, here is what i've got. I took your advice and tried to
use a power MOSFET to switch on and off my motor using PWM. This idea
worked like a charm on a small DC motor, but when I hooked it up to my
power supply and drill motor i ran into some problems...It seems that
no matter what (rather my Prt port pin is set to high or low) the drill
motor runs. any idea why? here is my circuit.



12.6VAC 0.5 ohm 5 watt
FU1 Sec. .---. ___ +
L1 o--------o_/ \o--. ,- |~ +|---|___|--o------------.
)|( | | +| |
)|( | | C1 --- |
L2 o----------------' '- |~ -|----. --- |
'---' | | |
BR1=50PIV(min), 6A(min) BR1 '-----o------------)--------.
T1 = 12.6VAC sec. 4A min - o----. |
C1 = 9000 uF 25V | | |
.-. | |
Motor ( X ) - |
'-' ^ |
| | |
o----' |
___ | D1 |
-----|___|----------------. | |
| | | ||-+ |
| 100k .-. | ||<- PM |
| | | '----||-+ |
+5V from ------' | | | |
PC prt '-' 1M | |
port. | | |
---------------o--------'





Power MOSFET IRF510
D1 1N4001



(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

My MOSFET is heat sinked. One other thing that isn't in the circuit
diagram is that I am using an opamp to amplify my computer signal such
that I can initiate the power MOSFET. Any obvious problems? any help
would be great!


On a side note, i am an engineering student and the university. I am
in mechanical engineering not EE or CE so forgive my mistakes. I have
taken in intro course in electronics, but I think i have learned more
in the last few day than in that whol course, thanks to your patience,
chris.

Hi, Lucas. Possibly your driving op amp is part of the proble. Many
op amps, when operated with a single supply, can't drive to the
positive and negative rail. For instance, if you're using an LM741 as
a comparator, the output voltages will be about 10V and 1.5V.

The low voltage might not be quite enough to turn the MOSFET fully off.
In addition, the 100K series resistor between the driver and the gate
ensures you will be dribbling a few microamps into and out of the gate,
which has a capacitance of several hundred pF. You might want to try
something like this (view in fixed font or M$ Notepad):

|
| VCC(12V)
| +
| | VCC
| .-. +
| 10 K | | |
| | | VCC .-.
| '-' + | |470 ohm
| | LM311 | | |1/2 W |
| PRN | |\| '-' ||-+
| o----)-----|-\ | ||<-
|(4V / 0V)| | >---o----o---||-+
| o-----|+/| | |
| | |/ | 100K.-. |
| | | | | | ===
| .-. | | | | GND
| 2.2K | | ===| '-'
| | | GND| |
| '-' | ===
| | === GND
| === GND
| GND
|
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

This circuit uses a comparator instead of an op amp. Its
open-collector output ensures an ouput voltage of less than 0.3V when
it's low, and 12V (through the 470 ohm resistor) when it's high. 25mA
of drive current is a lot better than 5 - 10uA.

I'd also replace the 1N4001 diode with a 3 amp diode like the 1N5402,
assuming you've got a motor load of a couple of amps.

Again, assuming you have a 2 amp load, your on-state power will be
about 2A * 0.5 ohms, which means 1 watt max. You shouldnn't need a
heat sink if you can keep the on-state V(ds) times the current less
than 1 watt.

By the way, please turn on the motor (just connect it from your power
supply to GND) and measure the voltage across the 0.5 ohm resistor.
Drive current is a really critical part of engineering a solution, and
you just have to know. You can use Ohm's Law to figure it out.

I hope this will help turn off your errant MOSFET. I would assume the
inductive kick is feeding charge through the drain-gate capacitance,
which helps to keep things on, too. Be sure to change your 1meg
resistor to 100K or 47K, that will help with that, too.

I remember the kick I got out of programming a printer port (a Kaypro
II running CPM) to actually read switches and turn things on and off
for the first time (no fossil jokes, please). It is a bit of an
experience. However, apart from the kewlness factor, I'm not sure what
this direct control of the PWM is going to do for you in a windows
environment. I believe you'll probably end up moving to another form
of PWM control when you're actually trying to program this.

Go Illini!
Chris
 
C

Chris

Chris said:
[email protected] wrote:
|
| VCC(12V)
| +
| | VCC
| .-. +
| 10 K | | |
| | | VCC .-.
| '-' + | |470 ohm
| | LM311 | | |1/2 W |
| PRN | |\| '-' ||-+
| o----)-----|-\ | ||<-
|(4V / 0V)| | >---o----o---||-+
| o-----|+/| | |
| | |/ | 100K.-. |
| | | | | | ===
| .-. | | | | GND
| 2.2K | | ===| '-'
| | | GND| |
| '-' | ===
| | === GND
| === GND
| GND
|
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

Actually, you can accomplish the same thing as this comparator with
just a transistor and three resistors, like this (view in fixed font or
M$ Notepad):

| VCC
| +
| |
| .-.
| 470 | |
| 1/2 W | |
| '-'
| | To MOSFET
| o----->
| | Gate
|PRN ___ |/
| o-|___|-o-|2N3904
| 2.2K | |>
| .-. |
| 10K| | |
| | | ===
| '-' GND
| |
| ===
| GND
|
(created by AACircuit v1.28.5 beta 02/06/05 www.tech-chat.de)

Go Illini!
Chris
 
FINALLY! Ok, I know its been a while, but i have figured out all the
bugs. The little transistor circuit above worked like a charm. I can
now power my cordless motor drill and control its speed with PWM. FYI
at full speed no load the voltage drop across the .5 ohm resistor was
..75 V. This means my motor pulls 1.5A. With a load, it pulls about 4
A. The next task is to measure the speed of the motor. I know that
using windows to do all this isn't the best idea, but i would still
like to try it. I have read about two different methods. The first is
to use some sort of encoder and infared diodes and measure the pulsees.
The problem i see with this idea is that it takes too much time to do
during the "off" time if the PWM. Another method i have read about is
measureing the back EMF from the motor durinmg the "off" time of the
PWM. Thiw would take very little time, but then again im limited to
255 bit resolution. This might not be a bad thing, however. Anyway,
any thoughts would be great. Lucas
 
C

Chris

FINALLY! Ok, I know its been a while, but i have figured out all the
bugs. The little transistor circuit above worked like a charm. I can
now power my cordless motor drill and control its speed with PWM. FYI
at full speed no load the voltage drop across the .5 ohm resistor was
.75 V. This means my motor pulls 1.5A. With a load, it pulls about 4
A. The next task is to measure the speed of the motor. I know that
using windows to do all this isn't the best idea, but i would still
like to try it. I have read about two different methods. The first is
to use some sort of encoder and infared diodes and measure the pulsees.
The problem i see with this idea is that it takes too much time to do
during the "off" time if the PWM. Another method i have read about is
measureing the back EMF from the motor durinmg the "off" time of the
PWM. Thiw would take very little time, but then again im limited to
255 bit resolution. This might not be a bad thing, however. Anyway,
any thoughts would be great. Lucas

Hi, Lucas. First, an immediate practical matter. If your highest
steady load is 4A, make sure you've sized your transformer and MOSFETs
accordingly. Above you've said your transformer is rated for 12.6VAC
sec. at 4 amps. If you're pulling 4ADC, your transformer should be
able to provide at least 7A sec (multiply DC load by 1.8 for bridge
rectifier/capacitor filter). Also, your IRF501 is riding right on the
edge. Maximum rated current is 4A over temp, and your 0.5 ohm Rds(on)
will give you 2V across the MOSFET, with a Pd of 8 watts (4A * 2V). Be
careful.

In measuring speed, you're not actually measuring position, which is
what you're actually trying to determine with the lead screw. Back EMF
is a measure of motor current, which might give you some indication of
speed, but only for a fixed load. Also, motor current and speed are
not linearly proportional -- you'll have to do some experimentation to
get a good curve, which is specific to your application, and can easily
be messed up by an additional frictional load (say, caused by bearing
wear).

I would guess you're heading down a fairly lengthy rabbit trail which
will eventually get you downfield, but not so much closer to where you
want to be. Your coils aren't going to look so good, mostly because
even if you get pretty good speed control, you're not going to be able
to coordinate between the two axes of motion. Not only that, but
you're inherently time-limited by the structure of your classwork.
Remember the unofficial NASA motto -- waste all but time.

This would be a very good time to take an hour off, grab a big
cappuccino at Starbucks, and do some perpendicular paper napkin
thinking about your whole project, the actual requirements, and how you
want to get there.

Let's assume you want to get this project done well with minimum
expense (think student church mouse -- been there and got the T-shirt).
I'd suggest that, if you really want to go with the printer port as
the primary control method, you might want to first drop Windows XP
;-), and get an old '486 desktop and laptop with MSDOS5 or 6.2X and
Turbo C++ for DOS, available for free download from Borland last I
checked (use the junker for development with a replaceable printer port
card, and then go with a laptop once your development is done). You
might then want to set your printer port to SPP in the PC CMOS.

I'd also look at using stepping motors instead of DC motors, primarily
because the positional feedback you need is the actually the biggest
fly in the ointment. A big advantage of steppers is that, unless you
overtorque them and they lose steps (they complain fierecely and
audibly when you do that, and it's not too difficult to determine
electronically if it happens), you have automatic control of exactly
where the motor is at any time.

You can fairly easily cobble together a high power stepper motor
translator/driver from a few 4000/4500-series CMOS ICs and several
logic level power MOSFETs, so all you'll need is an indexer step pulse
and a direction signal from your printer port for each axis. Four bits
for two axes of motion control -- hard to beat. You can use the PC
timer to periodically interrupt if you want to do a two-axis
trapezoidal move. Precalculate, of course. Either that, or you can
purchase or program a microcontroller which can do a two axis
coordinated trapezoidal motion profile, and you can then control the
motion with high-level commands from your printer port or serial port.
With a couple of microswitches or prox sensors for home position,
you'll be good to go.

Actually, the two step pulses and the two home inputs are the only ones
that are time critical. The direction signals and all the other inputs
and outputs (including the rest of your project -- I'd assume you've
got control buttons and other inputs and outputs?) can be done with
serial-to-parallel shift registers, which you should be able to do with
a few HC chips, depending on the number of innies and outies. You can
get 8 innies or 8 outies per IC. Automatic SPI serial interface, which
you can easily implement with the printer port bits left over.

If you're interested in doing this right, I would also recommend
looking into optoisolating the computer port bits from your automation
project. This is important to prevent inadvertent high-current ground
loops from wreaking havoc with your PC. For the price of 13 H11L2s,
you can buy yourself a lot of peace of mind, as well as 8 optoisolated
output and 5 input bits.

If you'd like more information, feel free to post again.

Good luck
Chris
 
Top