Friday, April 10, 2009

Accelerometer and motors functional

Today we accomplished both the accelerometer and motor control with an H-bridge.

The accelerometer was tested by writing an interrupt service routine (ISR) that samples eight values from each of the X, Y, and Z vector directions. This was to ensure that the sampling frequency was great enough and was not being slowed down by other programming tasks. After the total of 24 values were recorded into the X, Y, and Z arrays, a function is called from the ISR that disables interrupts (so that new values do not alter this test) and prints out the collected results on Hyper Terminal. Once all of the values are printed, interrupts are enabled so that this process continues indefinitely.

Motors operate independently with pulse width modulated waveforms sent to the H-bridges. The regulated 5 V power was removed from the H-bridge so that the motors now revieve the full 9.6 V of power.

No comments:

Post a Comment