Some experience in using neural networks for intelligent car control

Publisher:uioo9158Latest update time:2015-11-13 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
   Neural network should be a good choice for the control algorithm of the car. But many people don't use it. I think it's because of the amount of calculation and convergence characteristics that make people afraid to go beyond the limit when studying the algorithm. The research of neural network is generally based on OFF-LINE, while Freescale's competition only uses the MCU's ON-LINE mode, which seems to be a contradiction; in addition, the calculation accuracy of neural network is not 100% in either classification or fitting, which is why aviation technology does not use neural network.
   This blog post mainly discusses the possibility of using neural networks in car control algorithms and how to use neural networks in car control algorithms.
   Presumably, students of automation have a deep impression of the modeling of control models, and some master's theses are about studying these models. Generally, the experimental data is modeled using mechanism analysis and system identification methods to obtain transfer functions, and then the actual system is debugged, from open loop to closed loop, and the parameters and control parameters are continuously adjusted. For example: to establish a control model for the car's straight line and arc walking, that is, to establish the relationship between the drive control and the car's turning offset through measured data, then the input parameters are the current speed, curvature size, turning arc, maximum safe speed, current offset angle and other parameters, and the output is the target speed and target angle. The relationship between this input and output is the control model, which is generally called a controller. The car runs fast and steadily, mainly because of this "controller". The controller is well fitted and has strong adaptability. OK, the results are not bad.
After all, the problem that the car control algorithm needs to solve is: input -> control model -> output control parameters.
    According to the general method, the establishment of the control model requires a large amount of data, and multiple debugging is required both offline and online, and the system has poor adaptability. However, by trying neural networks, these problems can be avoided to a large extent.
   1 First of all, it is necessary to introduce neural networks. What exactly are neural networks used for and how to use them? The theory of neural networks is not complicated. I think some books or papers complicate simple problems. Don't be afraid of it. A bunch of data A is continuously adjusted through a NET to get another bunch of data B. A and the target result data C are both known, and the NET is unknown. The process of adjusting the NET is training. The result of NET training is to minimize the error between B and C. If the error is reasonable, it converges. After convergence, the NET can be used. The core of the neural grid is to get a NET. The control model is a NET. The NET contains many parameters, such as weights, hidden layers, training methods, neuron models, transfer functions, etc. As long as a NET is established, the relationship between input and output is established.
   Neural networks have two main functions: one is classification, and the other is regression (fitting). If it is applied to the car control algorithm, it is undoubtedly used for regression fitting. What is regressing? Yes, returning to the control model mentioned above, this NET is the controller.
   The advantages of neural networks in car control algorithms are obvious. The model can be adjusted at any time, and the model is not expressed by a formula, but by a NET, avoiding complex parameter adjustment and trial calculation processes. Get a new NET through new environmental parameters to enhance the adaptability of the system.
     Why do some cars run well in their own field, but not in other fields?
     Why do some cars keep adjusting the control model, but the control effect is not good?
     How to choose the input parameters of the controller, how to define the weight of the parameters?
     . . . . . . . . . .
    A series of questions, neural networks can give you answers.
2 WJ's own thoughts on the use of neural networks for car control.
 Commonly used neural networks are: perceptron, BP, HOPFILED, RBF, ANN, ART and Kohonen network. If you don't use the toolbox function (that is, MATLAB API function), it doesn't matter if you write it yourself. Maybe you can create a network yourself. As long as the convergence is fast, the calculation amount is small, the generalization performance is good, and the network consumes less resources, it's OK. It sounds simple, but it is difficult. However, the requirements for the car are low and the accuracy does not need to be too high, so it should be relatively easy to implement.
 Neural networks are more macroscopic than PID, fuzzy control, genetic algorithms, bangbang and other algorithms. They can be understood as modeling from the overall system. However, as mentioned at the beginning of this blog post: the amount of calculation and convergence must be guaranteed before neural networks can be used. WJ suggested solving these two problems from the following aspects:
