-
1Gather Parts
Nearly any four op-amps will serve in the role of the 324. I used a quad-pack to save a bit of space on the breadboard. Use whatever is handy. Whether it is a 324 or the latest micropower rail-to-rail model, the circuit can be adapted to work with it.
I chose TTL over CMOS for the flip-flops, mostly because I have lots of TTL. 74C/74HC would be a good substitute. If you have 4013s, the 5V regulator and a few pull-up resistors can be removed. Keep in mind, you may need level shifting in a few places.
The output needs a bit more customizing, depending on your steppers. The 358's output current is a bit limited, so discrete transistors will limit the output to somewhere around 0.5A at about 7V RMS with a dual 12V supply. Darlington transistors will all but eliminate output current limitations. The output voltage will max-out at about 9V RMS with a dual 15V supply.
The most exotic part is probably the 4066. Still, it was sold at Radio-Shack. Just rummage around, you'll probably find them still in their original blister package. The 4016 can be dropped in without changing the circuit.
-
2May your oscillator oscillate
The first steps only need 5V, the source is up to you.
Next, find a 2.0V zener diode. Or do what I did, use a LED that has a forward voltage drop around 2V at 10mA. This LED will become the virtual ground for the oscillator. The asymmetric power supply for the LM324 is intentional, allowing for nearly equal positive and negative voltage excursions before clipping sets in. The next LEDs you'll need are a pair that drop about 1.8V at just 1mA. This pair limit the oscillator's output, keeping it out of clipping.
When the oscillator is ready for testing, hit the power switch. Check that LED (D1) for 2V, +/- 10%. (The oscillator sometimes takes a few seconds to start up.) Now check the sine and cosine outputs. If there is clipping R2 and R3 can be adjusted to compensate, or you can try some other LEDs. Both sine and cosine signals should be very close in amplitude.
If your oscilloscope supports X-Y mode, set both inputs for the same volts/division and put the probes on the sine and cosine outputs. You should see a circle. A flat spot means that there's still some clipping. A diagonal ellipse could be either an amplitude problem, or the scope inputs are mis-set. Depending on which probe is on which signal, the circle could be drawn clockwise or counter-clockwise.
While we're here, check the inverted cosine output. Channel-invert the input and overlay it with cosine, the signals should match.
-
3Windows
3a) The ring modulator has a phase shift on its input, if you run the oscillator at a frequency other than 15Hz, you will need to adjust R10,R11, C102, C103. You want to the sine and cosine at the same time the ring modulator's output zero-crosses.
3b) Next up is the window detector. It has to do a few things TI tells us to avoid, like using a breadboard and applying a slowly varying input signal. Adding hysteresis didn't help enough and it delayed the timing of the output pulses. The solution was to use low value resistors for the input and put capacitors across each input pair.
Not much to check here, there should be a pulse where the either the sine or cosine crosses the axis and that it isn't oscillating or ringing. Keep in mind, there are two different 'grounds' in use now. The sine and cosine signals are referenced to AGND, while the WIN signal is referenced to Gnd.
-
4Easy, peasy
If there are substitutions made logic families or analog switches, check that unused inputs are tied to one rail or another and that logic level thresholds are respected. Logic chips can act erratically, if an input isleft floating. 74LS isn't guaranteed to properly drive a CMOS input, so a pull-up resistor is needed.
-
5Power Outputs
Three circuits, all alike? It would be nice but op-amp, transistor, and motor choices will conspire to make this step the biggest headache of the project.
WARNING: We've reached the step where parts can be smoked quickly. Trust me here, DO NOT connect the motors just yet.
Output gain is set by R?. Oh right, annotations. I'll go fix that, but first is the reason to not connect the motors: There is a DC offset, when in RUN mode that must be removed.
-
6More Power
Annotations made and schematics uploaded. The gain controlling resistors are R217, R227, R317, R327, R417 and R427. For proper operation R215, R225, R315, R325, R415 and R425's should be changed, too.
If the gain is to your liking, let's kill that DC offset. To see the offset, you'll need to switch on an ouput. Just tie a Run/#Stop input high, eventually a WIN pulse will come along and clock the flip-flop. Check the DC voltage at the emitters of the output transistors. Some meters may not be happy about the low frequency AC, and not give you a stable DC reading. Shut down the oscillator by removing C_Osc2.
R204, R205, R304, R305, R404 and R405 form voltage dividers that apply a voltage equal to the analog offset voltage, when their respective logic gates are high. If the voltage between AGnd and Gnd is 2.03V, you'll need to match the divider's voltage to this. The greater the output amplifier's gain, the better this voltage match must be. Ideally, you want 0.0V at the emitters, realistically 100mV or less is great.
R218, R228, R318, R328, R418, and R428 are needed by some op-amps to eliminate cross-over distortion.
-
7Got root?
If you've built the parallel interface, this will be the only time you need root. Add a generic text-only printer to your system, attached to a parallel port. I've named mine CNC.
Power up the controller, then type this command:
echo -n "1" | lp -d CNC -o raw
The X axis should start spinning, while Y and Z will be stopped.
echo -n "0" | lp -d CNC -o raw
Will turn off the motor.
echo -n "10" | lp -d CNC -o raw
Starts the X axis, take one step and then stop. Four steps, in reverse, and then stop on the Y axis looks like this:
echo -n "::::0" | lp -d CNC -o raw
Having fun?
-
8Plotting
Download Motor_Printer_2.rb from the "Files" area, then modify the items in the SETUP section to reflect the specifics of your system and hardware. (The uploaded file shows 1.8 degree/step motors on a 20 thread per inch screw with the data to be sent to a printer called CNC.)
If you're using KiCAD, you'll first Gerber plot your circuit to a file. Check the file for G36-G37 blocks, remove them if they're present. Those blocks are created when "Fill zones" are used. Now load the modified file in Visolate and twiddle with the settings until you're happy, then save the G-Code.
Run Motor_Printer_2.rb with your G-Code file as the input and a temp file as the output. If there's an error, send me a message. If not, running the app without an output file will send the output directly to the print spooler, and things should start moving.
Time to go build another axis, or two.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.