Tuesday, 23 August 2011

Stepper motor controller with jog function

This is a PIC18F4550 and a ULN2803A darlington relay controlling a stepper motor.
The PIC provides a USB interface to the host PC, allowing you to send a specific number of steps and a rotation direction. The motor can also be turned using the "forwards" and "backwards" jog buttons.

The noise in the video is not rowing neighbours, as suggested by some viewers, but a Radio4 play and my partner on a sewing machine in the other room!


In this example, I'm using a 1.8 degree stepper motor. I'm driving it using half-step rotation, so one rotation = (360/1.8)*2 = 400 steps. You can see this value being entered into the USB/HID app on the laptop - 400 as two bytes is 1(HB) and 145(LB)
Working this back, 1*255 + 145 = 400

When the "send data" button is pushed, the stepper completes one single, full rotation.

No comments:

Post a Comment