A Stepper Motor Controller based on a PIC16F887 microcontroller. The controller can move the motor in both directions, at 10 different speeds and has programmable limits for working between two points or removing the risk of driving the table/leadscrew too far.

This is fitted to my X2 milling machine and the intention is to eventually re-programme the controller to work two axis and possibly three within the single controller box.

TablePosition is current read in steps but I hope to convert this to distances soon. I had provisioned for this but sadly the 16F chip can`t cope with floating point numbers which I think is needed – I may have to upgrade to a 18F4520 chip.
Speed is currently set in 9 preset speeds – the one shown in the video is medium and fast, there is a much slower speed for finishing cuts and such. I hope to improve the speed controller to work off a pot, using the ADC on the PIC.

Brief Instructions to Use:
Central Green LED – flashes to show controller in ON
Left Blue LED – lights when motor is moving
Right Red LED – Lights when in memory mode when we can move beyond limits and programme them

Button Left-Green = Table moves left
Button Right-Green = Table move right
Press Red-Stop = Table Stops
Press Speed = speed scrolls between 0-9 (preset at 5 on PIC startup)

Limits are preset at startup to +10,000 and -10,000 steps,
To Set Limits:
Hold both Black buttons, RightLimitSet and LeftLimitSet together and release (the ones next to each green button) – controller goes into memory mode.
In memory mode movement is not restricted by limits. At any current table positon, either, left memory or right,memory button alone can be pressed to set the associated limit.

Moving between limits::
Hold LeftGreen AND LeftMemory and release – table moves to the left, hits the left limit and moves between the limits continuously.
Hold RightGreen and RightMemory and release – table moves to the right, hits the right limits and moves between the limits continuously.

Any advice or comments appreciated.