CCD dual tracking-Mini chassis

1.Experimental Purpose

Through the previous experiment, we learned how the linear CCD module tracks along the black line. In this experiment, we increased our efforts to have the CCD track between the two black lines.

2.Experimental preparation

This experiment requires an ROS expansion board, a Chinese racing chassis car, a 310 motor, a 7.4V battery, a linear CCD module, and an OLED screen (not required)

These hardware can be purchased from Yabo Intelligent's Taobao store

3.Experimental wiring

3.1 Jumpers are required for the wiring of the ROS expansion board and the 310 motor

The line sequence of the two is shown in the following figure: image-2023040300001 image-2023040300002 M1--->M+ M2--->M-

3.2 3.2 Wiring of ROS expansion board, linear CCD module, and OLED screen

image-2023040300003

4.Program source code analysis

This project introduces a real-time operating system for Freeros, and we will look at vTask ourselves_ The CCD thread function is sufficient, and other thread functions are not closely related to this experiment. Interested parties can analyze it on their own. vTask_CCD:This task is to first determine whether the freeros system is normal, and if it is normal, enter the APP_ CCD_ The following will focus on analyzing the processing function for the tracking task of Handle

5.note

  1. Because this car is a differential car, the speed should not be too fast, as it may cause undetectable black lines and make it difficult to turn
  2. The experiment in this tutorial adopts the slowest speed, and those who need to adjust it faster need to adjust the PID parameters themselves.
  3. The installation position and height of the CCD camera in this tutorial are shown in the following figure: (Different positions and heights may also affect the adjustment of pid parameters) image-2023040300005 image-2023040300004
  4. The experimental source code of this tutorial is only applicable to the experimental car, and is for reference only for other car source codes.

6.experimental result

You can see that the car is tracking normally on the black and white line. For a detailed tracking video, please refer to the introduction video of the CCD module on Taobao, a flagship store of Yabo Intelligent.

Alternatively, check out a short follow-up video of this experiment.

Other reference tutorials: https://blog.csdn.net/Gxust_Veneno/article/details/119797411