Need real PWM
PCB4U
Posts: 14
Hi Folks,
I want to use a STAMP to do the following:
1. Use 2 inputs to count pulses (optical encoders) from 2 motors (master, slave). The master is free running, the slave to be controlled by PWM techniques.
2. Find the differences in counts between the 2 inputs
3. Determine which input was greater than the other
4. Using magnitude of item 2· and the results of item 3,·determine correction factor
5. Output a true·PWM stream to·drive the slave motor (via a MOSFET) that is either running·too slow or too fast so that·the slave·will be·at same RPM as master
Is it possible??
Thanks for any help
Jay
I want to use a STAMP to do the following:
1. Use 2 inputs to count pulses (optical encoders) from 2 motors (master, slave). The master is free running, the slave to be controlled by PWM techniques.
2. Find the differences in counts between the 2 inputs
3. Determine which input was greater than the other
4. Using magnitude of item 2· and the results of item 3,·determine correction factor
5. Output a true·PWM stream to·drive the slave motor (via a MOSFET) that is either running·too slow or too fast so that·the slave·will be·at same RPM as master
Is it possible??
Thanks for any help
Jay
Comments
I would look at the parallax "industrial control" course.
You can download the book for free. Just search for industrial control.
It uses a heater to keep a constant temperature, but it's the same idea. When the temperature goes down the stamp will give the heater more power. When the slave is too slow the PWM increases.
The 2 motors will be adjusted once at turn on, each time the device is turned on. This will "calibrate" the 2 motors. They do not have to remain "synced" thereafter as the resultant error will be very small at this point. I am assuming that the "calibrating" of the free spinning motors, once matched at no load, will be pretty well matched under very similiar loads for each motor.
I think I may have to do the following.
1) Measure the differnetial pulse count of the master and the slave
2) Conver that to drive the slave factor via a lookup table or formula (can the STAMP have a lookup table due to internal limitations?)
3) Output the factor digitally, paralllel, into a D/A
4) The D/A ouput will drive a DC voltage to PWM circuit using a DG3525 chip which will drive the slave motor as required
Regards,
Al Williams
AWC
http://www.awce.com
·
I wouldn't be so sure about the speed staying matched under load...
I would measure the average current going to each motor and try to keep that equal while in use.
If one motor is trying to go faster it will draw more current as it "pulls" the other motor along.
Terry
The PAKs sound interesting.
I need to look at 2 sets of pulses coming off 2 encoder wheels, compare the two and adjust the slave to match the master which remains fixed at whatever native RPM its at.
The differnetial·should be PWM as this would ease the hardware requirements. As I think about it more, the·2 motors should be constantly be updated to keep them best synced as possible. I don't think monitoring current will guarantee syncing as each motor would have to be identically·constructed....and I'm sure gear head motors from afar aren't!!!
So in the end, I need a chip that can do a differenttial pulse count (via hardware or software) and will generate a PWM as a function of the differential. I don't know the microcontroller world very well.
Thanks again
·