CN105551345B - The double cars of intelligence communicate and followed experiment device for teaching and experimental method - Google Patents
The double cars of intelligence communicate and followed experiment device for teaching and experimental method Download PDFInfo
- Publication number
- CN105551345B CN105551345B CN201610117473.9A CN201610117473A CN105551345B CN 105551345 B CN105551345 B CN 105551345B CN 201610117473 A CN201610117473 A CN 201610117473A CN 105551345 B CN105551345 B CN 105551345B
- Authority
- CN
- China
- Prior art keywords
- vehicle system
- time
- speed
- vehicle
- distance
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Classifications
-
- G—PHYSICS
- G09—EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
- G09B—EDUCATIONAL OR DEMONSTRATION APPLIANCES; APPLIANCES FOR TEACHING, OR COMMUNICATING WITH, THE BLIND, DEAF OR MUTE; MODELS; PLANETARIA; GLOBES; MAPS; DIAGRAMS
- G09B19/00—Teaching not covered by other main groups of this subclass
- G09B19/16—Control of vehicles or other craft
- G09B19/167—Control of land vehicles
Landscapes
- Business, Economics & Management (AREA)
- Engineering & Computer Science (AREA)
- Entrepreneurship & Innovation (AREA)
- Physics & Mathematics (AREA)
- Educational Administration (AREA)
- Educational Technology (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Steering Control In Accordance With Driving Conditions (AREA)
- Control Of Position, Course, Altitude, Or Attitude Of Moving Bodies (AREA)
Abstract
本发明公开了一种智能双车通信及跟随教学实验装置和方法,本装置包括安装在前车的前车系统和安装在后车的后车系统,前车系统和后车系统均包括主控设备、电源供压装置、直流电机驱动装置、转向控制装置、无线通信装置、液晶屏、测速装置、测距装置、拨码开关及按键装置,前后车系统通过测距装置测量前后车初始车距,前后车系统通过无线通信装置接收PC机发来的设定好的前车的目标速度和目标打角,通过增量式PID控制调整实际速度以及通过转向控制装置调整实际打角以接近设定值,实现前后车的通信及跟随的教学过程;本装置和方法,使高校控制类、通信工程类专业实验教学得到良好的教学效果,使学生可以生动直观地掌握专业知识。
The invention discloses an intelligent two-vehicle communication and follow-up teaching experiment device and method. The device includes a front vehicle system installed on the front vehicle and a rear vehicle system installed on the rear vehicle. Both the front vehicle system and the rear vehicle system include a main control system Equipment, power supply voltage device, DC motor drive device, steering control device, wireless communication device, LCD screen, speed measuring device, distance measuring device, dial switch and key device, the front and rear vehicle systems measure the initial distance between the front and rear vehicles through the distance measuring device , the front and rear vehicle systems receive the set target speed and target angle of the vehicle in front from the PC through the wireless communication device, adjust the actual speed through incremental PID control and adjust the actual angle through the steering control device to approach the setting The value realizes the communication between the front and rear vehicles and the following teaching process; the device and method enable the experimental teaching of control and communication engineering majors in colleges and universities to obtain good teaching effects, so that students can grasp professional knowledge vividly and intuitively.
Description
技术领域technical field
本发明涉及一种基于智能车的实验教学仪器领域,具体涉及一种实现智能双车间的通信及两车的跟随行驶、可供高校控制类、通信工程类专业实验教学使用的智能双车通信及跟随教学实验装置和实验方法。The present invention relates to the field of experimental teaching instruments based on intelligent vehicles, in particular to an intelligent dual-vehicle communication system that realizes the communication between intelligent double-cars and the following driving of two vehicles, and can be used for experimental teaching of control and communication engineering majors in colleges and universities. Follow along with teaching experimental setup and experimental methods.
背景技术Background technique
目前,高校实验教学设备种类繁多,但多数为基础实验教学仪器,只有少数为针对智能车单车控制的实验仪器,而对于智能车前后两车间的通信及通过前车控制后车实现两车跟随的实验教学仪器尚未出现。在教学过程中,一般高校采用软件模拟的形式完成,实验结果缺乏直观生动,不利于学生对控制技术及通信技术的了解掌握。At present, there are many types of experimental teaching equipment in colleges and universities, but most of them are basic experimental teaching instruments, and only a few are experimental instruments for single-vehicle control of smart cars. Experimental teaching instruments have not yet appeared. In the teaching process, the general colleges and universities use the form of software simulation to complete, and the experimental results are not intuitive and vivid, which is not conducive to students' understanding of control technology and communication technology.
专利公开号:CN204623370U,一种全自动电动车驱动系统用智能通信装置,通过无线连接实现中控无线模块和手机无线模块与手机系统模块连接;其中手机系统模块包括手机用户APP界面、手机通信模块和手机无线模块。其实现了手机用户APP与全自动电动车之间的通信,但没有实现双车间的通信。Patent publication number: CN204623370U, an intelligent communication device for a fully automatic electric vehicle drive system, which realizes the connection between the central control wireless module and the mobile phone wireless module and the mobile phone system module through wireless connection; the mobile phone system module includes the mobile phone user APP interface and the mobile phone communication module and mobile phone wireless module. It realizes the communication between the mobile phone user APP and the fully automatic electric vehicle, but does not realize the communication between the two workshops.
专利公开号:CN103496368A,具有学习能力的汽车协同式自适应巡航控制系统及方法,其中训练集和测试集生成模块用于根据获取的前车与本车行驶状态信息生成相适应的训练集和测试集,汽车行驶状态集模块和汽车间安全距离模块选择出能够准确表达当前车辆状态和车间距离的数据。其在一定程度上实现了后车对前车运动状态的捕捉来实现后车的跟随行驶,但其不能形象生动地展现两车状态,不能有效应用到高校教学中。Patent publication number: CN103496368A, Vehicle cooperative adaptive cruise control system and method with learning ability, wherein the training set and test set generation module is used to generate suitable training set and test according to the acquired driving state information of the preceding vehicle and the own vehicle The vehicle driving state set module and the inter-vehicle safety distance module select data that can accurately express the current vehicle state and inter-vehicle distance. To a certain extent, it realizes the capture of the motion state of the vehicle in front by the vehicle behind to realize the follow-up driving of the vehicle behind, but it cannot vividly show the state of the two vehicles, and cannot be effectively applied to college teaching.
发明内容Contents of the invention
本发明要解决上述问题,提出一种智能车双车通信及跟随的实验装置,具体技术方案如下:To solve the above problems, the present invention proposes an experimental device for two-vehicle communication and follow-up of intelligent vehicles. The specific technical scheme is as follows:
智能双车跟随及通信实验设备,包括安装在前车上的前车系统和安装在后车上的后车系统,其特征在于:Intelligent dual-vehicle following and communication experimental equipment, including the front vehicle system installed on the front vehicle and the rear vehicle system installed on the rear vehicle, is characterized in that:
前车系统包括主控设备、电源供压装置、直流电机驱动装置、转向控制装置、无线通信装置、液晶屏、测速装置、测距装置、拨码开关及按键装置和PC机,主控设备信号接口与直流电机驱动装置、转向控制装置、无线通信装置、液晶屏、测速装置、测距装置、拨码开关及按键装置的信号接口相连,主控设备、无线通信装置、测速装置、测距装置、拨码开关及按键装置、液晶屏、转向控制装置和直流电机驱动装置的电压输入接口分别与电源供压装置连接以获取电压,直流电机驱动装置输出端齿轮与车体后轮齿轮啮合,转向控制装置输出端通过拉杆与车体前轮转向节相连,测速装置输入端测速齿轮与车体后轮齿轮啮合;The front vehicle system includes main control equipment, power supply voltage device, DC motor drive device, steering control device, wireless communication device, LCD screen, speed measuring device, distance measuring device, dial switch and key device and PC, the main control equipment signal The interface is connected to the signal interface of the DC motor drive device, steering control device, wireless communication device, LCD screen, speed measuring device, distance measuring device, dial switch and key device, and the main control equipment, wireless communication device, speed measuring device, distance measuring device , DIP switch and button device, LCD screen, steering control device and the voltage input interface of the DC motor drive device are respectively connected to the power supply voltage device to obtain the voltage, the gear at the output end of the DC motor drive device meshes with the rear wheel gear of the car body, and the steering The output end of the control device is connected to the steering knuckle of the front wheel of the car body through a tie rod, and the speed measuring gear at the input end of the speed measuring device meshes with the rear wheel gear of the car body;
主控设备中有计时器,脉冲宽度调制器,脉冲累加器,定时中断器;There are timers, pulse width modulators, pulse accumulators, and timing interrupters in the main control device;
后车系统的结构和各部件之间的连接关系与上述的前车系统相同,前车系统中的测距装置悬置且贴合在前车车体后端上,后车系统中的测距装置悬置且贴合在后车的舵机上;The structure of the rear vehicle system and the connection relationship between various components are the same as the above-mentioned front vehicle system. The distance measuring device in the front vehicle system is suspended and attached to the rear end of the front vehicle body. The device is suspended and attached to the steering gear of the rear car;
PC机可以通过无线通信装置与前车系统和后车系统进行通信。The PC can communicate with the front vehicle system and the rear vehicle system through the wireless communication device.
进一步的技术方案:Further technical solutions:
所述电源供压装置包括电池、5V稳压模块、3.3V稳压模块、6V稳压模块、12V稳压模块、测压模块,电池与5V稳压模块、6V稳压模块的输入接口相接,5V稳压模块输出接口与3.3V稳压模块、12V稳压模块的输入接口相接,测压模块输入接口与电池相连,电源供压装置的5V稳压模块的输出接口与主控设备、无线通信装置、测速装置、测距装置、拨码开关及按键装置的电压输入接口相连;电源供压装置的3.3V稳压模块的输出接口与液晶屏的电压输入接口相连;电源供压装置的6V稳压模块的输出接口与转向控制装置的电压输入接口相连;电源供压装置的12V稳压模块的输出接口与直流电机驱动装置的电压输入接口相连。The power supply voltage device includes a battery, a 5V voltage stabilizing module, a 3.3V voltage stabilizing module, a 6V voltage stabilizing module, a 12V voltage stabilizing module, and a pressure measuring module, and the battery is connected to the input interface of the 5V voltage stabilizing module and the 6V voltage stabilizing module , the output interface of the 5V voltage stabilizing module is connected with the input interface of the 3.3V voltage stabilizing module and the 12V voltage stabilizing module, the input interface of the pressure measuring module is connected with the battery, the output interface of the 5V voltage stabilizing module of the power supply device is connected with the main control equipment, The voltage input interface of the wireless communication device, speed measuring device, distance measuring device, dial switch and key device is connected; the output interface of the 3.3V voltage stabilizing module of the power supply voltage device is connected with the voltage input interface of the LCD screen; The output interface of the 6V voltage stabilizing module is connected with the voltage input interface of the steering control device; the output interface of the 12V voltage stabilizing module of the power supply voltage supply device is connected with the voltage input interface of the DC motor driving device.
智能双车跟随及通信实验方法,其特征在于,步骤如下:The intelligent double-vehicle following and communication experiment method is characterized in that the steps are as follows:
步骤一:前后车初始测距:Step 1: Initial distance measurement of front and rear vehicles:
前车系统和后车系统中的测距装置配合工作,利用超声波的发送和接收测量两车之间的距离,其中一个脉冲高电平时间表示超声波从前车到后车的传播时间,使用主控设备中的计时器测得的脉冲高电平的时间;The distance measuring devices in the front vehicle system and the rear vehicle system work together to measure the distance between the two vehicles by sending and receiving ultrasonic waves. The high level time of one pulse indicates the propagation time of ultrasonic waves from the front vehicle to the rear vehicle. Using the main control The time of the pulse high level measured by the timer in the device;
两车之间初始距离计算公式:The formula for calculating the initial distance between two vehicles:
初始距离L0=t×vvoice Initial distance L 0 =t×v voice
其中t是主控设备所测得的脉冲高电平时间,vvoice是声速,取340m/sAmong them, t is the pulse high level time measured by the main control device, and v voice is the speed of sound, which is 340m/s
步骤二:前车系统获取PC机设定的前车系统当前时刻目标速度v和前车系统当前时刻的目标打角α:Step 2: The front vehicle system obtains the target speed v of the front vehicle system at the current moment and the target angle α of the front vehicle system at the current moment set by the PC:
PC机给前车系统的无线通信装置发送信号,前车系统获取使用者在PC机上位机上设定的前车系统当前时刻目标速度v和前车系统当前时刻的目标打角α;The PC sends a signal to the wireless communication device of the front vehicle system, and the front vehicle system obtains the target speed v of the front vehicle system at the current moment and the target angle α of the front vehicle system at the current moment set by the user on the PC host computer;
步骤三:前车系统转向控制装置对转动角度的控制:Step 3: The steering control device of the front vehicle system controls the rotation angle:
前车系统将接收到的前车系统当前时刻的目标打角α经过计算得到前车系统的脉冲宽度T1并通过主控设备的脉冲宽度调制器控制转向控制装置转动,前车系统的转向控制装置的转动角度α1'与前车系统的脉冲宽度T1的关系计算公式为:The front vehicle system calculates the received target angle α of the front vehicle system at the current moment to obtain the pulse width T 1 of the front vehicle system, and controls the rotation of the steering control device through the pulse width modulator of the main control device. The steering control of the front vehicle system The calculation formula for the relationship between the rotation angle α1' of the device and the pulse width T 1 of the front vehicle system is:
其中T1为前车系统的脉冲宽度,单位为ms;α1'为前车系统的转向控制装置的转动角度,脉冲周期为20ms;Among them, T 1 is the pulse width of the front vehicle system, the unit is ms; α 1 ' is the rotation angle of the steering control device of the front vehicle system, and the pulse period is 20ms;
步骤四:前车系统通过前车系统中的测速装置获取前车系统在n时刻的实际速度v1(n):Step 4: The front vehicle system obtains the actual speed v 1 (n) of the front vehicle system at time n through the speed measuring device in the front vehicle system:
用主控设备的脉冲累加器来捕捉脉冲并计数,开启定时中断器,就可以测得定时中断的周期p之内的脉冲数xUse the pulse accumulator of the main control device to capture and count the pulses, turn on the timer interrupter, and you can measure the number of pulses x within the period p of the timer interrupt
前车系统在n时刻的实际速度v1(n)计算公式: The formula for calculating the actual speed v 1 (n) of the preceding vehicle system at time n:
其中x是脉冲个数,a是测速装置输入端测速齿轮的齿数,d是前车后轮直径,b是前车后轴齿轮齿数,c是测速装置转动一圈所产生的脉冲数,p是定时中断的周期;Among them, x is the number of pulses, a is the number of teeth of the speed measuring gear at the input end of the speed measuring device, d is the diameter of the front wheel and rear wheel, b is the number of teeth of the front and rear axle gears, c is the number of pulses generated by one rotation of the speed measuring device, and p is Period of timed interrupt;
步骤五:将前车系统从0到n时刻为止各个时刻的实际速度v1(0),v1(1),······v1(n)积分得到前车系统从0到n时刻为止所走过的路程S1(n):Step 5: Integrate the actual speed v 1 (0), v 1 (1), v 1 (n) of the preceding vehicle system from 0 to n at each moment to obtain the preceding vehicle system from 0 to n The distance S 1 (n) traveled so far:
主控设备所计算出的前车系统的实际速度为离散变量v1(i),其中v1(i)为前车系统在i时刻的实际速度,其中i时刻为从0时刻到n时刻这一时间段中的任一时刻,故积分公式简化为即只需把前车从0到n时刻为止各个时刻的实际速度求和就能得到前车系统从0到n时刻为止前车系统所走的路程S1(n);The actual speed of the vehicle in front calculated by the master control device is a discrete variable v 1 (i), where v 1 (i) is the actual speed of the vehicle in front at time i, where time i is the time from time 0 to time n. any moment in a time period, so the integral formula is simplified as That is, the distance S 1 (n) traveled by the vehicle in front from 0 to time n can be obtained by simply summing the actual speeds of the vehicle in front at each time from 0 to time n;
步骤六:通过增量式PID控制,使前车系统在n+1时刻的实际速度v1(n+1)接近预定的前车系统当前时刻目标速度v:Step 6: Through incremental PID control, make the actual speed v 1 (n+1) of the vehicle in front at time n+1 approach the predetermined target speed v of the vehicle in front at the current moment:
由于实际速度与目标速度总有偏差,使用增量式PID速度调节提高车速的稳定性,减小实际速度与目标速度的偏差,在n时刻将测速装置获取的前车系统在n时刻的实际速度v1(n)与前车系统当前时刻目标速度v进行比例环节和积分环节的调整;Since there is always a deviation between the actual speed and the target speed, the incremental PID speed adjustment is used to improve the stability of the vehicle speed and reduce the deviation between the actual speed and the target speed. v 1 (n) and the target speed v of the vehicle in front at the current moment are adjusted in the proportional link and the integral link;
设n时刻电机电压un为控制量,增量式PID输出的控制量的增量为△un,则n-1时刻电机电压为un-1,增量式PID输出的是控制量的增量为△un-1;Let the motor voltage u n at time n be the control quantity, and the increment of the control quantity output by the incremental PID is △u n , then the motor voltage at time n-1 is un -1 , and the output of the incremental PID is the control quantity The increment is △u n-1 ;
因此电机电压应是un=un-1+△un So the motor voltage should be u n =u n-1 +△u n
增量式PID输出的是控制量的增量△un=un-un-1=A(en-en-1)+Ben+C(en-2en-1+en-2);Incremental PID output is the increment of control quantity △u n =un -u n -1 =A(e n -e n-1 )+Be n +C(e n -2e n-1 +e n -2 );
前车系统当前时刻目标速度v和前车系统在n时刻的实际速度v1(n)的差值为en=v-v1(n),en-1=v-v1(n-1),en-2=v-v1(n-2)A,B,C为待定参数;The difference between the current target speed v of the vehicle in front and the actual speed v 1 (n) of the vehicle in front at time n is en =vv 1 (n), e n -1 =vv 1 (n-1),e n-2 =vv 1 (n-2)A, B, C are undetermined parameters;
待定参数A,B,C的取值按以下方法:The values of the undetermined parameters A, B, and C are as follows:
先把待定参数B,C设定为0,把待定参数A从0开始逐渐增大,不断地运行前车系统或后车系统,直到前车系统或后车系统刚好发生超调,待定参数A设为前车系统或后车系统刚好发生超调时的60%到80%;First set the undetermined parameters B and C to 0, and gradually increase the undetermined parameter A from 0, and continuously run the front vehicle system or the rear vehicle system until the front vehicle system or the rear vehicle system just happens to overshoot, and the undetermined parameter A Set it to 60% to 80% of when the front vehicle system or the rear vehicle system just happens to overshoot;
然后参数A不变,把待定参数B从0开始逐渐增大,不断地运行前车系统或后车系统,直到前车系统或后车系统刚好发生超调,待定参数B设为前车系统或后车系统刚好发生超调时的60%到80%;Then the parameter A remains unchanged, and the undetermined parameter B is gradually increased from 0, and the front vehicle system or the rear vehicle system is continuously operated until the front vehicle system or the rear vehicle system just happens to overshoot, and the undetermined parameter B is set to the front vehicle system or 60% to 80% of when the rear vehicle system just happens to overshoot;
最后待定参数C设为0;The last undetermined parameter C is set to 0;
步骤七:前车系统通过无线通信装置,给后车系统发送前车系统当前时刻目标速度v,前车系统当前时刻的目标打角α以及前车系统从0到n时刻为止前车系统所走的路程S1(n):Step 7: The front vehicle system sends the current target speed v of the front vehicle system to the rear vehicle system through the wireless communication device, the current target angle α of the front vehicle system at the current moment, and the distance traveled by the front vehicle system from 0 to n. The distance S 1 (n):
前车系统将从PC机接收到的全部数据包括前车系统当前时刻目标速度v,前车系统当前时刻的目标打角α以及前车系统从0到n时刻为止前车系统所走的路程S1(n),通过前车系统和后车系统中的无线通信装置发送给后车系统;All the data that the preceding vehicle system will receive from the PC include the target speed v of the preceding vehicle system at the current moment, the target angle α of the preceding vehicle system at the current moment, and the distance S traveled by the preceding vehicle system from 0 to n moments 1 (n), sent to the rear vehicle system through the wireless communication devices in the front vehicle system and the rear vehicle system;
后车系统接收到前车系统当前时刻的目标打角α和前车系统从0到n时刻为止前车系统所走的路程S1(n)后,由于前车系统不同时刻的目标打角α的值是不同的,将不同时刻的α的值以数组的形式保存,使α(n)=α;After the rear vehicle system receives the target angle α of the front vehicle system at the current moment and the distance S 1 (n) traveled by the front vehicle system from 0 to time n, due to the target angle α of the front vehicle system at different times The value of is different, and the value of α at different moments is saved in the form of an array, so that α(n)=α;
其中α(n)是的前车系统在n时刻的目标打角,且α(n)和S1(n)一一对应Where α(n) is the target angle of the preceding vehicle system at time n, and α(n) corresponds to S 1 (n) one-to-one
步骤八:后车系统根据自己所在位置,调整后车系统当前时刻的目标打角α2 Step 8: The rear vehicle system adjusts the current target angle α 2 of the rear vehicle system according to its own location
后车速度积分得到后车到m时刻为止后车所走过的路程S2(m)The speed integral of the following vehicle obtains the distance S 2 (m) traveled by the following vehicle up to time m
由积分公式得到后车路程S2(m)by integral formula Get the distance of the rear vehicle S 2 (m)
由步骤一测得前后车初始距离L0,再测出后车车身的长度X2,因此后车的初始路程为-(L0+X2),后车路程S2在-(L0+X2)到0之间舵机打角为0,后车路程S2>0之后按照前车发来的数据行驶;Measure the initial distance L 0 of the front and rear vehicles from step 1, and then measure the body length X 2 of the rear vehicle, so the initial distance of the rear vehicle is -(L 0 +X 2 ), and the distance S 2 of the rear vehicle is -(L 0 + Between X 2 ) and 0, the angle of the steering gear is 0, and the distance of the rear vehicle S 2 >0, then drive according to the data sent by the vehicle in front;
后车系统接收到的前车路程S1和后车计算得到的后车路程S2都是离散的,所以在m时刻后车系统计算得到的后车路程S2(m)可能是在已接收并保存的两个相邻路程S1(n)和S1(n+1)之间,后车系统将取所保存的两个路程所对应的两个目标打角取平均值后作为后车系统当前时刻的目标打角α2;The distance S 1 of the vehicle ahead received by the vehicle system behind and the distance S 2 of the vehicle behind calculated by the vehicle behind are both discrete, so the distance S 2 (m) of the vehicle behind calculated by the vehicle system behind at time m may be the Between the two adjacent distances S 1 (n) and S 1 (n+1) saved, the trailing vehicle system will take the average value of the two target angles corresponding to the stored two distances as the trailing vehicle The target angle α 2 of the system at the current moment;
例如:m时刻后车系统检测到自己的当前路程为S2(m),而后车系统通过步骤七接收到的前车路程S1内最接近S2(m)的有两组数据S1(n)、S1(n+1),其中,S1(n)为前车系统从0到n时刻为止前车系统所走的路程,S1(n+1)为前车系统从0到n+1时刻为止前车系统所走的路程For example: at time m, the following vehicle system detects that its current distance is S 2 (m), and the following vehicle system receives two sets of data S 1 ( n), S 1 (n+1), wherein, S 1 (n) is the distance traveled by the vehicle in front from 0 to moment n, and S 1 (n+1) is the distance traveled by the vehicle in front from 0 to time n. The distance traveled by the vehicle in front until time n+1
与前车系统从0到n时刻为止前车系统所走的路程S1(n)对应的打角是前车系统在n时刻的目标打角α(n);The angle corresponding to the distance S 1 (n) traveled by the vehicle in front from 0 to time n is the target angle α(n) of the vehicle in front at time n;
与前车系统从0到n+1时刻为止前车系统所走的路程S1(n+1)对应的打角是前车系统在n+1时刻的目标打角α(n+1);The angle corresponding to the distance S 1 (n+1) traveled by the vehicle in front from 0 to time n+1 is the target angle α(n+1) of the vehicle in front at time n+1;
则后车系统当前时刻的目标打角α2满足以下关系:Then the target angle α 2 of the rear vehicle system at the current moment satisfies the following relationship:
α2=α(n) (S2(m)=S1(n))α 2 =α(n) (S 2 (m)=S 1 (n))
α2=(α(n)+α(n+1))/2 (S1(n)<S2(m)<S1(n+1))α 2 =(α(n)+α(n+1))/2 (S 1 (n)<S 2 (m)<S 1 (n+1))
α2=α(n+1) (S2(m)=S1(n+1))α 2 =α(n+1) (S 2 (m)=S 1 (n+1))
步骤九:后车系统根据后车系统m时刻的目标打角α2控制转向控制装置实现转向,根据前车系统m时刻的目标速度v和后车系统在m时刻的实际速度v2(m)通过PID调节控制智能车m+1时刻的实际速度v2(m+1);Step 9: The rear vehicle system controls the steering control device to realize steering according to the target angle α 2 of the rear vehicle system at time m, and according to the target speed v of the front vehicle system at time m and the actual speed v 2 (m) of the rear vehicle system at time m Control the actual speed v 2 (m+1) of the smart car at time m+1 through PID adjustment;
经过计算得到后车系统的的脉冲宽度T2并通过转向控制装置控制转向,后车系统的转向控制装置的转动角度α2'与后车系统的脉冲宽度T2的关系计算公式为:After calculating the pulse width T2 of the rear vehicle system and controlling the steering through the steering control device, the calculation formula for the relationship between the rotation angle α 2 ' of the steering control device of the rear vehicle system and the pulse width T2 of the rear vehicle system is :
其中T2为正脉冲宽度(ms);α2'为后车系统的转向控制装置的转动角度;脉冲周期为20msAmong them, T 2 is the positive pulse width (ms); α 2 ' is the rotation angle of the steering control device of the rear vehicle system; the pulse period is 20ms
之后用主控设备的脉冲计数器来捕捉脉冲并计数,开启定时中断,就可以测得定时中断的周期p之内的脉冲数xThen use the pulse counter of the main control device to capture and count the pulses, turn on the timer interrupt, and you can measure the number of pulses x within the period p of the timer interrupt
后车系统在m时刻的实际速度v2(m)计算公式: The calculation formula of the actual speed v 2 (m) of the following vehicle system at time m:
其中x是脉冲个数,a是测速装置输入端测速齿轮的齿数,d'是后车后轮直径,b'是后车后轴齿轮齿数,c是测速装置转动一圈所产生的脉冲数,p是定时中断的周期;Among them, x is the number of pulses, a is the number of teeth of the speed measuring gear at the input end of the speed measuring device, d' is the diameter of the rear wheel of the rear car, b' is the number of teeth of the rear axle gear of the rear car, and c is the number of pulses generated by one rotation of the speed measuring device. p is the period of the timer interrupt;
再经过增量式PID控制:Then through incremental PID control:
由于实际速度与目标速度总有偏差,使用增量式PID速度调节提高车速的稳定性,减小实际速度与目标速度的偏差,在m时刻将测速装置获取的后车系统在m时刻的实际速度v2(m)与前车系统当前时刻的目标速度v进行比例环节和积分环节的调整;Since there is always a deviation between the actual speed and the target speed, the incremental PID speed adjustment is used to improve the stability of the vehicle speed, reduce the deviation between the actual speed and the target speed, and obtain the actual speed of the rear vehicle system at the time m from the speed measuring device v 2 (m) is adjusted with the target speed v of the vehicle in front at the current moment in the proportional link and the integral link;
设m时刻电机电压um为控制量,增量式PID输出的控制量的增量为△um,则m-1时刻电机电压为um-1,增量式PID输出的是控制量的增量为△um-1;Let the motor voltage u m at time m be the control quantity, and the increment of the control quantity output by the incremental PID is △u m , then the motor voltage at time m-1 is u m-1 , and the output of the incremental PID is the control quantity The increment is △u m-1 ;
因此电机电压应是um=um-1+△um So the motor voltage should be u m =u m-1 +△u m
增量式PID输出的是控制量的增量△um=um-um-1=A(em-em-1)+Bem+C(em-2em-1+em-2);Incremental PID output is the increment of control quantity △u m =u m -u m-1 =A(e m -e m-1 )+Be m +C(e m -2e m-1 +e m -2 );
前车系统当前时刻的目标速度v和后车系统在m时刻的实际速度v2(m)的差值为em=v-v2(m),em-1=v-v2(m-1),em-2=v-v2(m-2)A,B,C为待定参数;The difference between the target speed v of the front vehicle system at the current moment and the actual speed v 2 (m) of the rear vehicle system at time m is em =vv 2 (m), em -1 =vv 2 (m-1), e m-2 =vv 2 (m-2)A, B, C are undetermined parameters;
待定参数A,B,C的取值按以下方法:The values of the undetermined parameters A, B, and C are as follows:
先把待定参数B,C设定为0,把待定参数A从0开始逐渐增大,不断地运行前车系统或后车系统,直到前车系统或后车系统刚好发生超调,待定参数A设为前车系统或后车系统刚好发生超调时的60%到80%;First set the undetermined parameters B and C to 0, and gradually increase the undetermined parameter A from 0, and continuously run the front vehicle system or the rear vehicle system until the front vehicle system or the rear vehicle system just happens to overshoot, and the undetermined parameter A Set it to 60% to 80% of when the front vehicle system or the rear vehicle system just happens to overshoot;
然后参数A不变,把待定参数B从0开始逐渐增大,不断地运行前车系统或后车系统,直到前车系统或后车系统刚好发生超调,待定参数B设为前车系统或后车系统刚好发生超调时的60%到80%;Then the parameter A remains unchanged, and the undetermined parameter B is gradually increased from 0, and the front vehicle system or the rear vehicle system is continuously operated until the front vehicle system or the rear vehicle system just happens to overshoot, and the undetermined parameter B is set to the front vehicle system or 60% to 80% of when the rear vehicle system just happens to overshoot;
最后待定参数C设为0;The last undetermined parameter C is set to 0;
步骤十:后车系统的无线通信装置把后车系统在m时刻的实际速度v2(m)和后车系统在m时刻的所走的路程S2(m)发送给PC机并在PC机上显示。Step 10: The wireless communication device of the rear vehicle system sends the actual speed v 2 (m) of the rear vehicle system at time m and the distance S 2 (m) traveled by the rear vehicle system at time m to the PC, and the information is displayed on the PC. show.
本发明的有益效果在于:The beneficial effects of the present invention are:
1.通过PC机操作系统软件,使用者可以根据实际情况、实验需要设定前车的目标转角和目标速度;同时使用者可以形象直观地了解智能双车的行驶状态。1. Through the PC operating system software, the user can set the target corner and target speed of the vehicle in front according to the actual situation and experimental needs; at the same time, the user can intuitively understand the driving status of the smart dual vehicle.
2.通过PC机无线通信装置与智能双车间的通信,可以实现根据使用者的意愿进行相关的调试。2. Through the communication between the PC wireless communication device and the intelligent double workshop, relevant debugging can be realized according to the user's wishes.
3.通过双车间通信,可以使前车系统将自身的参数及状况及时发送给后车系统,使后车系统通过计算处理实现智能双车的通信及跟随。3. Through the two-car communication, the front vehicle system can send its own parameters and status to the rear vehicle system in time, so that the rear vehicle system can realize the communication and follow-up of the intelligent two vehicles through calculation and processing.
4.本发明操作简单,易于调试,使使用者易于掌握主控设备工作原理、无线通信装置通信原理,可以生动直观的展示智能车控制的结果,有助于提高学生的学习兴趣。4. The invention is easy to operate and easy to debug, so that users can easily grasp the working principle of the main control equipment and the communication principle of the wireless communication device, and can vividly and intuitively display the results of smart car control, which helps to improve students' interest in learning.
附图说明:Description of drawings:
图1是本发明所述的智能双车通信及跟随教学实验装置的前车系统和后车系统的各部件连接关系示意图;Fig. 1 is a schematic diagram of the connection relationship of each component of the front vehicle system and the rear vehicle system of the intelligent two-vehicle communication and following teaching experimental device of the present invention;
图2是本发明所述的智能双车通信及跟随教学实验装置的前车系统的整体物理结构示意图;Fig. 2 is a schematic diagram of the overall physical structure of the front vehicle system of the intelligent two-vehicle communication and following teaching experimental device of the present invention;
图3是本发明所述的智能双车通信及跟随教学实验装置的后车系统的整体物理结构示意图;Fig. 3 is a schematic diagram of the overall physical structure of the rear vehicle system of the intelligent two-vehicle communication and following teaching experimental device of the present invention;
图4是本发明所述的智能双车通信及跟随教学实验方法的流程框图;Fig. 4 is the block flow diagram of intelligent two-vehicle communication of the present invention and following teaching experiment method;
图中:1.主控设备,2.电源供压装置,3.直流电机驱动装置,4.转向控制装置,5.无线通信装置,6.液晶屏,7.测速装置,8.测距装置,9.拨码开关及按键装置,10.电池。In the figure: 1. Main control equipment, 2. Power supply device, 3. DC motor drive device, 4. Steering control device, 5. Wireless communication device, 6. LCD screen, 7. Speed measuring device, 8. Distance measuring device , 9. DIP switch and key device, 10. Battery.
具体实施方式:Detailed ways:
前车系统包括主控设备1、电源供压装置2、直流电机驱动装置3、转向控制装置4、无线通信装置5、液晶屏6、测速装置7、测距装置8、拨码开关及按键装置9和PC机,主控设备1信号接口与直流电机驱动装置3、转向控制装置4、无线通信装置5、液晶屏6、测速装置7、测距装置8、拨码开关及按键装置9的信号接口相连,主控设备1、无线通信装置5、测速装置7、测距装置8、拨码开关及按键装置9、液晶屏6、转向控制装置4和直流电机驱动装置3的电压输入接口分别与电源供压装置2连接以获取电压,直流电机驱动装置3输出端齿轮与车体后轮齿轮啮合,转向控制装置4输出端通过拉杆与车体前轮转向节相连,测速装置7输入端测速齿轮与车体后轮齿轮啮合;The front vehicle system includes main control equipment 1, power supply device 2, DC motor drive device 3, steering control device 4, wireless communication device 5, LCD screen 6, speed measuring device 7, distance measuring device 8, dial switch and key device 9 and PC, signal interface of main control equipment 1 and signals of DC motor drive device 3, steering control device 4, wireless communication device 5, LCD screen 6, speed measuring device 7, distance measuring device 8, dial switch and key device 9 The main control device 1, the wireless communication device 5, the speed measuring device 7, the distance measuring device 8, the dial switch and the key device 9, the liquid crystal screen 6, the steering control device 4 and the voltage input interface of the DC motor drive device 3 are respectively connected to the The power supply voltage device 2 is connected to obtain voltage, the gear at the output end of the DC motor drive device 3 meshes with the rear wheel gear of the car body, the output end of the steering control device 4 is connected with the steering knuckle of the front wheel of the car body through a pull rod, and the speed measuring device 7 is at the input end of the speed measuring gear Mesh with the rear wheel gear of the car body;
主控设备1中有计时器,脉冲宽度调制器,脉冲累加器,定时中断器;The main control device 1 has a timer, a pulse width modulator, a pulse accumulator, and a timing interrupter;
后车系统的结构和各部件之间的连接关系与上述的前车系统相同,前车系统中的测距装置8悬置且贴合在前车车体后端上,后车系统中的测距装置8悬置且贴合在后车的舵机上;The structure of the rear vehicle system and the connection relationship between the components are the same as the above-mentioned front vehicle system. The distance measuring device 8 in the front vehicle system is suspended and attached to the rear end of the front vehicle body. Suspended from the device 8 and attached to the steering gear of the rear car;
PC机可以通过无线通信装置5与前车系统和后车系统进行通信。The PC can communicate with the front vehicle system and the rear vehicle system through the wireless communication device 5 .
所述电源供压装置2包括电池10、5V稳压模块、3.3V稳压模块、6V稳压模块、12V稳压模块、测压模块,电池10与5V稳压模块、6V稳压模块的输入接口相接,5V稳压模块输出接口与3.3V稳压模块、12V稳压模块的输入接口相接,测压模块输入接口与电池10相连,电源供压装置2的5V稳压模块的输出接口与主控设备1、无线通信装置5、测速装置7、测距装置8、拨码开关及按键装置9的电压输入接口相连;电源供压装置2的3.3V稳压模块的输出接口与液晶屏6的电压输入接口相连;电源供压装置2的6V稳压模块的输出接口与转向控制装置4的电压输入接口相连;电源供压装置2的12V稳压模块的输出接口与直流电机驱动装置3的电压输入接口相连。The power supply device 2 includes a battery 10, a 5V voltage stabilizing module, a 3.3V voltage stabilizing module, a 6V voltage stabilizing module, a 12V voltage stabilizing module, a pressure measuring module, and the input of the battery 10 and the 5V voltage stabilizing module and the 6V voltage stabilizing module The interfaces are connected, the output interface of the 5V voltage stabilizing module is connected with the input interface of the 3.3V voltage stabilizing module and the 12V voltage stabilizing module, the input interface of the pressure measuring module is connected with the battery 10, and the output interface of the 5V voltage stabilizing module of the power supply device 2 It is connected with the voltage input interface of the main control equipment 1, the wireless communication device 5, the speed measuring device 7, the distance measuring device 8, the dial switch and the key device 9; The voltage input interface of 6 is connected; the output interface of the 6V regulator module of the power supply device 2 is connected with the voltage input interface of the steering control device 4; the output interface of the 12V regulator module of the power supply device 2 is connected with the DC motor drive device 3 connected to the voltage input interface.
所述电源供压装置2的5V稳压模块应用的主要芯片为LM2940或TPS7350;3.3V稳压模块应用的主要芯片为AMS1117、TPS7333;6V稳压模块应用的主要芯片为LM2941或LM2956;12V稳压模块应用的主要芯片为MC34063。The main chips used in the 5V voltage stabilizing module of the power supply voltage supply device 2 are LM2940 or TPS7350; the main chips used in the 3.3V voltage stabilizing module are AMS1117 and TPS7333; The main chip used in the compression module is MC34063.
所述直流电机驱动装置3,包括驱动电路模块和直流电机。The DC motor drive device 3 includes a drive circuit module and a DC motor.
驱动电路模块,电压输入接口与12V稳压模块的输出接口相接,信号输入接口与主控设备1脉冲宽度调制器接口相接,输出接口与直流电机输入接口相接。驱动电路模块,采用H桥4mos管方案,采用双IR2104驱动方案。In the drive circuit module, the voltage input interface is connected to the output interface of the 12V voltage stabilizing module, the signal input interface is connected to the main control device 1 pulse width modulator interface, and the output interface is connected to the DC motor input interface. The drive circuit module adopts the H-bridge 4mos tube scheme and the dual IR2104 drive scheme.
直流电机输入接口与驱动电路模块输出接口相接,输出端齿轮与智能车车体后轮齿轮啮合。The input interface of the DC motor is connected with the output interface of the drive circuit module, and the gear at the output end meshes with the rear wheel gear of the smart car body.
所述转向控制装置4,应用舵机实现转向控制。The steering control device 4 uses a steering gear to realize steering control.
舵机,电压输入接口与6V稳压模块的输出接口相接,信号输入接口与主控设备1外设接口脉冲宽度调制器相接,输出端通过拉杆与智能车车体前轮转向节相连。For the steering gear, the voltage input interface is connected to the output interface of the 6V voltage regulator module, the signal input interface is connected to the pulse width modulator of the peripheral interface of the main control device 1, and the output end is connected to the front wheel steering knuckle of the smart car body through a tie rod.
所述无线通信装置5,电压输入接口与5V稳压模块的输出接口相接,信号输入接口与主控设备1外设接口异步串行接口相接,无线通信装置5与PC机进行通信。In the wireless communication device 5, the voltage input interface is connected to the output interface of the 5V voltage stabilizing module, the signal input interface is connected to the asynchronous serial interface of the peripheral interface of the main control device 1, and the wireless communication device 5 communicates with the PC.
所述液晶屏6,电压输入接口与3.3V稳压模块的输出接口相接,信号输入接口与主控设备1外设接口I/O接口相接。The liquid crystal screen 6 is connected to the voltage input interface with the output interface of the 3.3V voltage stabilizing module, and the signal input interface is connected to the I/O interface of the peripheral interface of the main control device 1 .
所述测速装置7,采用光电编码器作为测速装置7。The speed measuring device 7 adopts a photoelectric encoder as the speed measuring device 7.
所述测距装置8,电压输入接口与5V稳压模块的输出接口相接,信号输出接口主控设备1外设接口模数转化模块相连。The voltage input interface of the distance measuring device 8 is connected to the output interface of the 5V voltage stabilizing module, and the signal output interface is connected to the analog-to-digital conversion module of the peripheral interface of the main control device 1 .
所述拨码开关及按键装置9,电压输入接口与5V稳压模块的输出接口相接,信号输出接口主控设备1外设接口I/O接口相连。The dial switch and key device 9 are connected to the voltage input interface with the output interface of the 5V voltage stabilizing module, and the signal output interface is connected to the peripheral interface I/O interface of the main control device 1 .
所述的智能双车跟随及通信实验方法,步骤如下:The steps of the intelligent two-vehicle following and communication experiment method are as follows:
步骤一:前后车初始测距Step 1: Initial distance measurement of front and rear vehicles
前车系统和后车系统中的测距装置8配合工作,利用超声波的发送和接收测量两车之间的距离,其中一个脉冲高电平时间表示超声波从前车到后车的传播时间,使用主控设备1中的计时器测得的脉冲高电平的时间;The distance measuring device 8 in the front vehicle system and the rear vehicle system cooperates to use ultrasonic transmission and reception to measure the distance between the two vehicles. One of the pulse high level time represents the propagation time of the ultrasonic wave from the front vehicle to the rear vehicle. The time of the pulse high level measured by the timer in the control device 1;
两车之间初始距离计算公式:The formula for calculating the initial distance between two vehicles:
初始距离L0=t×vvoice Initial distance L 0 =t×v voice
其中t是主控设备1所测得的脉冲高电平时间,vvoice是声速,取340m/sAmong them, t is the pulse high level time measured by the main control device 1, and v voice is the speed of sound, which is 340m/s
步骤二:前车系统获取PC机设定的前车系统当前时刻目标速度v和前车系统当前时刻的目标打角α:Step 2: The front vehicle system obtains the target speed v of the front vehicle system at the current moment and the target angle α of the front vehicle system at the current moment set by the PC:
PC机给前车系统的无线通信装置5发送信号,前车系统获取使用者在PC机上位机上设定的前车系统当前时刻目标速度v和前车系统当前时刻的目标打角α;The PC sends a signal to the wireless communication device 5 of the front vehicle system, and the front vehicle system obtains the target speed v of the front vehicle system at the current moment and the target angle α of the front vehicle system at the current moment set by the user on the PC host computer;
步骤三:前车系统转向控制装置4对转动角度的控制Step 3: The steering control device 4 of the front vehicle system controls the rotation angle
前车系统将接收到的前车系统当前时刻的目标打角α经过计算得到前车系统的脉冲宽度T1并通过主控设备1的脉冲宽度调制器控制转向控制装置4转动,前车系统的转向控制装置4的转动角度α1'与前车系统的脉冲宽度T1的关系计算公式为:The front vehicle system calculates the received target angle α of the front vehicle system at the current moment to obtain the pulse width T 1 of the front vehicle system, and controls the rotation of the steering control device 4 through the pulse width modulator of the main control device 1. The formula for calculating the relationship between the rotation angle α 1 ′ of the steering control device 4 and the pulse width T 1 of the preceding vehicle system is:
其中T1为前车系统的脉冲宽度,单位为ms;α1'为前车系统的转向控制装置4的转动角度,脉冲周期为20ms;Where T 1 is the pulse width of the front vehicle system, the unit is ms; α 1 ' is the rotation angle of the steering control device 4 of the front vehicle system, and the pulse period is 20ms;
步骤四:前车系统通过前车系统中的测速装置7获取前车系统在n时刻的实际速度v1(n)Step 4: The front vehicle system obtains the actual speed v 1 (n) of the front vehicle system at time n through the speed measuring device 7 in the front vehicle system
用主控设备1的脉冲累加器来捕捉脉冲并计数,开启定时中断器,就可以测得定时中断的周期p之内的脉冲数xUse the pulse accumulator of the main control device 1 to capture and count the pulses, and turn on the timer interrupter to measure the number of pulses x within the period p of the timer interrupt
前车系统在n时刻的实际速度v1(n)计算公式: The formula for calculating the actual speed v 1 (n) of the preceding vehicle system at time n:
其中x是脉冲个数,a是测速装置7输入端测速齿轮的齿数,d是前车后轮直径,b是前车后轴齿轮齿数,c是测速装置转动一圈所产生的脉冲数,p是定时中断的周期;Where x is the number of pulses, a is the number of teeth of the speed measuring gear at the input end of the speed measuring device 7, d is the diameter of the front and rear wheels, b is the number of teeth of the front and rear axle gears, c is the number of pulses generated by the speed measuring device rotating one revolution, p is the period of the timer interrupt;
步骤五:将前车系统从0到n时刻为止各个时刻的实际速度v1(0),v1(1),······v1(n)积分得到前车系统从0到n时刻为止所走过的路程S1(n)Step 5: Integrate the actual speed v 1 (0), v 1 (1), v 1 (n) of the preceding vehicle system from 0 to n at each moment to obtain the preceding vehicle system from 0 to n The distance traveled so far S 1 (n)
主控设备1所计算出的前车系统的实际速度为离散变量v1(i),其中v1(i)为前车系统在i时刻的实际速度,其中i时刻为从0时刻到n时刻这一时间段中的任一时刻,故积分公式简化为即只需把前车从0到n时刻为止各个时刻的实际速度求和就能得到前车系统从0到n时刻为止前车系统所走的路程S1(n);The actual speed of the vehicle in front calculated by the main control device 1 is a discrete variable v 1 (i), where v 1 (i) is the actual speed of the vehicle in front at time i, where time i is from time 0 to time n At any moment in this time period, the integral formula is simplified as That is, the distance S 1 (n) traveled by the vehicle in front from 0 to time n can be obtained by simply summing the actual speeds of the vehicle in front at each time from 0 to time n;
步骤六:通过增量式PID控制,使前车系统在n+1时刻的实际速度v1(n+1)接近预定的前车系统当前时刻目标速度v;Step 6: Make the actual speed v 1 (n+1) of the preceding vehicle system at time n+1 close to the predetermined current moment target speed v of the preceding vehicle system through incremental PID control;
增量式PID控制:Incremental PID control:
由于实际速度与目标速度总有偏差,使用增量式PID速度调节提高车速的稳定性,减小实际速度与目标速度的偏差,在n时刻将测速装置7获取的前车系统在n时刻的实际速度v1(n)与前车系统当前时刻目标速度v进行比例环节和积分环节的调整;Since there is always a deviation between the actual speed and the target speed, the incremental PID speed adjustment is used to improve the stability of the vehicle speed and reduce the deviation between the actual speed and the target speed. The speed v 1 (n) and the target speed v of the vehicle in front at the current moment are adjusted by the proportional link and the integral link;
设n时刻电机电压un为控制量,增量式PID输出的控制量的增量为△un,则n-1时刻电机电压为un-1,增量式PID输出的是控制量的增量为△un-1;Let the motor voltage u n at time n be the control quantity, and the increment of the control quantity output by the incremental PID is △u n , then the motor voltage at time n-1 is un -1 , and the output of the incremental PID is the control quantity The increment is △u n-1 ;
因此电机电压应是un=un-1+△un So the motor voltage should be u n =u n-1 +△u n
增量式PID输出的是控制量的增量△un=un-un-1=A(en-en-1)+Ben+C(en-2en-1+en-2);Incremental PID output is the increment of control quantity △u n =un -u n -1 =A(e n -e n-1 )+Be n +C(e n -2e n-1 +e n -2 );
前车系统当前时刻目标速度v和前车系统在n时刻的实际速度v1(n)的差值为en=v-v1(n),en-1=v-v1(n-1),en-2=v-v1(n-2)A,B,C为待定参数;The difference between the current target speed v of the vehicle in front and the actual speed v 1 (n) of the vehicle in front at time n is en =vv 1 (n), e n -1 =vv 1 (n-1),e n-2 =vv 1 (n-2)A, B, C are undetermined parameters;
待定参数A,B,C的取值按以下方法:The values of the undetermined parameters A, B, and C are as follows:
先把待定参数B,C设定为0,把待定参数A从0开始逐渐增大,不断地运行前车系统或后车系统,直到前车系统或后车系统刚好发生超调,待定参数A设为前车系统或后车系统刚好发生超调时的60%到80%;First set the undetermined parameters B and C to 0, and gradually increase the undetermined parameter A from 0, and continuously run the front vehicle system or the rear vehicle system until the front vehicle system or the rear vehicle system just happens to overshoot, and the undetermined parameter A Set it to 60% to 80% of when the front vehicle system or the rear vehicle system just happens to overshoot;
然后参数A不变,把待定参数B从0开始逐渐增大,不断地运行前车系统或后车系统,直到前车系统或后车系统刚好发生超调,待定参数B设为前车系统或后车系统刚好发生超调时的60%到80%;Then the parameter A remains unchanged, and the undetermined parameter B is gradually increased from 0, and the front vehicle system or the rear vehicle system is continuously operated until the front vehicle system or the rear vehicle system just happens to overshoot, and the undetermined parameter B is set to the front vehicle system or 60% to 80% of when the rear vehicle system just happens to overshoot;
最后待定参数C设为0;The last undetermined parameter C is set to 0;
步骤七:前车系统通过无线通信装置5,给后车系统发送前车系统当前时刻目标速度v,前车系统当前时刻的目标打角α以及前车系统从0到n时刻为止前车系统所走的路程S1(n):Step 7: The front vehicle system sends the current target speed v of the front vehicle system to the rear vehicle system through the wireless communication device 5, the current target angle α of the front vehicle system at the current moment, and the current speed of the front vehicle system from 0 to n. Distance traveled S 1 (n):
前车系统将从PC机接收到的全部数据包括前车系统当前时刻目标速度v,前车系统当前时刻的目标打角α以及前车系统从0到n时刻为止前车系统所走的路程S1(n),通过前车系统和后车系统中的无线通信装置5发送给后车系统;All the data that the preceding vehicle system will receive from the PC include the target speed v of the preceding vehicle system at the current moment, the target angle α of the preceding vehicle system at the current moment, and the distance S traveled by the preceding vehicle system from 0 to n moments 1 (n), sent to the rear vehicle system by the wireless communication device 5 in the front vehicle system and the rear vehicle system;
后车系统接收到前车系统当前时刻的目标打角α和前车系统从0到n时刻为止前车系统所走的路程S1(n)后,由于前车系统不同时刻的目标打角α的值是不同的,将不同时刻的α的值以数组的形式保存,使α(n)=α;After the rear vehicle system receives the target angle α of the front vehicle system at the current moment and the distance S 1 (n) traveled by the front vehicle system from 0 to time n, due to the target angle α of the front vehicle system at different times The value of is different, and the value of α at different moments is saved in the form of an array, so that α(n)=α;
其中α(n)是的前车系统在n时刻的目标打角,且α(n)和S1(n)一一对应Where α(n) is the target angle of the preceding vehicle system at time n, and α(n) corresponds to S 1 (n) one-to-one
步骤八:后车系统根据自己所在位置,调整后车系统当前时刻的目标打角α2 Step 8: The rear vehicle system adjusts the current target angle α 2 of the rear vehicle system according to its own location
后车速度积分得到后车到m时刻为止后车所走过的路程S2(m)The speed integral of the following vehicle obtains the distance S 2 (m) traveled by the following vehicle up to time m
由积分公式得到后车路程S2(m)by integral formula Get the distance of the rear vehicle S 2 (m)
由步骤一测得前后车初始距离L0,再测出后车车身的长度X2,因此后车的初始路程为-(L0+X2),后车路程S2在-(L0+X2)到0之间舵机打角为0,后车路程S2>0之后按照前车发来的数据行驶;Measure the initial distance L 0 of the front and rear vehicles from step 1, and then measure the body length X 2 of the rear vehicle, so the initial distance of the rear vehicle is -(L 0 +X 2 ), and the distance S 2 of the rear vehicle is -(L 0 + Between X 2 ) and 0, the angle of the steering gear is 0, and the distance of the rear vehicle S 2 >0, then drive according to the data sent by the vehicle in front;
后车系统接收到的前车路程S1和后车计算得到的后车路程S2都是离散的,所以在m时刻后车系统计算得到的后车路程S2(m)可能是在已接收并保存的两个相邻路程S1(n)和S1(n+1)之间,后车系统将取所保存的两个路程所对应的两个目标打角取平均值后作为后车系统当前时刻的目标打角α2;The distance S 1 of the vehicle ahead received by the vehicle system behind and the distance S 2 of the vehicle behind calculated by the vehicle behind are both discrete, so the distance S 2 (m) of the vehicle behind calculated by the vehicle system behind at time m may be the Between the two adjacent distances S 1 (n) and S 1 (n+1) saved, the trailing vehicle system will take the average value of the two target angles corresponding to the stored two distances as the trailing vehicle The target angle α 2 of the system at the current moment;
例如:m时刻后车系统检测到自己的当前路程为S2(m),而后车系统通过步骤七接收到的前车路程S1内最接近S2(m)的有两组数据S1(n)、S1(n+1),其中,S1(n)为前车系统从0到n时刻为止前车系统所走的路程,S1(n+1)为前车系统从0到n+1时刻为止前车系统所走的路程For example: at time m, the following vehicle system detects that its current distance is S 2 (m), and the following vehicle system receives two sets of data S 1 ( n), S 1 (n+1), wherein, S 1 (n) is the distance traveled by the vehicle in front from 0 to moment n, and S 1 (n+1) is the distance traveled by the vehicle in front from 0 to time n. The distance traveled by the vehicle in front until time n+1
与前车系统从0到n时刻为止前车系统所走的路程S1(n)对应的打角是前车系统在n时刻的目标打角α(n);The angle corresponding to the distance S 1 (n) traveled by the vehicle in front from 0 to time n is the target angle α(n) of the vehicle in front at time n;
与前车系统从0到n+1时刻为止前车系统所走的路程S1(n+1)对应的打角是前车系统在n+1时刻的目标打角α(n+1);The angle corresponding to the distance S 1 (n+1) traveled by the vehicle in front from 0 to time n+1 is the target angle α(n+1) of the vehicle in front at time n+1;
则后车系统当前时刻的目标打角α2满足以下关系:Then the target angle α 2 of the rear vehicle system at the current moment satisfies the following relationship:
α2=α(n) (S2(m)=S1(n))α 2 =α(n) (S 2 (m)=S 1 (n))
α2=(α(n)+α(n+1))/2 (S1(n)<S2(m)<S1(n+1))α 2 =(α(n)+α(n+1))/2 (S 1 (n)<S 2 (m)<S 1 (n+1))
α2=α(n+1) (S2(m)=S1(n+1))α 2 =α(n+1) (S 2 (m)=S 1 (n+1))
步骤九:后车系统根据后车系统m时刻的目标打角α2控制转向控制装置4实现转向,根据前车系统m时刻的目标速度v和后车系统在m时刻的实际速度v2(m)通过PID调节控制智能车m+1时刻的实际速度v2(m+1);Step 9: The rear vehicle system controls the steering control device 4 to realize steering according to the target angle α 2 of the rear vehicle system at time m, and realizes steering according to the target speed v of the front vehicle system at time m and the actual speed v 2 (m ) control the actual speed v 2 (m+1) of the smart car at the moment m+1 through PID regulation;
经过计算得到后车系统的的脉冲宽度T2并通过转向控制装置4控制转向,后车系统的转向控制装置4的转动角度α2'与后车系统的脉冲宽度T2的关系计算公式为:After calculation, the pulse width T2 of the rear vehicle system is obtained and the steering is controlled by the steering control device 4. The calculation formula for the relationship between the rotation angle α2 ' of the steering control device 4 of the rear vehicle system and the pulse width T2 of the rear vehicle system is:
其中T2为正脉冲宽度(ms);α2'为后车系统的转向控制装置4的转动角度;脉冲周期为20msWherein T 2 is the positive pulse width (ms); α 2 ' is the rotation angle of the steering control device 4 of the rear vehicle system; the pulse period is 20ms
之后用主控设备1的脉冲计数器来捕捉脉冲并计数,开启定时中断,就可以测得定时中断的周期p之内的脉冲数xThen use the pulse counter of the main control device 1 to capture and count the pulses, and turn on the timing interrupt to measure the number of pulses x within the period p of the timing interrupt.
后车系统在m时刻的实际速度v2(m)计算公式: The calculation formula of the actual speed v 2 (m) of the following vehicle system at time m:
其中x是脉冲个数,a是测速装置7输入端测速齿轮的齿数,d'是后车后轮直径,b'是后车后轴齿轮齿数,c是测速装置转动一圈所产生的脉冲数,p是定时中断的周期;Where x is the number of pulses, a is the number of teeth of the speed measuring gear at the input end of the speed measuring device 7, d' is the diameter of the rear wheel of the rear car, b' is the number of teeth of the rear axle gear of the rear car, and c is the number of pulses generated by the speed measuring device rotating one revolution , p is the period of the timer interrupt;
再经过增量式PID控制:Then through incremental PID control:
由于实际速度与目标速度总有偏差,使用增量式PID速度调节提高车速的稳定性,减小实际速度与目标速度的偏差,在m时刻将测速装置7获取的后车系统在m时刻的实际速度v2(m)与前车系统当前时刻的目标速度v进行比例环节和积分环节的调整;Since there is always a deviation between the actual speed and the target speed, the incremental PID speed adjustment is used to improve the stability of the vehicle speed and reduce the deviation between the actual speed and the target speed. The speed v 2 (m) is adjusted with the target speed v of the vehicle in front at the current moment in the proportional link and the integral link;
设m时刻电机电压um为控制量,增量式PID输出的控制量的增量为△um,则m-1时刻电机电压为um-1,增量式PID输出的是控制量的增量为△um-1;Let the motor voltage u m at time m be the control quantity, and the increment of the control quantity output by the incremental PID is △u m , then the motor voltage at time m-1 is u m-1 , and the output of the incremental PID is the control quantity The increment is △u m-1 ;
因此电机电压应是um=um-1+△um So the motor voltage should be u m =u m-1 +△u m
增量式PID输出的是控制量的增量△um=um-um-1=A(em-em-1)+Bem+C(em-2em-1+em-2);Incremental PID output is the increment of control quantity △u m =u m -u m-1 =A(e m -e m-1 )+Be m +C(e m -2e m-1 +e m -2 );
前车系统当前时刻的目标速度v和后车系统在m时刻的实际速度v2(m)的差值为em=v-v2(m),em-1=v-v2(m-1),em-2=v-v2(m-2)A,B,C为待定参数;The difference between the target speed v of the front vehicle system at the current moment and the actual speed v 2 (m) of the rear vehicle system at time m is em =vv 2 (m), em -1 =vv 2 (m-1), e m-2 =vv 2 (m-2)A, B, C are undetermined parameters;
待定参数A,B,C的取值按以下方法:The values of the undetermined parameters A, B, and C are as follows:
先把待定参数B,C设定为0,把待定参数A从0开始逐渐增大,不断地运行前车系统或后车系统,直到前车系统或后车系统刚好发生超调,待定参数A设为前车系统或后车系统刚好发生超调时的60%到80%;First set the undetermined parameters B and C to 0, and gradually increase the undetermined parameter A from 0, and continuously run the front vehicle system or the rear vehicle system until the front vehicle system or the rear vehicle system just happens to overshoot, and the undetermined parameter A Set it to 60% to 80% of when the front vehicle system or the rear vehicle system just happens to overshoot;
然后参数A不变,把待定参数B从0开始逐渐增大,不断地运行前车系统或后车系统,直到前车系统或后车系统刚好发生超调,待定参数B设为前车系统或后车系统刚好发生超调时的60%到80%;Then the parameter A remains unchanged, and the undetermined parameter B is gradually increased from 0, and the front vehicle system or the rear vehicle system is continuously operated until the front vehicle system or the rear vehicle system just happens to overshoot, and the undetermined parameter B is set to the front vehicle system or 60% to 80% of when the rear vehicle system just happens to overshoot;
最后待定参数C设为0;The last undetermined parameter C is set to 0;
步骤十:后车系统的无线通信装置5把后车系统在m时刻的实际速度v2(m)和后车系统在m时刻的所走的路程S2(m)发送给PC机并在PC机上显示。Step 10: The wireless communication device 5 of the rear vehicle system sends the actual speed v 2 (m) of the rear vehicle system at time m and the distance S 2 (m) traveled by the rear vehicle system at time m to the PC, and transmits it to the PC. displayed on the machine.
Claims (2)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610117473.9A CN105551345B (en) | 2016-03-02 | 2016-03-02 | The double cars of intelligence communicate and followed experiment device for teaching and experimental method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610117473.9A CN105551345B (en) | 2016-03-02 | 2016-03-02 | The double cars of intelligence communicate and followed experiment device for teaching and experimental method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105551345A CN105551345A (en) | 2016-05-04 |
CN105551345B true CN105551345B (en) | 2018-03-02 |
Family
ID=55830511
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610117473.9A Expired - Fee Related CN105551345B (en) | 2016-03-02 | 2016-03-02 | The double cars of intelligence communicate and followed experiment device for teaching and experimental method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105551345B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111595595A (en) * | 2020-06-03 | 2020-08-28 | 上海机动车检测认证技术研究中心有限公司 | Intelligent driving test system |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1746801A (en) * | 2005-07-18 | 2006-03-15 | 李胜强 | Automatic driving system of vehicle |
CN102673561A (en) * | 2011-12-20 | 2012-09-19 | 河南科技大学 | Tailgating prevention system and method for automobile |
CN103129556A (en) * | 2011-11-22 | 2013-06-05 | 罗伯特·博世有限公司 | Driving assistance system |
CN104554264A (en) * | 2014-11-28 | 2015-04-29 | 温州大学 | Method and system for self-adaptively on-line adjusting vehicle speed |
DE102013226773A1 (en) * | 2013-12-19 | 2015-06-25 | Volkswagen Aktiengesellschaft | Apparatus, method and computer program for assisting a course change of a vehicle |
CN204595513U (en) * | 2015-03-20 | 2015-08-26 | 重庆交通大学 | Based on the Intelligent transport fleet with theory of speeding |
CN205722518U (en) * | 2016-03-02 | 2016-11-23 | 吉林大学 | The double car communication of intelligence and follow experiment device for teaching |
-
2016
- 2016-03-02 CN CN201610117473.9A patent/CN105551345B/en not_active Expired - Fee Related
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1746801A (en) * | 2005-07-18 | 2006-03-15 | 李胜强 | Automatic driving system of vehicle |
CN103129556A (en) * | 2011-11-22 | 2013-06-05 | 罗伯特·博世有限公司 | Driving assistance system |
CN102673561A (en) * | 2011-12-20 | 2012-09-19 | 河南科技大学 | Tailgating prevention system and method for automobile |
DE102013226773A1 (en) * | 2013-12-19 | 2015-06-25 | Volkswagen Aktiengesellschaft | Apparatus, method and computer program for assisting a course change of a vehicle |
CN104554264A (en) * | 2014-11-28 | 2015-04-29 | 温州大学 | Method and system for self-adaptively on-line adjusting vehicle speed |
CN204595513U (en) * | 2015-03-20 | 2015-08-26 | 重庆交通大学 | Based on the Intelligent transport fleet with theory of speeding |
CN205722518U (en) * | 2016-03-02 | 2016-11-23 | 吉林大学 | The double car communication of intelligence and follow experiment device for teaching |
Also Published As
Publication number | Publication date |
---|---|
CN105551345A (en) | 2016-05-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103170962A (en) | Desktop type double-wheel self-balancing robot | |
CN205028572U (en) | Intelligent vehicle based on bluetooth orientation module and WIFI communication module | |
CN106534476A (en) | Method and system for interactive control of smart-phone and sex toy through Bluetooth | |
CN206664791U (en) | A kind of longitudinal double-wheel self-balancing robot and control system | |
CN105551345B (en) | The double cars of intelligence communicate and followed experiment device for teaching and experimental method | |
CN205087089U (en) | Double round is from balancing trolley based on wireless control | |
CN205722518U (en) | The double car communication of intelligence and follow experiment device for teaching | |
CN202453501U (en) | Radio ultrasonic ranging device with temperature error elimination function | |
CN111216121A (en) | Intelligent industrial robot control system | |
CN105807790A (en) | Intelligent following system based on indoor hybrid positioning and following method thereof | |
CN212207653U (en) | Distance measuring system based on UWB technology | |
CN104308847A (en) | Clock robot system based on internet of things and work method | |
CN104950683A (en) | Self-adaptive gap inverse model generating device for visual servo manipulator system | |
CN106708029A (en) | Intelligent inspection trolley system with low cost | |
CN214586522U (en) | Intelligent servo system integrating PLC (programmable logic controller) and vision or force feedback | |
CN116069019A (en) | The Control System of Multifunctional Intelligent Balance Car and Its Fuzzy Adaptive PID Method | |
CN103529938A (en) | Robot and brain-computer interface | |
CN106875749B (en) | Vehicle driving early warning system and early warning method thereof | |
CN101628572A (en) | Automobile maintenance reminder and residual value calculation display method and vehicle-mounted device | |
CN100590562C (en) | Intelligent electric motor car teeterboard motion balance detection system | |
CN109085373B (en) | Speed testing device and method for CTCS-2 train control vehicle-mounted equipment | |
CN207607376U (en) | A kind of intelligent vehicle monitoring and control device based on Arduino | |
RU175930U1 (en) | Device for changing the load on the steering wheel of a car simulator | |
CN201442546U (en) | On-board device for reminding of vehicle maintenance and computing and displaying residual value | |
CN204323076U (en) | A kind of mine vehicle instrument assembly |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20180302 Termination date: 20190302 |