This functions as a proportional controller for our motor driver included with our ME 405 kits. This controller will be used to regulate the response of the motor. It will be the users responsibility to designate the gain to receive the response that they want.
This class was built to function with the NUCLEO, motor driver, and encoder. The user will designate the location (setpoint) they want the motor to stop by designating a number of encoder ticks to stop and how fast they want the system to reach that location. WARNING: The response of the motor is gradual and should not be expected to reach the designated point instantly. We want to manage this by creating a closed-loop controller. For now, this class will be given a Kp value to to keep constant throughout the process of running the main code (main.py). Since this class also acts as the closed-loop part of the response, it will add the setpoint to the encoder ticks measured by the encoder and will multiply that result by the gain, Kp.