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.
Showing posts with label accelerometer. Show all posts
Showing posts with label accelerometer. Show all posts
Friday, April 10, 2009
Thursday, April 2, 2009
Accelerometer calibration
In the case of this iPod Touch application, the screen is held at a comfortable viewing angle. It is seen however, that the ball runs backward and must be opposed with a force to keep the ball in a static position. Notice, that when the appropriate angle is applied to offset the ball to a static position the screen becomes unviewable with a glare from our current perspective. The iPod is placed on a desk to show the opposite affect.
Conclusion: Calibrate the accelerometer for the user during application start up. This allows the user to be in any type of position (laying down, sitting at a desk, standing, hanging from monkey bars, or anywhere else).
Subscribe to:
Posts (Atom)