yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
8-Channel Tracking Module📖
0. 8-channel line tracking module usage
  • 8-channel line tracking module usage
1. Single board tutorials
1.arduino
  • I2C method
  • IO method
  • Serial port method
2.STM32
  • I2C method
  • IO method
  • Serial Port method
3.MSPM0G3507
  • I2C method
  • IO method
  • Serial Port method
5.Raspberry Pi
  • I2C method
  • IO method
  • Serial Port method
4.MSPM0G3519
  • I2Cnew
  • IOnew
  • Serial Portnew
2. Car Tutorials
  • 1.STM32-Wheeled car chassis_V1
  • 2.STM32-Wheeled car chassis_V2
  • 3.STM32 development board car
  • 4.STM32 self-balancing car
  • 5.MSPM0-Wheeled car chassis_V1
  • 6.MSPM0G3507-Wheeled car chassis_V2
  • 7.MSPM0G3519-Wheeled car chassis_V2new
  • 8.Arduino car(Roboduino)
  • 9.Raspberry Pi car(RaspbotV2)
3. Expansion Tutorialsnew
  • 1.Autonomous driving car
  • 2.Vehicle-mounted balance ball motion control system
Download
  • Code
  • Protocol
Download ZIP

Welcome to 8-Channel Tracking Module repository

3.STM32 development board car

STM32 development board car

1. Experimental preparation

  1. Knowledge reserve

  • Have good programming ability (mainly C language)

  • Familiar with the architecture of stm32

  1. Material preparation

  • STM32 development board car *1

  • Eight-way tracking module *1

  • 7.4V battery *1

  • Several Dupont wires

2. Car wiring

After assembling the car, connect the motor wires (black head to the motor, white head to the development board)

image-2024110100001

image-2024110100002

Wiring of the development board and infrared sensor (this example uses IO communication)

Development BoardInfrared sensor
L1X1
L2X2
L3X3
L4X4
L5X5
L6X6
L7X7
L8X8
5V5V
GNDGND

As shown in the figure:

image-2024110100003

image-2024110100004

Warm reminder: If the battery cover cannot be closed after connecting the 8-way module, you can fix the battery on the top and remove the battery cover.

 

Main procedures

// TIM6 interrupt
void TIM6_IRQHandler(void)
{
    if (TIM_GetITStatus(TIM6, TIM_IT_Update) != RESET) //Check whether TIM update interruption occurs
    {
        TIM_ClearITPendingBit(TIM6, TIM_IT_Update);    //Clear TIMx update interrupt flag
        
        if(timer_delay_cnt != 0)
        {
            timer_delay_cnt --;
        }
        
            //encoder pid
            Encoder_Update_Count();
            Motion_Handle();
        
        //IO direct line inspection 10ms to detect the status of the line
        LineWalking();
    }
}

This project uses a timer interrupt to perform PID processing for line patrol according to the value of the infrared probe (every 10ms), so that line patrol can be completed on a map with black lines and white background.

In app_irtrackin.c, there is a parameter for adjusting PID line patrol. If you want to increase or decrease the speed and optimize the effect, you can adjust the macro definition value inside.

​x

#define IRTrack_Trun_KP (490) //P
#define IRTrack_Trun_KI (0.0001) //I
#define IRTrack_Trun_KD (5) //D

#define IRR_SPEED             400  //Line patrol speed
  • IRTrack_Trun_KP: P value of pid line patrol

  • IRTrack_Trun_KI: I value of pid line patrol

  • IRTrack_Trun_KD: D value of pid line patrol

  • IRR_SPEED: Speed of line patrol

When you want to check whether the motor wiring is correct, you can give a positive speed and then set the line patrol PID value to 0. If the wiring is correct, after pressing the key button on the RCT6 development board, the car will move forward and all four motors will move forward.

Experimental phenomenon:

On the premise of ensuring that the wiring and installation are correct, after the 8-way line patrol module is calibrated, press the key1 button to start line patrol. ​ If the 8-way module probe cannot detect the black and white lines normally, you need to wait for the module to work normally before pressing the key1 button ​ If the floor is black, you need to put a piece of white paper under our map to cover the black. The main reason is that the material of the map is relatively transparent, which has a greater impact on the 8-way line patrol sensor.

STM32-Wheeled car chassis_V2
STM32 self-balancing car

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文