Showing posts with label Stellaris Launchpad. Show all posts
Showing posts with label Stellaris Launchpad. Show all posts

Tuesday, April 16, 2013

Kalman Filter

Kalman Filter

The Kalman filter is pretty straight forward filter that seeks to turn noisy measurements into not so noisy measurements. It does so by combining the observed measurement with a predicted measurement.

The blue line is the raw gyroscope measurement of the X axis. The red line is the Kalman filtered version.


This was just the sensor sitting on my bench, so the prediction model is trivial. That is the predicted gyroscope value is the previous gyroscope value.

Once the gyroscope is mounted on the robot the model will be based upon the model described in earlier post.

Stellaris and Gyroscopic Sensor

I've kind of settled on the Stellaris simply because of its 5 Volt tolerant pins.

A fair bit of effort was spent into integrating the gyroscopic sensor to the Stellaris. The problem ended up being the drive current from the micro controller was too low and was intermittently failing (i.e. the sensor was either not getting the command or getting the wrong one). On the Stellaris, you can set the drive current. The default was 2mA. 4mA seemed to work fine. So I am using 8mA to be sure to be sure.




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.