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