(1) Do not expect the real-time performance of neural networks. The most time-consuming part of neural networks is training. The neural network only needs one or two successful trainings when the car is running. When the car is running in a straight line, the data is used for training, because the CPU will have idle time when the car is running in a straight line. In addition, I believe that everyone often uses the DIP switch to select multiple control decisions. This is also a method. However, this control decision is fixed and pre-planned, and it will definitely not adapt to the various paths of the new KT board.
(2) It is best to use the on-chip FLASH or SD card. Data processing is very important and data is also very valuable. Save the data and transfer it to the PC. When the data is OFFLINE, study the algorithm of the neural network (there are countless training algorithms). This is one of them. Secondly, the trained network is stored in the SD card. If you need to train again next time, you can start from the old network (generally the network weights start randomly), which will be much more efficient.
(3) Just like data fusion, there is the fusion of the decision layer and the data layer, and the same is true for neural networks, with the use of the decision layer and the data layer. Since the path of the car is continuous, the neural network of the data layer is definitely useful. In image acquisition, it is generally 40ms to collect the path and make a control decision. So what should we do if this 40ms time is not enough? A common method is to simply collect it once every 80ms. My suggestion is to collect an image once in the first 60ms and make a control decision. In the next 20ms, use the path information extracted in the first 40ms and use the neural network to predict the change of the path. In this way, it is equivalent to collecting an image once in 20ms. As you can imagine, the efficiency is improved.
(4) The above is the use of neural networks from the data layer. Here we will talk about the use of neural networks from the decision layer. For example, if the controller outputs -3 -2 -1 0 1 2 3 represent the servo left deviation 30, left deviation 20, left deviation 10, straight, right deviation 10, right deviation 20, right deviation 30, and the car's first 7 control decisions are: straight, right deviation 10, straight, left deviation 10, straight, right deviation 10, straight, (0 1 0 -1 0 1 0). . . . , then the 8th decision through the Neural Network should be left deviation (-1). If the actual requirement is not left deviation, the Neural Network should be "punished".
(5) Find a suitable error threshold. The car's tracking is not like laser cutting, and the accuracy requirement is not high. The error value of its training can be "negotiated". (6
) The training data of the Neural Network cannot be captured by just one, but must be selected. But this selection is also time-consuming. If it is on a PC, FCM (fuzzy clustering) is a good choice. However, MCU cannot bear this heavy responsibility, so choosing appropriate training data and target data is also an important research topic. Here, how to optimize the neural network input is not the focus, so it is skipped.
(7) Pay attention to normalization processing and neural network training algorithm. These two points are very important. Normalization can be understood as normalizing (100 45 -67 90) to (1 0.45 -0.67 0.9). The advantage is to improve the standardization of data and accelerate convergence. In addition, the importance of training algorithm is self-evident. For example, the gradient descent method is used to minimize the error. What is the gradient descent method? For example, if you want to go down the mountain, the slope in front of the mountain is 30 degrees, and the slope behind the mountain is 90 degrees. If you want to go down the mountain quickly, of course you should find a steep slope and jump directly. This downhill slope and training gradient have the same meaning.
(8) I personally think that using neural network for speed control has great advantages. Compared with PID control, the accuracy may be a little defective, but the speed is fast. Due to friction, car power performance, car drive performance, battery and other reasons, closed-loop speed control is required. Suppose: the car has a beat of 10ms per unit time, and the speed goes from X1m/s->Y1m/s, which requires a PWM duty cycle of d1%; the speed goes from X2m/s->Y2m/s, which requires a PWM duty cycle of d2%... The speed goes from Xn m/s->Yn m/s, which requires a PWM duty cycle of dn%. Then, with (X, Y)' as the training input and (D)' as the training output, a neural network is established and trained, and it is very easy to establish the relationship between PWM and speed control.
Reference address:Some experience in using neural networks for intelligent car control

Previous article:Problems with using _at_ absolute address positioning in Keil
Next article:Some thoughts on HCS12 ECT module

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号