Lab 2: Closed-loop control for linear and rotational motion
The goal of this experiment is to implement two closed loop control systems for the rover:
- Linear motion control
- Rotary motion control
Suggested tasks:
Linear motion
- For the linear control, write an Arduino program to implement closed-loop proportional control for linear motion. The duty cycle of the PWM is to be proportional to the error between the desired position and the actual position (the average of the two wheel rotations, compensated, it necessary, using the data from Experiment 1. Both motors are to move in the same direction.
- Investigate the effects of different scale factors and verify that the results are consistent with theory�response time, overshoot, etc.
Measure the actual position with an accurate ruler; consider attaching a felt tip marker to the rover and record the actual displacement. Alternatively, ink the wheels with a stamp pad and do the experiment on a large sheet of paper taped to the work bench. - Modify the program to add integral control. The integrator output should be a static variable. Investigate the effect of integral control, using varying integral gains. Compare with theory.
- Modify the program to add derivative control and investigate the effects of different gains.
Rotary motion
- Repeat the above tasks for rotational motion. The angle of rotation is proportional to the difference of the two counters. The motors should be driven in opposite direction.
Note: The Arduino should be programmed to reset the counters at the beginning of each run.