2. Robot PID debugging

Note: The PID has been debugged before the product leaves the factory. It is not recommended to adjust it yourself, as it may cause problems with subsequent functions. But you can learn

Learn debugging methods and operating procedures.

According to different models, just set the purchased model in [.bashrc], X1 (normal four-wheel drive) X3 (Mailun) X3plus (Mailun robotic arm) R2 (Ackerman differential) etc. , this section takes X3 as an example:

Find the [ROBOT_TYPE] parameter and modify the corresponding model

2.1. Start the chassis

2.1.1. Function package path

2.1.2. Start

1), first check the source code Mcnamu_driver.py

Find the line self.car.set_pid_param and remove the comment # in front of it to debug the robot's PID.

  1. First select the debugging parameters. After entering the name of each parameter as shown in the figure below, click [+] to add, [-] to delete.

Note: The speed in the y direction is only available for the Mecanum wheel car X1

image-20220308153722812

  1. In the rqt_reconfigure window, as shown in the figure, select the [driver_node] node. We only need to adjust the three parameters [Kp], [Ki], and [Kd], and do not adjust the others.

image-20220308153939492

Debugging steps:

Keyboard control instructions (Before keyboard control, you need to click with the mouse to open the keyboard control terminal before you can control it)

After debugging, the PID is automatically stored in the PCB. Just comment out the PID setting part according to the way you originally viewed the source code.

Note: Other gameplay requires PID debugging, the theory is the same, theoretical reference.