Program Flow
Basic Workflow:
Firmware is present in affbotics_software/firmware/avg/BLDC_driver/src/main.cpp
- BLDC driver board communicates using Modbus over RS485
- The Modbus I registers
0x2000can be Writen with a value from -200 to 200 for setting the velocity of the motor. - Where -ve values spin the motor in the opposite direction
- comment the line
#define IAM_LEFTfor Right motor or leave it uncommented for Left motor
Am a Geek:
- Modbus Register address and
SLAVE_IDcan be changed by changing#definevalues - Motor PID values can be tweaked if needed using
motor.PID_velocity.P, motor.PID_velocity.I, motor.PID_velocity.D - change the phase angle
motor.P_angle.Pand directionmotor.initFOC(0, Direction::CW);if required.
No Comments