⟵ back to

Lab 4

This lab was challenging but insightful, I was able learn a lot about PID control and how it affects the Haply. I found this lab difficult because the Haply would often lose control and become unstable as I was testing it. I was using the Haply in an office environment around other people and the noise was quite loud.

Link to the code

1. P Control

This control felt similar to the haptic feedback from the previous 2 labs. As I increased the P amount, it felt like the end effector was becoming more strongly draw towards the target, very much like a magnet. Changing the target parameter caused the effector to quickly jump to the new target with almost too much force. I noticed when the effector got close to the target it would often perpetually overshooting and jitter around the target which as shown in the left video. I was unable to keep the system stable without holding the effector.

2. PD Control

This control felt similar to the previous. I found reducing the exponential filter helped somewhat with the system's stability. The end effector still felt jittery when it got closer to the target (I still needed to hold effector), but I felt it was a slight improvement from before.

3. PID Control

This control made the most noticeable difference and the system felt stable. I was having problems with the force drifting from the target, but when I reset the integrator, the effector snapped right to the target. I needed to do this a few times after changing different positions. The system felt more "snappy" and the movements more linear than elastic. With the P and PD control, the system would move too fast near the target, but the PID control seemed to resolve this problem.

4. Path Tracking

I chose the target to move horizontally back and forth according to a sine function because I was curious how straight of a path the effector could maintain. I noticed the effector would sometimes vibrate when I moved it against a straight wall. The result still had some jitter but was able to operate without me holding the effector, which I considered the most stable system so far. I feel that friction on the surface task space could cause this jitter, which I've noticed throughout the labs. The surface has some friction which I think influences of the behaviour of the system to being less stable.
In this tuning, I only had to hold the effector with the tip of my finger very lightly. After experimenting with different target speeds, I found any faster speed in the left video makes the system unstable. I found holding the effector adds additional friction and while it can stabilize the system, it makes the local effector movement more jittery.

5. Delays

Increasing the controller delay (left video) created an interesting movement that reminded me of Lab 3 when I was trying to simulate the feeling of a bird in flight. The movement felt "stretchy", like a loose spring trying to find a target that was moving too fast for it to catch up. I think the delay could be used as a design parameter for organic or smooth movements. I confirmed this as as I varied the delay. A large delay could create the "stretchy" movement then returning to the normal delay would prevent the system from becoming unstable.
I also found lowering the delay (left video) from its default value made the system feel even more "snappy" but seemed to amplify jitter. I think there might be an ideal delay that is not zero, perhaps due to how the derivative and integrals are calculate with respect to the limitations of the program/computer, such as with floating point precision.
Overall, I found this PID program very useful for getting a feel of the components in a PID controller and their effect on the system. I need more practice and refinement to be able to incorporate these learnings into my group project, but I definitely see how PID can be useful. I want to revisit my use of TouchDesigner from Lab 3 to try again to implement a PID controller in the program, because I now realize how important and sensitive the correct parameter tunings are for the stability of the system.

© Derrek Chow 2022