yahboom
HomeTutorialsProduct
Solution
Blog
Online Store
About Us
EN/中文
Store
MSPM0 Smart Robot Car📖
1.Quick Start Guide
  • 1. Assembly Videos
  • 2. Quick Start Videos
  • 3. Battery charging
  • 4. Notes
2.Introduction to the MSPM0 Car
  • 1.About MSPM0
  • 2.Development board interface description
3.Development environment setup and usage
  • 1.CCS Theia development
  • 2.MDK Arm development
  • 3.Uniflash burning
  • 4.External crystal oscillator configuration
  • 5.Project Migration
4.MSPM0 basic course
  • 1. LED light control (GPIO)
  • 2. Buzzer Control (GPIO)
  • 3. Button Control (EXTI)
  • 4. Serial Port (UART)
  • 5. Voltage Detection (ADC)
  • 6. Temperature Detection (ADC)
  • 7. Independent Watchdog (WWDG)
  • 8. Window Watchdog (WWDG)
  • 9. Timer (TIM)
  • 10. Breathing LED (PWM)
  • 11. I2C Communication (I2C)
  • 12. External Flash (SPI)
  • 13. Internal Flash (Flash)
  • 14. DMA
  • 15. FreeRTOS
5.Sensor basic course
  • 1.Servo control
  • 2.Ultrasonic servo PTZ basic use
  • 3.Motor PID control
  • 4.OLED display photosensitive value
  • 5.Infrared avoid sensor
  • 6.1 Infrared line tracking sensor-8 channel infrared tracking sensor module
  • 6.2 Infrared line tracking sensor-4 channel infrared tracking sensor module
  • 7.Infrared remote control
  • 8.Ultrasonic ranging
  • 9.RGB light drive
  • 10.MPU6050 raw data acquisition
  • 11.MPU6050 data fusion
  • 12.K210 vision recognition module
  • 13.K230 vision recognition module
6.Smart car course
  • 1.1 Car line tracking-8 channel infrared tracking sensor module
  • 1.2 Car line tracking-4 channel infrared tracking sensor module
  • 2.1 Drawing a circle-8 channel infrared tracking sensor module
  • 2.2 Drawing a circle-4 channel infrared tracking sensor module
  • 3.Ultrasonic following
  • 4.Ultrasonic avoid
  • 5.Ultrasonic avoid(Servo PTZ)
  • 6.Infrared sensor avoid
  • 7.Light following
  • 8.Gyroscope calibration straight-line walk
  • 9.Infrared remote control
  • 10.Autonomous driving car
7.Vision application course
  • 1.K210 autonomous driving
  • 2.K210 color tracking
  • 3.K210 handwritten digit action
  • 4.K210 color response
  • 5.K210 road sign indication action
  • 6.K210 following machine code
  • 7.K210 QR code command
  • 8.K230 vision line tracking
  • 9.K230 color tracking
  • 10.K230 machine code tracking
  • 11.K230 QR code command
  • 12.K230 autonomous avoid
  • 13.K230 license plate tracking
  • 14.K230 face tracking
  • 15.K230 gaze direction tracking
  • 16.K230 palm tracking
  • 17.K230 target tracking
  • 18.K230 human body tracking
  • 19.K230 OCR character recognition
8.Extended application course (Sold separately)
  • 1.Voice interaction module communication
  • 2.Voice interaction control
  • 3.K230 road sign indication action(Voice)
  • 4.K230 color response(Voice)
  • 5.K230 gesture control(Voice)
  • 6.K230 rock-paper-scissors(Voice)
  • 7.8-channel grayscale color line tracking
  • 8.Bluetooth remote control
  • 9.K210 Scenario-based autonomous driving
  • 10.K230 Scenario-based autonomous driving
Download
  • Code
  • SCH
  • 3D Model File
  • MSPM0 Data Sheet
  • Voice firmware
  • Hardware interface manual
Download ZIP

Welcome to MSPM0 Smart Robot Car repository

8.Gyroscope calibration straight-line walk

Gyroscope calibration straight-line walk

Gyroscope calibration straight-line walk1. Software-Hardware2. Brief Principle2.1 Hardware Schematic Diagram2.2 Physical Connection Diagram2.3 Control Principle3. Main Functions4. Experimental Phenomenon

This tutorial is a comprehensive experiment combining multiple peripherals. You can understand individual peripherals before conducting this experiment.

1. Software-Hardware

  • KEIL5

  • MSPM0G3507 Robot Development Board

    MPU6050 module: external

    OLED screen: external

  • Type-C data cable or DAP-Link

    For program download or simulation to the development board

2. Brief Principle

2.1 Hardware Schematic Diagram

upscalemedia-transformed (27)

2.2 Physical Connection Diagram

未命名的设计 (46)

2.3 Control Principle

Flowchart: Flowchart

ModuleFunction
MPU6050Obtain fused data and transmit data to the microcontroller

Principle:

PID Controller, composed of proportional unit P, integral unit I and differential unit D. Through the setting of three parameters Kp, Ki and Kd. PID controller is mainly suitable for systems whose basic linearity and dynamic characteristics do not change with time.

image-20231031094208747

r(t) setpoint, reference, is the expected process value or set value (SP); y(t) output, process variable, is the measured process value, output value (PV); e(t) error, is the deviation; u(t) control effort, is the control amount;

The significant characteristic of PID controller is the ability to utilize the influence of proportional, integral and differential control terms on controller output for precise and optimal control.

For attitude angle control, we want the robot to follow the given input for a given attitude angle. According to the single-stage PID approach, it should be like this:

image-20231031094208747

 

 

3. Main Functions

Mainly introduces the functional code written by users, for detailed code, you can open the project files we provide and view the source code in the Bsp folder.

Function: BSP_Loop

Function Prototypevoid BSP_Loop() 
Function DescriptionUse button, press once to switch between straight-line walking and stopping 
Input ParametersNone 
Output ParametersNone 

Function: mpu6050_Line

Function Prototypevoid mpu6050_Line() 
Function DescriptionPID combined with mpu6050 controls straight-line walking 
Input ParametersNone 
Output ParametersNone 

Function: Get_CalibratedAngles

Function Prototypevoid Get_CalibratedAngles()
Function DescriptionGet calibrated angles
Input ParametersNone
Output ParametersNone

Function: Dir_PID

Function Prototypefloat Dir_PID(float error)
Function DescriptionAngle loop PID control
Input ParametersTarget angle
Output ParametersOutput angle

Function: PID_Location_Calc

Function Prototypefloat PID_Location_Calc(PID_t *pid, float actual_val)
Function DescriptionSpeed loop: positional PID calculation method
Input ParametersTarget speed
Output ParametersOutput speed

 

4. Experimental Phenomenon

After successfully downloading the program, install the MPU6050 module and OLED screen on the expansion board. Then you can power on the car.

After power on, we need to wait for the mpu6050 value to stabilize. At this time, we can observe the OLED screen. After initialization is complete, the OLED will display ok, then we press the key1 button on the expansion board, and the car can start straight-line movement. If we adjust the car direction midway, the car will also self-adjust to walk straight.

If we want to stop the car movement, we need to press the key1 button again. If we want the car to move again, the same applies (need to press the key1 button).

Light following
Infrared remote control

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

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文