BLDC Motor Control with NU32 micrcontroller and DRV8835 H-bridge motor driver
One of the fundamental aspects of robotics is motor control. This project uses the PIC32MX250F128B microcontroller mounted on board the NU32 board and a MATLAB-based GUI for the desired angle for the motor.
The controller uses two feedback loops:
The output torque of the motor is directly proportional to the current. Therefore, we change the amount of current in the motor to control the torque and speed of the motor. This process can be done by seeing that the duty cycle of a PWM signal corresponds to the desired torque. The MAX9918 current-sense amplifier is used to read the current at any given moment—specifically, it reads the current at 5kHz for the control loop, and a PI controller is implemented to set the right duty cycle.
A PID controller is used for position control. It uses encoder information to determine how far the motor is from its desired position and calculates the required current needed to bring the motor to that position.