Wednesday, October 21, 2009

Lab 4 - Virtual Spring v2.0

With the newly magnified analog signal coming from the hall effect sensor, coupled with its increased sensitivity, we were able to get a range of just about the full five volts into the Arduino.

For the virtual spring, we implemented a detent such that there existed an equilibrium in the middle of the armature space, and there were virtual springs on either side of the middle. The force was calculated as a neutral position minus the current position multiplied by a gain (acting as a spring constant). The sign of the force was translated into a direction (HIGH or LOW) into the dir pin of the H-Bridge, while the absolutely value was directly translated to an output PWM.

The new virtual spring was very smooth (when the serial window was not open--unfortunately leading to a lack of graphs). Furthermore, a work-around in the previous lab to calm the action of the armature was to add a "dead-zone" at the equilibrium point where no force, however small, would be induced, and then take the square-root of the force calculated to eliminate some non-linearities in the signal range. The fidelity of the current set-up was superior and so neither one of these work-arounds had to be implemented.

No comments:

Post a Comment