Friday, April 12, 2013

Launchpad and Stepper Motor

Stellaris Launchpad and Stepper Motor

The Texas Instruments Launchpad series is awesome. For around $15 delivered to AU you get a micro controller with jtag debugger. Together with a recently an Arduino kit that contained a heap of goodies, a mini project was born. You can see here the hooking up of a stepper motor via some open collector drivers (green board). The direction and speed is controlled using the buttons on the red pcb. It is a Stellaris Launchpad and it has a Stellaris LM4F120H5QR 32 bit micro controller.

This was not a bare metal job, the OS that was used was TI RTOS (very similar to SYS/BIOS). Of interest was the chip's PWM timers and it was hoped that they could be used to send the sequence to the stepper motor. This did not work too well when trying to synchronise them and change the speed. Eventually this was dropped in lieu of one timer configured to fire off an interrupt every time a signal needed to change.

Rather than polling the buttons (to deal with de-bounce), an interrupt was configured for each button. The interrupt routine along with setting the new target speed would disable the interrupt. In the background a timer task would go through and enable the interrupt once 100-200 ms had elapsed.

The micro controller runs @ 3 V, and fortunately this was enough to drive the open collector drivers so that 5V could be supplied to the stepper. The micro controller has some 5V tolerant pins and that is going to be useful.


Here is Louka playing with the buttons, she suggested that it could be used as a tail.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.