The solution to the problem of Motor interface damage
One of the flexibility of OpenRE is the quick and easy configuration of hardware resources. Our main control board has four motor ports. When one of our motor ports is damaged, we can use other reserved motor ports that are not occupied.
The specific method is shown below:
1. Change the makefile
Enter the folder .../OpenRE/0_Project/makefile and open the configuration.mk file.
Find the following code:
####select the motor interface of the control_unit_board for robot motor id : motor1, motor2, motor3, motor4
ROBOT_MOTOR1 ?= motor_interface_1
#### Tips: this means to map motor_interface_1 on the board to No.1 motor of robot
ROBOT_MOTOR2 ?= motor_interface_2
ROBOT_MOTOR3 ?= motor_interface_3
ROBOT_MOTOR4 ?= motor_interface_4
"ROBOT_MOTOR1" is the motor 1 on the robot, "motor_interface_1" is the motor interface 1 on the board. Under normal circumstances, the motor ID number on the robot corresponds to the ID number of the circuit board, that is, the robot motor 1 (N) Connect to the motor interface 1 (N) of the main control board.
If the main control motor interface 1 (N) is damaged, just connect the robot motor to other main control motor interfaces.
Assuming that the main control motor interface 2 is broken, you only need to plug the robot motor 2 into the third motor interface of the main control board and modify the following mapping relationship.
ROBOT_MOTOR1 ?= motor_interface_1
ROBOT_MOTOR2 ?= motor_interface_2
change into
ROBOT_MOTOR1 ?= motor_interface_1
ROBOT_MOTOR2 ?= motor_interface_3
That's it.
2. Reprogram the robot firmware
Firmware directory, OpenRE/0_Project/firmware/handsfree_wheel_robot, programming method, please see the OpenRE tutorial.
Motor interface ID number of the main control board
When we modify the motor interface in the makefile as above, we only need to connect the motor 1 to the motor interface 3 on the board. The control_unit_v2 board is shown in the figure above, and the motor interface is on the 4, 5, 8, and 9 ports on the right side of the figure. The control_unit_mini board is shown in the figure above, and the motor interface is on the 7, 8, 9, and 10 ports on the right side of the figure.
Robot's motor ID number
Two wheel differential robot
For a two-wheel differential robot (mini, stone, giraffe), looking down at the robot and the radar direction is straight ahead, then the motor on the left side of the robot is the No. 1 motor, and the motor on the right side of the robot is the No. 2 motor.
Three-wheeled omnidirectional robot
For a three-wheeled omnidirectional robot (stone_omni), if you look down on the robot and the radar direction is straight ahead, then the motor in front of the robot is the No. 1 motor, the motor on the left side of the robot is the No. 2 motor, and the motor on the right side of the robot is the No. 3 motor.