matlab tracking,Line Tracking

Introduction

Line tracking is a classic robotics application, that integrates sensing, actuation, and control algorithms. Line tracking robots are relatively easy to build and can autonomously navigate a pre-marked path without human input.

This example implements a line tracking algorithm on a two-wheeled EV3 robot with a color sensor. The robot uses feedback from the Color sensor to track the line. It uses feedback from the motor encoders to maintain forward velocity. Two Proportional-Integral-Derivative(PID) controllers control the velocity and tracking.

Prerequisites

Required Hardware

LEGO MINDSTORMS EV3 Brick

Two LEGO MINDSTORMS EV3 Large Motors

EV3 Color Sensor

EV3 Wi-Fi Dongle or USB Ethernet Adaptor

253befca6d6c833cfacf24f63f35d669.png

Task 1 - Set up Robot and Track

1. Build a two-wheeled robot with a color sensor. You can build a robot similar to the one described in the printed building instructions in the education core set.

2. Set up a connection between EV3 brick and your host machine. Please refer to Task 1 and 2 in Getting Started with LEGO® MINDSTORMS® EV3™ Hardware example.

3. Set up the track. For example, you can draw a thick black line on a flat white surface.

Task 2 - Configure Model and Calibrate Parameter

1. Open the model. Observe:

Sensors and Motors contain blocks that interface with the EV3 hardware.

State Estimation uses the values from each motor encoder to calculate the position and velocity of the robot.

Desired Velocity takes the user-provided Velocity (m/s) and converts it into the desired state values for the velocity controller.

Desired Light takes the Color sensor's white and black values to choose an appropriate reference value for the light.

Velocity Control has the PI controller implementation to control the forward velocity.

Line Tracking Controller has the PD controller implementation to control the turning.

2. Configure the model as described in Task 5 of the Getting Started with LEGO® MINDSTORMS® EV3™ Hardware example.

3. Open the Sensors and Motors subsystem, and set right port number for the Encoder, Motor and Color Sensor blocks.

4. Calibrate the black and white light intensity value. The values of White Value and Black Value blocks are the Light Sensor block's output value for white and black colors. You can calibrate them accordingly for your robot and track.

Task 3- Run the Model on the Robot

1. In the Hardware tab of your Simulink model, click Build, Deploy & Start. The model will now run on LEGO MINDSTORMS EV3 hardware.

2. Place the robot on the ground on the right edge of the line to be tracked. Observe that the robot moves along the track and makes corrections as it loses the track.

Other Things to Try

Try changing the parameters of both the velocity controller and the line tracking controller to achieve smoother line tracking

Use external mode to tune the controller parameters in real-time.

Summary

In this example, you ran a line tracking Simulink model on a LEGO MINDSTORMS EV3 robot. You learned the following:

With Simulink and Simulink Support Package for LEGO MINDSTORMS EV3 Hardware, you can implement simple to complex robot control algorithms.

A way to implement a simple line following control algorithm for the LEGO MINDSTORMS EV3 Hardware.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值