Friday, October 16, 2009

Lab 3 - Virtual environments


Virtual Spring:

Implementing a virtual spring environment was the equivalent of adding a feedback loop through the whole motor system to do position controller. With the proportional control, the controller force is simply directly proportional to the displacement from equilibrium, just as a spring is. Therefore, this virtual environment was working once we got our position controller functioning. A (sideways) video shows below that the force was indeed a function of the armature displacement.



Virtual Damper:

Implementing a virtual damper was done similarly to the virtual spring. The only difference was that the controller force was proportional to the derivative of the position signal rather than the position itself. Since we only had access to the Hall effect sensor signal, to get the derivative we had to perform numeric differentiation in the Arduino software. By taking position measurements of θ1 and θ2 at t1 and t2, the derivative is estimated by:
The controller force is then proportional to this value in the opposite direction.

In practice, we were unable to get an effective damper working. The Hall effect sensor only had a range of roughly 20 values over the range of the arm movement and would continually fluctuate, even when the arm was held perfectly still. This translating to the controller thinking the arm was perpetually moving back and forth violently and so its corresponding response caused the arm to vibrate significantly. Furthermore, if the controller gain was too high, the vibrations would be amplified, resulting in an unstable system. The net result was that when we ran the motor with a low enough gain to be stable, the response to our input movements was not high enough to be felt significantly stronger than the continual vibration in the system.

Virtual Mass-Spring Attachment:

The final virtual environment involved simulating a mass attached to spring that was also virtually connected to the motor armature. The equation modeling this environment had been worked out in the homework and we simply needed to translate it into the Arduino code. The end result worked by tracking the force on the virtual mass and integrating it twice to obtain its position. The position was then compared to the armature position, defining both the torque on the armature and the mass at the current time step.

By tuning the values of the mass and spring, we were able to get a good response in the motor that could easily be felt. The most intuitive settings were a relatively high value for the mass and a low value for the spring stiffness. This led to a high oscillation time period, during which the trajectory of the mass could very clearly be felt in the armature as it both stretched the spring out to maximum displacement and crossed over the center point, switching the torque direction.

No comments:

Post a Comment