Wednesday, 29 February 2012

LAB 4: PID Controller

This lab has been completed by 'Huan Li' and 'Aidin Mirsaeidi'

1. What is the difference between polling and clocked I/O? What does it matter?

Polling: CPU would wait until the routine currently being executed is finished, then goes on to the next routine. Simply it's a busy wait.
Clocked: CPU can do some other task and branch to some other routine whenever some interrupt comes

2. Making a PID Controller:

Using the code modification steps provided along with the PID Library, the video below demonstrates the controller we built using the Twiddler. This controller ensures the encoder goes back to the 'zero' position in response to a user's step input.

http://www.youtube.com/watch?v=v_ByKu7ZRXw&feature=player_embedded

3. Virtual spring on Twiddler

We can compile and run the sample code provided in Twiddlerino_EncoderPoll.ino, we can observe that the spring is unstable and needs a more robust control

4. Implement a virtual wall

In this video, we can see that Tcmd becomes zero if the rotation is not in the direction to the wall, and hence there is no spring affect.

5. Now we impelement this as a PID controller:

http://www.youtube.com/watch?feature=player_embedded&v=v_ByKu7ZRXw

The key to formulating an appropriate conrol law is to experimentally find appropriate gain constants, Kp, Ki and Kd. We tune one parameter at a time to find the effective gain constants.

6. Increasing the sample rate does not have much effect, however reducing the rate would result in instability since the feedback is much delayed and the system lags.

Wednesday, 15 February 2012

CPSC 543: Project, 1st Iteration

Scenario:

Megan owns many different kinds of plants in her home and she is very careful to treat her plants with care. On a typical day, she gets home and she is planning to run some errands: message a couple friends, clean the kitchen, cook dinner, etc.

For some reason, she is not too worried about her flowers...Because in the back of her mind, she can hear her flowers breathing. Not too while ago, she purchased a central haptic device through which she can feel her flowers and ensure their well-being. This device allows Megan to have that peace of mind and check up on her flowers in a non-impulsive/distracting way. Because again, she knows 'she can communicate with them'. Through this device, Megan can hear her plants' breathing, see how warm or cold they are and also assess the plant's mood based on their aliveness. Megan has complete control over her plants' well-being.....