Coursework - Arduino Motor Controller - Tasks
Introduction
To assess the competences what you have done so far will be sufficient to prove knowledge. The following tasks will contribute to application.
Task C
In Task C, you will calculate the speed of the motor acquiring the encoder signals, and display the motor speed as RPM and motor states (Halt, Forward, Backward) from TASK B, on the serial monitor. If in doubt check previous activities or ask.
Another important piece of information to calculate the motor speed (RPM) is the gear ratio. To help you calculate this, you can use the motor datasheet here or similar depending on the gear ratio of your motor.
Additionally, you will need to use the encoder library. This page will help you to receive encoder signals in your program.
Task D
You will combine taks B and C (or serial monitor or other inputs) to change the motor speed (0% = 0 speed, 100% = maximum speed). You will display the motor speed in RPM, trimmer value and motor states (backward, halt, forward) on the serial monitor. You can use a switch, button or the serial monitor to give direction signal to the motor. You can learn how PWM works by doing the example found here.
Task E
No PID library are allowed
You will improve Task D by implementing PID motor control. You will demand a certain target position to the motor using the trimmer values or other input methodology. The motor should then move to the target position and stay there, even under perturtations. Target example trimmer, 0% = -180°, 50% = 0°, 100% = 180°. When you rotate the trimmer, the motor shaft will rotate, and the motor shaft will settle at the given angle value. You will adjust the overshoot and the steady state of the signal provided by the trimmer by changing the PID constants. You will display the motor speed (RPM), target position and actual position on the serial monitor. You can cut and paste these data to generate better plot on excel.