This project demonstrates how you can control a stepper motor over USB using a special software. The motor is driven by a PIC18F4550 running with full speed USB interface at 48MHz. The software for the computer was written in Delphi and the code for PIC was written in MPlab. The source files are provided so you can make any adjustments needed.
Jason writes:This entry shows the configuration I used to make a NMB (Minebea Electronics Co.) PM35L-048, 24VDC, 9.4 Ohm unipolar stepper motor work. I salvaged several of these motors from some Xerox inkjet printers. The motors were labeled well and I found manufacture specifications on-line. I was not able to find a wire diagram so I defaulted to making a truth table as I had done for unipolar steppermotors. Most steppers with 4 wires can usually be identified as bipolar stepper motors, which can be driven with a dual H-bridge IC such as the SN754410 by Texas Instruments.
This project was developed as an inexpensive way to drive small dc brushed motors as positioning servos for use on a desktop sized CNC machine. The board is interfaced to the PC through 2 pins of a parallel port. The drive signal on these pins is known as quadrature drive. The power stage consists of a power op amp driven in constant current mode. The internal PIC processor ( a 30f4012 from Microchip ) is programmed in C through the C30 compiler and the Microchip IDE. The servo loop parameters are programmed through a serial port connection and are saved in the dspic eeprom.
Once set for a particular drive, they should not need to be changed. The serial programming interface is used to tune the PID and other servo loop parameters to optimize the performance in a particular application. The serial port runs at a fixed baud rate of 9600N81. Any terminal program such as minicom, gtkterm, or hyperterminal may be used to talk to the dspic-servo.
PIC30f4012 DC motor controller: [Link]
This motor speed controller powered by the PIC16F873 detects and controls the rotational speed of the motor. When lower than the specification speed, it increases a control electric current. When higher than the specification speed, it reduces a control electric current. It is possible to use when wanting to keep constant speed even if the load to the motor changes.
Stepper motors are a very powerful, yet accurate type of motor. The ability to ‘step’ through motion instead of to run uncontrollably like dc motors do is a great advantage. This write-up shows you how to use an L298 to control a stepper motor.
L298 stepper motor controller: [Link]