[go: up one dir, main page]

CN114859700B - Control method, device and system for two-wheeled intelligent balance trolley - Google Patents

Control method, device and system for two-wheeled intelligent balance trolley Download PDF

Info

Publication number
CN114859700B
CN114859700B CN202210563601.8A CN202210563601A CN114859700B CN 114859700 B CN114859700 B CN 114859700B CN 202210563601 A CN202210563601 A CN 202210563601A CN 114859700 B CN114859700 B CN 114859700B
Authority
CN
China
Prior art keywords
value
control
steering
speed
ring
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.)
Active
Application number
CN202210563601.8A
Other languages
Chinese (zh)
Other versions
CN114859700A (en
Inventor
赵亮
马嘉豪
李可心
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xian University of Architecture and Technology
Original Assignee
Xian University of Architecture and Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Xian University of Architecture and Technology filed Critical Xian University of Architecture and Technology
Priority to CN202210563601.8A priority Critical patent/CN114859700B/en
Publication of CN114859700A publication Critical patent/CN114859700A/en
Application granted granted Critical
Publication of CN114859700B publication Critical patent/CN114859700B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B11/00Automatic controllers
    • G05B11/01Automatic controllers electric
    • G05B11/36Automatic controllers electric with provision for obtaining particular characteristics, e.g. proportional, integral, differential
    • G05B11/42Automatic controllers electric with provision for obtaining particular characteristics, e.g. proportional, integral, differential for obtaining a characteristic which is both proportional and time-dependent, e.g. P. I., P. I. D.
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/60Other road transportation technologies with climate change mitigation effect
    • Y02T10/72Electric energy management in electromobility

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Control Of Position, Course, Altitude, Or Attitude Of Moving Bodies (AREA)
  • Motorcycle And Bicycle Frame (AREA)

Abstract

The invention discloses a control method, a device and a system of a two-wheel intelligent balance trolley, wherein the control method combines three PID control algorithms, wherein a PD control is used for an upright ring, a PI control is used for a speed ring, a P control is used for a steering ring, the method breaks away from the traditional single data information to carry out the upright control, the three-axis angular speed and the linear speed information are fused, and the data are fused by adopting a twice filtering algorithm, so that the steering and straight-going accuracy of the two-wheel intelligent balance trolley is ensured while the balance of the two-wheel intelligent balance trolley is maintained, and the control precision of the intelligent balance trolley is greatly improved.

Description

一种两轮智能平衡小车的控制方法、装置及系统A control method, device and system for a two-wheeled intelligent balancing vehicle

技术领域Technical Field

本发明属于平衡小车领域,具体涉及一种两轮智能平衡小车的控制方法、装置及系统。The present invention belongs to the field of balancing cars, and in particular relates to a control method, device and system for a two-wheeled intelligent balancing car.

背景技术Background Art

随着科学技术的不断进步,机器人领域迎来了改革性的发展,移动机器人作为机器人的一个重要分支领域,其具有良好的移动性和稳定性,适用于各种复杂的环境场合。移动机器人可划分为足式机器人、履带式机器人和轮式机器人等,轮式机器人是移动机器人的一种,其广泛应用于物流、工厂等场景,大大节约了人力物力的成本。两轮智能平衡小车因其具有体积小、结构简单和成本低的特点,成为研究的热点,为理论和实验研究提供了应用平台。但智能平衡小车存在稳定性和可靠性不强、成本高和设计复杂的问题。With the continuous progress of science and technology, the field of robotics has ushered in a revolutionary development. As an important branch of robotics, mobile robots have good mobility and stability and are suitable for various complex environments. Mobile robots can be divided into legged robots, tracked robots and wheeled robots. Wheeled robots are a type of mobile robots, which are widely used in logistics, factories and other scenes, greatly saving the cost of manpower and material resources. The two-wheeled intelligent balancing car has become a hot topic of research due to its small size, simple structure and low cost, providing an application platform for theoretical and experimental research. However, the intelligent balancing car has problems such as low stability and reliability, high cost and complex design.

发明内容Summary of the invention

本发明的目的在于克服上述现有技术的缺点,提供一种两轮智能平衡小车的控制方法、装置及系统,以解决现有技术中只能平衡小车稳定性和可靠性不强、成本高和设计复杂的问题。The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a control method, device and system for a two-wheeled intelligent balancing car to solve the problems in the prior art that the balancing car has low stability and reliability, high cost and complex design.

为达到上述目的,本发明采用以下技术方案予以实现:In order to achieve the above object, the present invention adopts the following technical solutions:

一种两轮智能平衡小车的控制方法,其特征在于,A control method for a two-wheeled intelligent balancing vehicle, characterized in that:

获取线速度和角速度,通过线速度和角速度计算获得直立环PD控制量;Obtain the linear velocity and angular velocity, and calculate the PD control amount of the upright ring through the linear velocity and angular velocity;

获取转速信息,转速信息与给定的速度进行计算获得速度偏差,将速度偏差和上一时刻的速度偏差输入至一阶滤波算法中,获得稳定的速度偏差,将稳定的速度偏差值积分后,获得速度偏差的积分值,通过速度偏差的积分值和控制速度量计算获得速度环PI控制量;Obtain the speed information, calculate the speed information and the given speed to obtain the speed deviation, input the speed deviation and the speed deviation at the previous moment into the first-order filtering algorithm to obtain a stable speed deviation, integrate the stable speed deviation value to obtain the integral value of the speed deviation, and calculate the speed loop PI control amount through the integral value of the speed deviation and the control speed amount;

z轴角速度与期望值0作差获得转向偏差值,转向偏差值输入至转向环P中,转向环P的输出与转向值相加获得转向环控制量;The steering deviation value is obtained by subtracting the z-axis angular velocity from the expected value 0, and the steering deviation value is input into the steering ring P. The output of the steering ring P is added to the steering value to obtain the steering ring control amount;

直立环PD控制量、速度环PI控制量和转向环控制量进行加减运算获得EPWM比较寄存器的EPWMA和EPWMB,通过EPWMA和EPWMB控制智能平衡小车。The vertical loop PD control quantity, the speed loop PI control quantity and the steering loop control quantity are added and subtracted to obtain EPWMA and EPWMB of the EPWM comparison register, and the intelligent balancing car is controlled by EPWMA and EPWMB.

本发明的进一步改进在于:A further improvement of the present invention is:

优选的,所述线速度的计算公式为:Preferably, the calculation formula of the linear velocity is:

其中,accelY和accelZ分别为Y和Z方向上的线速度;Among them, accelY and accelZ are the linear velocities in the Y and Z directions respectively;

所述角速度的计算公式为:The calculation formula of the angular velocity is:

GyroX为X方向的角速度,gyroX是X轴的输出值,k的设置与位姿检测模块的初始化有关;GyroX is the angular velocity in the X direction, gyroX is the output value of the X axis, and the setting of k is related to the initialization of the posture detection module;

通过线速度和角速度获得小车相对于X向的倾斜角度:The tilt angle of the car relative to the X direction is obtained by linear velocity and angular velocity:

angle=(1-W)*angleY+W*(GyroX*dt+angle) (3)。angle=(1-W)*angleY+W*(GyroX*dt+angle) (3).

优选的,所述直立环PD控制量的计算公式为:Preferably, the calculation formula of the upright ring PD control amount is:

PD_Control=angle*kp+gryoX*kd (4)PD_Control=angle*kp+gryoX*kd (4)

其中,PD_Control为直立环PD的输出控制量,angle为小车相对于X向的倾斜角角度,kp和kd为常量,gryoX为测量得到X轴的角速度。Among them, PD_Control is the output control value of the upright ring PD, angle is the inclination angle of the car relative to the X direction, kp and kd are constants, and grayoX is the measured angular velocity of the X axis.

优选的,所述速度偏差的计算公式为:Preferably, the calculation formula of the speed deviation is:

EncoderNew=0-(EnocderL+EncoderR) (5)EncoderNew=0-(EnocderL+EncoderR) (5)

其中,EncoderNew为最新速度的偏差值,0为给定的速度值,EncoderL和EncoderR分别为第一增量式霍尔编码器(2)和第二增量式霍尔编码器(3)采集到的信息;Wherein, EncoderNew is the deviation value of the latest speed, 0 is the given speed value, EncoderL and EncoderR are the information collected by the first incremental Hall encoder (2) and the second incremental Hall encoder (3) respectively;

将最新的速度偏差和上一时刻的速度偏差计算获得稳定的速度偏差,计算公式为:The latest speed deviation and the speed deviation at the previous moment are calculated to obtain a stable speed deviation. The calculation formula is:

Encoder=Encoderlast×a+(1-a)×EncoderNewEncoder=Encoder last ×a+(1-a)×EncoderNew

其中,Encdoer为速度偏差值,Encoderlast为上一时刻的速度偏差值,a为系数。Among them, Encdoer is the speed deviation value, Encoder last is the speed deviation value at the previous moment, and a is the coefficient.

优选的,z轴角速度与期望值0作差获得转向偏差值的计算公式为:Preferably, the calculation formula for obtaining the steering deviation value by subtracting the z-axis angular velocity from the expected value 0 is:

TurnBias=0-GryoZTurnBias = 0-GryoZ

其中,TurnBias为转向偏差值,GryoZ为z轴角速度;Among them, TurnBias is the steering bias value, GryoZ is the z-axis angular velocity;

其中,如果手机控制向左转向,则设定左右转向值为正值;如果手机控制向右转向,则设定左右转向值为负值;如果无转向信号,则设定左右转向值为零;If the mobile phone controls the left turn, the left and right turn values are set to positive values; if the mobile phone controls the right turn, the left and right turn values are set to negative values; if there is no turn signal, the left and right turn values are set to zero;

转向环P的输出与转向值相加的计算公式为:The calculation formula for adding the output of the steering ring P to the steering value is:

Turn=TurnBias*kp2 (11)Turn=TurnBias*kp2 (11)

Turn=Turn+TurnLR (12)Turn=Turn+Turn LR (12)

其中,Turn为转向环P控制的输出值,TurnBias为P控制的输入值,kp2为一常量值,TurnLR为左右转向值。Among them, Turn is the output value of the steering ring P control, TurnBias is the input value of the P control, kp2 is a constant value, and Turn LR is the left and right steering value.

优选的,EPWM的比较寄存器的EPWMA和EPWMB计算过程为:Preferably, the calculation process of EPWMA and EPWMB of the comparison register of EPWM is:

M1=|PD_Control+PI_Control-Turn| (13)M1=|PD_Control+PI_Control-Turn| (13)

M2=|PD_Control+PI_Control+Turn| (14)M2=|PD_Control+PI_Control+Turn| (14)

将公式(13)计算的M1的值赋值给EPWM比较寄存器的EPWMA,将公式(14)计算获得的M2的值赋值给EPWM比较寄存器的EPWMB。The value of M1 calculated by formula (13) is assigned to EPWMA of the EPWM comparison register, and the value of M2 calculated by formula (14) is assigned to EPWMB of the EPWM comparison register.

优选的,当控制智能平衡小车的倾角大于45°时,关闭电机,禁止EPWM输出。Preferably, when the inclination angle of the intelligent balancing car is controlled to be greater than 45°, the motor is turned off and the EPWM output is prohibited.

一种两轮智能平衡小车的控制装置,包括:A control device for a two-wheeled intelligent balancing car, comprising:

直立环PD控制模块,用于获取线速度和角速度,通过线速度和角速度计算获得直立环PD控制量;The vertical ring PD control module is used to obtain the linear velocity and angular velocity, and obtain the vertical ring PD control amount through the linear velocity and angular velocity calculation;

速度环PI控制模块,用于获取转速信息,转速信息与给定的速度进行计算获得速度偏差,通过速度偏差、速度偏差的积分值和控制速度量计算获得速度环PI控制量;The speed loop PI control module is used to obtain the speed information, calculate the speed information and the given speed to obtain the speed deviation, and calculate the speed loop PI control amount through the speed deviation, the integral value of the speed deviation and the control speed amount;

转向环控制模块,用于将z轴角速度与期望值0作差获得转向偏差值,转向偏差值输入至转向环P中,转向环P的输出与转向值相加获得转向环控制量;A steering ring control module is used to obtain a steering deviation value by subtracting the z-axis angular velocity from the expected value 0, and the steering deviation value is input into the steering ring P. The output of the steering ring P is added to the steering value to obtain a steering ring control amount;

EPWM模块,用于将直立环PD控制量、速度环PI控制量和转向环控制量进行加减运算获得EPWM的比较寄存器的EPWMA和EPWMB,通过EPWM的占空比控制智能平衡小车。The EPWM module is used to perform addition and subtraction operations on the upright loop PD control quantity, the speed loop PI control quantity and the steering loop control quantity to obtain EPWMA and EPWMB of the EPWM comparison register, and control the intelligent balancing car through the EPWM duty cycle.

优选的,包括主控板、所述主控板连接有电机驱动模块,电机驱动模块同时连接有第一直流有刷电极和第二直流有刷电机;第一直流有刷电机上设置有第一增量式霍尔编码器,第二直流有刷电机上设置有第二增量式霍尔编码器;Preferably, it comprises a main control board, the main control board is connected to a motor drive module, the motor drive module is simultaneously connected to a first DC brush motor and a second DC brush motor; the first DC brush motor is provided with a first incremental Hall encoder, and the second DC brush motor is provided with a second incremental Hall encoder;

所述主控板还连接有位姿检测模块和调试模块。The main control board is also connected to a posture detection module and a debugging module.

优选的,所述主控板、第一增量式霍尔编码器和第二增量式霍尔编码器通过12V电池供电。Preferably, the main control board, the first incremental Hall encoder and the second incremental Hall encoder are powered by a 12V battery.

与现有技术相比,本发明具有以下有益效果:Compared with the prior art, the present invention has the following beneficial effects:

本发明公开了一种两轮智能平衡小车的控制方法,该控制方法采用三种PID控制算法进行结合,其中直立环使用PD控制,速度环使用PI控制,转向环使用P控制,该方法脱离了传统单一数据信息进行直立控制,融合三轴角速度、线速度信息,并采用两次滤波算法对数据进行融合,在保持两轮智能平衡小车平衡的同时,也保证了其转向和直行的精准度,从而大幅度提升了智能平衡小车的控制精度。The present invention discloses a control method for a two-wheeled intelligent balancing car. The control method combines three PID control algorithms, wherein the upright ring uses PD control, the speed ring uses PI control, and the steering ring uses P control. The method breaks away from the traditional single data information for upright control, integrates the three-axis angular velocity and linear velocity information, and uses a twice filtering algorithm to fuse the data. While maintaining the balance of the two-wheeled intelligent balancing car, the accuracy of its steering and straight driving is also guaranteed, thereby greatly improving the control accuracy of the intelligent balancing car.

进一步的,该智能平衡小车控制系统采用DSP C2000系列的芯片,相比于STM32芯片,该芯片引脚功能多,数值处理能力强,在电机控制方面更加专业,其增强型EPWM可以轻松输出复杂的PWM波形。Furthermore, the intelligent balancing car control system uses DSP C2000 series chips. Compared with STM32 chips, this chip has more pin functions, stronger numerical processing capabilities, and is more professional in motor control. Its enhanced EPWM can easily output complex PWM waveforms.

进一步的,该两轮智能平衡小车及其控制系统具有蓝牙模块、LED显示屏、JTAG接口及USB接口,这对智能平衡小车的平衡控制和调试给予了很大的便利性。Furthermore, the two-wheeled intelligent balancing car and its control system have a Bluetooth module, an LED display, a JTAG interface and a USB interface, which greatly facilitates the balance control and debugging of the intelligent balancing car.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本发明一种具体实施方式所提供的智能平衡小车的组成结构框图;FIG1 is a structural block diagram of a smart balancing car provided by a specific embodiment of the present invention;

图2为本发明一种具体实施方式所提供的智能平衡小车的控制原理框图;FIG2 is a control principle block diagram of an intelligent balancing car provided by a specific embodiment of the present invention;

图3为本发明一种具体实施方式所提供的智能平衡小车的控制程序流程图。FIG3 is a flow chart of a control program of an intelligent balancing car provided in a specific embodiment of the present invention.

参见图1,1-主控板,2-第一增量式霍尔编码器,3-第二增量式霍尔编码器,4-第一直流有刷电极,5-第二直流有刷电机,6-电机驱动芯片,7-12V电池,8-12V转5V稳压模块,9-OLED显示屏,10-位姿检测模块,11-调试模块,12-蓝牙模块,13-上位机软件,14-CCS软件,15-手机。See Figure 1, 1-main control board, 2-first incremental Hall encoder, 3-second incremental Hall encoder, 4-first DC brush electrode, 5-second DC brush motor, 6-motor driver chip, 7-12V battery, 8-12V to 5V voltage regulator module, 9-OLED display, 10-posture detection module, 11-debugging module, 12-Bluetooth module, 13-host computer software, 14-CCS software, 15-mobile phone.

具体实施方式DETAILED DESCRIPTION

下面结合附图和具体实施例对本发明做进一步详细描述:The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:

在本发明的描述中,需要说明的是,术语“中心”、“上”、“下”、“左”、“右”、“竖直”、“水平”、“内”、“外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制;术语“第一”、“第二”、“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性;此外,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention; the terms "first", "second", and "third" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance; in addition, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection or a detachable connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the internal communication of two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

为了达到上述目的,本发明有如下技术方案:一种两轮智能平衡小车及其控制系统,包括主控板1、两个增量式霍尔编码器,位姿检测模块10、两个直流有刷电机、电机驱动芯片6、手机15、蓝牙模块12和调试模块11等。两个增量式霍尔编码器分别为第一增量式霍尔编码器2和第二增量式霍尔编码器3,两个直流有刷电极分别为第一直流有刷电极4和第二直流有刷电机5。In order to achieve the above-mentioned purpose, the present invention has the following technical scheme: a two-wheeled intelligent balancing car and its control system, including a main control board 1, two incremental Hall encoders, a posture detection module 10, two DC brush motors, a motor drive chip 6, a mobile phone 15, a Bluetooth module 12 and a debugging module 11. The two incremental Hall encoders are respectively a first incremental Hall encoder 2 and a second incremental Hall encoder 3, and the two DC brush electrodes are respectively a first DC brush electrode 4 and a second DC brush motor 5.

具体的,所述主控板1的输入端同时与12V转5V稳压模块8、位姿检测模块10和两个增量式霍尔编码器连接。主控板1的输出端同时和电机驱动芯片6和OLED显示屏9连接。主控板1的输入端和输出端均与调试模块11连接,调试模块11为上位机软件13或CCS软件14,使得主控板1能够与上位机软件13或者CCS软件14能够交互的传递信息。主控板1的输入端和输出端均与蓝牙模块12能够交互的传递信息。Specifically, the input end of the main control board 1 is simultaneously connected to the 12V to 5V voltage stabilizing module 8, the posture detection module 10 and two incremental Hall encoders. The output end of the main control board 1 is simultaneously connected to the motor drive chip 6 and the OLED display screen 9. The input and output ends of the main control board 1 are both connected to the debugging module 11, and the debugging module 11 is the host computer software 13 or the CCS software 14, so that the main control board 1 can exchange information with the host computer software 13 or the CCS software 14. The input and output ends of the main control board 1 can exchange information with the Bluetooth module 12.

12V转5V稳压模块8的输入端与12V移动电源7的输出端相连,12V转5V稳压模块8的输出端和主控板1连接,12V转5V稳压模块8的输出端同时和第一增量式霍尔编码器2以及第二增量式霍尔编码器3连接,使得12V转5V稳压模块8能够同时为两个增量式霍尔编码器以及主控板1供电。The input end of the 12V to 5V voltage stabilizing module 8 is connected to the output end of the 12V mobile power supply 7, the output end of the 12V to 5V voltage stabilizing module 8 is connected to the main control board 1, and the output end of the 12V to 5V voltage stabilizing module 8 is simultaneously connected to the first incremental Hall encoder 2 and the second incremental Hall encoder 3, so that the 12V to 5V voltage stabilizing module 8 can simultaneously power the two incremental Hall encoders and the main control board 1.

电极驱动模块6的输入端和主控板1的输出端连接,电机驱动芯片6的输出端同时和第一直流有刷电机4的输入端以及第二直流有刷电机5的输入端连接,第一直流有刷电机4的输出端和第一增量式霍尔编码器2的输入端连接,第一增量式霍尔编码器2的输出端和主控板1的输入端连接;第二直流有刷电机5的输出端和第二增量式霍尔编码器3的输入端连接,第二增量式霍尔编码器3的输出端和主控板1的输入端连接。所述电机驱动模块6使用的是电机驱动芯片TB6612FNG,TB6612FNG是一款直流电机驱动器件,它具有大电流MOSFET-H桥结构,双通道电路输出电压和脉冲宽度,分别用于供电和对电机进行调速,可同时驱动两个直流有刷电机工作。手机15通过蓝牙模块12与主控板1连接,所述调试模块11通过其所在电脑的USB接口,与主控板1的JTAG接口和连接。USB接口是连接调试模块11的接口,JTAG接口是连接主控板1的接口The input end of the electrode driving module 6 is connected to the output end of the main control board 1, and the output end of the motor driving chip 6 is connected to the input end of the first DC brushed motor 4 and the input end of the second DC brushed motor 5 at the same time. The output end of the first DC brushed motor 4 is connected to the input end of the first incremental Hall encoder 2, and the output end of the first incremental Hall encoder 2 is connected to the input end of the main control board 1; the output end of the second DC brushed motor 5 is connected to the input end of the second incremental Hall encoder 3, and the output end of the second incremental Hall encoder 3 is connected to the input end of the main control board 1. The motor driving module 6 uses the motor driving chip TB6612FNG, which is a DC motor driver device. It has a large current MOSFET-H bridge structure, a dual-channel circuit output voltage and pulse width, which are used for power supply and motor speed regulation respectively, and can drive two DC brushed motors to work at the same time. The mobile phone 15 is connected to the main control board 1 through the Bluetooth module 12, and the debugging module 11 is connected to the JTAG interface of the main control board 1 through the USB interface of the computer where it is located. The USB interface is used to connect to the debugging module 11, and the JTAG interface is used to connect to the main control board 1.

所述主控板1采用DSPTMS320F2806X芯片,DSPTMS320F2806X主控板1与位姿检测模块10、电机驱动芯片6等模块进行连接,主控板1对采集的数据进行计算得到对电机的控制量。The main control board 1 adopts a DSPTMS320F2806X chip. The DSPTMS320F2806X main control board 1 is connected to modules such as a posture detection module 10 and a motor drive chip 6. The main control board 1 calculates the collected data to obtain the control amount of the motor.

所述两个增量式霍尔编码器分别安装于两个直流有刷电机的尾部,用来测量电机转速。更为具体的,两个增量式霍尔编码器在直流有刷电机的码盘旋转过程中,分别测量A、B两路转速信号,两个增量式霍尔编码器将转速信号分别传递至结合DSPTMS320F2806X的EQEP模块,可以分别测量第一直流有刷电机4和第二直流有刷电机5的旋转方向和电机的转速。The two incremental Hall encoders are respectively installed at the tails of the two DC brush motors to measure the motor speed. More specifically, the two incremental Hall encoders measure the speed signals A and B respectively during the rotation of the code disk of the DC brush motor. The two incremental Hall encoders transmit the speed signals to the EQEP module combined with DSPTMS320F2806X respectively, and can respectively measure the rotation direction and the speed of the first DC brush motor 4 and the second DC brush motor 5.

所述位姿检测模块10使用的是MPU6050芯片,集成了3轴陀螺仪和3轴加速度计和一个可扩展的数字运动处理器DMP,结合IIC协议接口进行通信,IIC总线是两线式串行总线,一根是数据线SDA,另一根是时钟线SCL,用来测量三个方向上的陀螺仪信号和加速度信号。The posture detection module 10 uses the MPU6050 chip, which integrates a 3-axis gyroscope, a 3-axis accelerometer and an expandable digital motion processor DMP, and communicates with the IIC protocol interface. The IIC bus is a two-wire serial bus, one is the data line SDA, and the other is the clock line SCL, which is used to measure the gyroscope signals and acceleration signals in three directions.

所述蓝牙模块使用CC5241芯片实现智能平衡小车与安卓手机的通信,该芯片支持UART接口,并支持SPP蓝牙串口协议,使用该芯片进而实现手机控制智能平衡小车的功能。The Bluetooth module uses the CC5241 chip to realize the communication between the smart balancing car and the Android phone. The chip supports the UART interface and the SPP Bluetooth serial port protocol. The chip is used to realize the function of the mobile phone controlling the smart balancing car.

所述调试模块11中设置有CCS软件14包括上位机软件13,通过使用仿真器结合CCS(code composer studio)软件对主控板1中的程序进行调试编译,并使用上位机软件13对PID调节中相关参数的变化情况进行观测,从而判断智能平衡小车是否达到稳定.The debugging module 11 is provided with CCS software 14 including host computer software 13, which is used to debug and compile the program in the main control board 1 by using the simulator in combination with CCS (code composer studio) software, and the host computer software 13 is used to observe the changes of the relevant parameters in the PID adjustment, so as to determine whether the intelligent balancing car has reached stability.

12V电池7即可携带式移动电源,其自身可以储备电能,主要为电子产品等移动设备进行供电。The 12V battery 7 is a portable mobile power source, which can store electric energy and is mainly used to supply power to mobile devices such as electronic products.

12V转5V稳压模块8采用LM2596系列芯片,其内部含有基准稳压器和固定频率振荡器,固定输出有3.3V、5V和12V不同版本,可以调整版本输出小于37V的各种电压,使用该芯片可以构成高效稳压电路,该智能平衡小车使用的是固定输出5V版本。The 12V to 5V voltage regulator module 8 uses the LM2596 series chip, which contains a reference voltage regulator and a fixed frequency oscillator. The fixed output has different versions of 3.3V, 5V and 12V. The version can be adjusted to output various voltages less than 37V. This chip can be used to form an efficient voltage regulator circuit. The smart balancing car uses a fixed output 5V version.

OLED显示屏9使用0.96寸6针OLED显示屏,使用SPI通信协议与主控板1进行通信,从而可以查看相应的数据信息。The OLED display screen 9 uses a 0.96-inch 6-pin OLED display screen and uses the SPI communication protocol to communicate with the main control board 1, so that the corresponding data information can be viewed.

该智能平衡小车控制系统采用DSP C2000系列的芯片,相比于STM32芯片,该芯片引脚功能多,数值处理能力强,在电机控制方面更加专业,其增强型EPWM可以轻松输出复杂的PWM波形。The intelligent balancing car control system uses DSP C2000 series chips. Compared with STM32 chips, this chip has more pin functions, stronger numerical processing capabilities, and is more professional in motor control. Its enhanced EPWM can easily output complex PWM waveforms.

该两轮智能平衡小车及其控制系统具有蓝牙模块、LED显示屏、JTAG接口及USB接口,这对智能平衡小车的平衡控制和调试给予了很大的便利性。The two-wheeled intelligent balancing car and its control system have a Bluetooth module, an LED display, a JTAG interface and a USB interface, which greatly facilitates the balance control and debugging of the intelligent balancing car.

下面介绍本发明的工作原理:The working principle of the present invention is described below:

参见图2,图3是智能平衡小车的控制原理图,以车轮轴线为y轴,以智能平衡小车前进方向为x轴,以车轴的中点竖直方向为z轴。将直立环和速度环进行串联,速度环控制的输出作为直立环的输入,直立环控制的输出作为系统的输出,通过整合便可得到图2控制原理图。See Figure 2. Figure 3 is the control principle diagram of the intelligent balancing car, with the wheel axis as the y-axis, the forward direction of the intelligent balancing car as the x-axis, and the vertical direction of the midpoint of the axle as the z-axis. The vertical ring and the speed ring are connected in series, the output of the speed ring control is used as the input of the vertical ring, and the output of the vertical ring control is used as the output of the system. Through integration, the control principle diagram of Figure 2 can be obtained.

首先需要进行直立环PD控制,由位姿检测模块10检测到智能平衡小车的线速度和角速度的信息,通过对线速度进行计算可以得到相应的智能平衡小车的倾斜角度信息,倾斜角度信息通过对线速度进行计算,进而得到相对于y轴的倾斜角度。但是线速度中加速度的累加会影响到测量的精度,所以可以借助角速度的信息对倾斜角度信息进行计算。具体表达式如下:First, the upright ring PD control is required. The linear velocity and angular velocity information of the intelligent balancing car are detected by the posture detection module 10. The corresponding inclination angle information of the intelligent balancing car can be obtained by calculating the linear velocity. The inclination angle information is calculated by calculating the linear velocity, and then the inclination angle relative to the y-axis is obtained. However, the accumulation of acceleration in the linear velocity will affect the measurement accuracy, so the inclination angle information can be calculated with the help of the angular velocity information. The specific expression is as follows:

其中,accelY和accelZ是通过位姿检测模块10得到的Y和Z方向上的线速度,angleY为Y轴方向的倾角信息。GyroX为X方向的角速度,gyroX是位姿检测模块10关于X轴的角速度,其范围为—32768~+32768,k的设置与位姿检测模块10的初始化有关,当初始化为±2000度/s,k=16.4。。Among them, accelY and accelZ are the linear velocities in the Y and Z directions obtained by the posture detection module 10, and angleY is the inclination information in the Y-axis direction. GyroX is the angular velocity in the X direction, and gyroX is the angular velocity of the posture detection module 10 about the X axis, which ranges from -32768 to +32768. The setting of k is related to the initialization of the posture detection module 10. When it is initialized to ±2000 degrees/s, k=16.4.

由于位姿检测模块积分得到的角度会因为自身零点漂移的影响,误差会随着时间逐渐增加,采取一阶互补滤波算法对线速度计算求得的angleY和角速度计算求得的GyroX进行融合得到更加稳定的相对于X向的倾斜角度,表达式如下:Since the angle obtained by the posture detection module will be affected by its own zero drift, the error will gradually increase over time. The first-order complementary filtering algorithm is used to fuse the angleY obtained by the linear velocity calculation and the GyroX obtained by the angular velocity calculation to obtain a more stable tilt angle relative to the X direction. The expression is as follows:

angle=(1-W)*angleY+W*(GyroX*dt+angle) (3)angle=(1-W)*angleY+W*(GyroX*dt+angle) (3)

其中,angle为一阶互补滤波算法融合后的倾角信息,angleY为Y轴方向的倾角信息,angle+GyroX*dt为位姿检测模块积分得到的角度信息,dt为采样周期,W为滤波器系数,取值范围为[0,1]。Among them, angle is the inclination information after fusion of the first-order complementary filtering algorithm, angleY is the inclination information in the Y-axis direction, angle+GyroX*dt is the angle information obtained by integrating the posture detection module, dt is the sampling period, and W is the filter coefficient, which ranges from [0,1].

将融合后的角度angle以及位姿检测模块测量的X轴角速度输入至直立环PD,表达式如下:The fused angle angle and the X-axis angular velocity measured by the posture detection module are input into the upright ring PD. The expression is as follows:

PD_Control=angle*kp+gryoX*kd (4)PD_Control=angle*kp+gryoX*kd (4)

其中,PD_Control为PD控制的输出,kp、kd为常量。Among them, PD_Control is the output of PD control, and kp and kd are constants.

然后进行速度环PI控制,两个增量式霍尔编码器采集到的转速信息与给定速度值作差运算,得到最新速度的偏差值,表达式如下:Then the speed loop PI control is performed, and the speed information collected by the two incremental Hall encoders is subtracted from the given speed value to obtain the deviation value of the latest speed. The expression is as follows:

EncoderNew=0-(EnocderL+EncoderR) (5)EncoderNew=0-(EnocderL+EncoderR) (5)

其中,EncoderNew为最新速度的偏差值,0为给定的速度值,EncoderL和EncoderR为第一增量式霍尔编码器2和第二增量式霍尔编码器3采集到的信息。Wherein, EncoderNew is the deviation value of the latest speed, 0 is the given speed value, and EncoderL and EncoderR are the information collected by the first incremental Hall encoder 2 and the second incremental Hall encoder 3 .

将最新速度的偏差值与上一时刻的速度偏差值输入一阶滤波算法中,以求得稳定的速度偏差,表达式如下:The latest speed deviation value and the speed deviation value at the previous moment are input into the first-order filtering algorithm to obtain a stable speed deviation. The expression is as follows:

Encoder=Encoderlast×a+(1-a)×EncoderNew (6)Encoder=Encoder last ×a+(1-a)×EncoderNew (6)

其中,Encoder为速度偏差值,Encoderlast为上一时刻的速度偏差值,a为系数。Among them, Encoder is the speed deviation value, Encoder last is the speed deviation value at the previous moment, and a is the coefficient.

将速度偏差值进行累加运算得到速度偏差的积分值,表达式如下:The speed deviation values are accumulated to obtain the integral value of the speed deviation. The expression is as follows:

EncoderI=EncoderI+Encoder (7)EncoderI=EncoderI+Encoder (7)

其中,EncoderI为速度偏差的积分值,Encoder为速度偏差值。Among them, EncoderI is the integral value of the speed deviation, and Encoder is the speed deviation value.

与此同时,手机控制智能平衡小车的前进与后退时,当智能平衡小车接收到向前运动的指令时,设置速度量为正值,当智能平衡小车接收到向后运动的指令时,设置速度量为负值,如果智能平衡小车不前进也不后退,该手机控制速度量为零。表达式如下:At the same time, when the mobile phone controls the forward and backward movement of the smart balancing car, when the smart balancing car receives a command to move forward, the speed is set to a positive value, and when the smart balancing car receives a command to move backward, the speed is set to a negative value. If the smart balancing car does not move forward or backward, the speed controlled by the mobile phone is zero. The expression is as follows:

EncoderI=EncoderI+MoveControl (8)EncoderI=EncoderI+MoveControl (8)

其中,MoveControl为手机控制的速度量。最后,将速度偏差值和速度偏差值的积分输入至速度环PI控制得到速度环的控制量,表达式如下:Among them, MoveControl is the speed controlled by the mobile phone. Finally, the speed deviation value and the integral of the speed deviation value are input into the speed loop PI control to obtain the control amount of the speed loop. The expression is as follows:

PI_Control=Encoder*kp1+EncoderI*ki (9)PI_Control=Encoder*kp1+EncoderI*ki (9)

其中,PI_Control为PI控制的输出量,kp1、ki为常量。Among them, PI_Control is the output of PI control, kp1 and ki are constants.

如果仅有直立环和速度环的控制,智能平衡小车在行驶过程中会发生偏航的情况,此时需要加入手机软件控制转向,即转向环P的控制,转向环P控制的作用是使智能平衡小车的行驶轨迹趋近于直线。使用位姿检测模块10测得z轴的角速度,如果手机控制向左转向,则设定左右转向值为正值,如果手机控制向右转向,则设定左右转向值为负值,如果无转向信号,则设定左右转向值为零,使用测得的z轴角速度与期望值0做差求得转向偏差值,表达式如下:If only the upright ring and the speed ring are controlled, the intelligent balancing car will deviate during driving. At this time, it is necessary to add mobile phone software to control the steering, that is, the control of the steering ring P. The function of the steering ring P control is to make the driving trajectory of the intelligent balancing car close to a straight line. Use the posture detection module 10 to measure the angular velocity of the z-axis. If the mobile phone controls the left turn, the left and right steering values are set to positive values. If the mobile phone controls the right turn, the left and right steering values are set to negative values. If there is no steering signal, the left and right steering values are set to zero. The steering deviation value is obtained by subtracting the measured z-axis angular velocity from the expected value 0. The expression is as follows:

TurnBias=0-GryoX (10)TurnBias=0-GryoX (10)

其中,TurnBias为转向偏差值,GryoX为z轴角速度。Among them, TurnBias is the steering bias value, and GryoX is the z-axis angular velocity.

将转向偏差量作为转向环P控制的输入,转向环P控制的输出与左右转向值相加求得转向环控制量,表达式如下:The steering deviation is used as the input of the steering ring P control. The output of the steering ring P control is added to the left and right steering values to obtain the steering ring control amount. The expression is as follows:

Turn=TurnBias*kp2 (11)Turn=TurnBias*kp2 (11)

Turn=Turn+TurnLR (12)Turn=Turn+Turn LR (12)

其中,Turn为转向环P控制的输出值,TurnBias为P控制的输入值,kp2为一常量值,TurnLR为左右转向值。Among them, Turn is the output value of the steering ring P control, TurnBias is the input value of the P control, kp2 is a constant value, and Turn LR is the left and right steering value.

最后,在中断程序中将直立环、速度环、转向环的控制量进行加减运算,表达式如下:Finally, in the interrupt program, the control quantities of the vertical loop, speed loop, and steering loop are added and subtracted. The expressions are as follows:

M1=|PD_Control+PI_Control-Turn| (13)M1=|PD_Control+PI_Control-Turn| (13)

M2=|PD_Control+PI_Control+Turn| (14)M2=|PD_Control+PI_Control+Turn| (14)

通过对EPWM寄存器值进行限幅,若M1和M2的值没有超过限制条件,将M1和M2的值赋值给EPWM比较寄存器的EPWMA和EPWMB,通过这两个值来调节占空比(高电压占一个周期的多少),来等同于调节不同的电压。最后,通过主控板1EPWM波形输出至电机驱动模块6,电机驱动模块6驱动两个直流有刷电机4、5,智能平衡小车就可以保持在一个平衡状态且两个直流有刷电机4、5可以按照要求进行运动。通过三种PID控制结合的方法,提升了系统的精准度By limiting the EPWM register value, if the values of M1 and M2 do not exceed the limit conditions, the values of M1 and M2 are assigned to EPWMA and EPWMB of the EPWM comparison register, and the duty cycle (how much high voltage occupies a cycle) is adjusted by these two values, which is equivalent to adjusting different voltages. Finally, the EPWM waveform is output to the motor drive module 6 through the main control board 1. The motor drive module 6 drives the two DC brush motors 4 and 5. The intelligent balancing car can be maintained in a balanced state and the two DC brush motors 4 and 5 can move as required. The accuracy of the system is improved by combining the three PID control methods.

参见图3,图3是智能平衡小车的控制程序流程图,首先给智能平衡小车上电运行,对各器件、函数进行初始化,如:初始化系统时钟、初始化PIE控制寄存器、初始化QEP功能引脚、定时器初始化和IIC模块初始化等,主控板1接收位姿检测模块10的加速度与角速度信息和两个增量式霍尔编码器2、3的信息,等待接收启动控制指令,接收到启动控制指令后开始计算直立环、速度环、转向环的控制量,将最终的控制量设置EPWM的占空比,智能小车可以保持平衡状态,当倾角大于45度时,关闭电机、禁止EPWM输出。Refer to Figure 3, which is a control program flow chart of the intelligent balancing car. First, the intelligent balancing car is powered on and run, and each device and function is initialized, such as: initializing the system clock, initializing the PIE control register, initializing the QEP function pin, initializing the timer and initializing the IIC module, etc. The main control board 1 receives the acceleration and angular velocity information of the posture detection module 10 and the information of the two incremental Hall encoders 2 and 3, and waits to receive the start control instruction. After receiving the start control instruction, it starts to calculate the control amount of the upright ring, speed ring, and steering ring, and sets the final control amount to the duty cycle of EPWM. The intelligent car can maintain a balanced state. When the inclination angle is greater than 45 degrees, the motor is turned off and the EPWM output is prohibited.

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (5)

1. A control method of a two-wheeled intelligent balance trolley is characterized in that,
Acquiring a linear speed and an angular speed, and calculating to acquire a control quantity of the vertical ring PD through the linear speed and the angular speed;
obtaining rotation speed information, calculating the rotation speed information and a given speed to obtain a speed deviation, inputting the speed deviation and the speed deviation at the previous moment into a first-order filtering algorithm to obtain a stable speed deviation, integrating the stable speed deviation value to obtain an integral value of the speed deviation, and calculating to obtain a speed loop PI control quantity through the integral value of the speed deviation and a control speed quantity;
the z-axis angular velocity is differenced with an expected value 0 to obtain a steering deviation value, the steering deviation value is input into a steering ring P, and the output of the steering ring P is added with the steering value to obtain a steering ring control quantity;
the control quantity of the vertical ring PD, the control quantity of the speed ring PI and the control quantity of the steering ring are subjected to addition and subtraction to obtain EPWMA and EPWMB of EPWM comparison registers, and the intelligent balance trolley is controlled through EPWMA and EPWMB;
the calculation formula of the linear velocity is as follows:
wherein accelY and accelZ are linear velocities in the Y and Z directions, respectively;
the calculation formula of the angular velocity is as follows:
GyroX is the angular velocity in the X direction, gyroX is the output value of the X axis, and the setting of k is related to the initialization of the pose detection module;
the inclination angle of the trolley relative to the X direction is obtained by the linear velocity and the angular velocity:
angle=(1-W)*angleY+W*(GyroX*dt+angle) (3);
The calculation formula of the control amount of the vertical ring PD is as follows:
PD_Control=angle*kp+gryoX*kd (4)
Wherein, PD_control is the output Control quantity of the vertical ring PD, angle is the angle of inclination of the trolley relative to the X direction, kp and kd are constants, gryoX is the angular velocity of the X axis obtained by measurement;
the calculation formula of the speed deviation is as follows:
EncoderNew=0-(EnocderL+EncoderR) (5)
Wherein EncoderNew is the deviation value of the latest speed, 0 is a given speed value, encoderL and EncoderR are the information acquired by the first incremental Hall encoder (2) and the second incremental Hall encoder (3) respectively;
Calculating the latest speed deviation and the speed deviation at the last moment to obtain stable speed deviation, wherein the calculation formula is as follows:
Encoder=Encoderlast×a+(1-a)×EncoderNew
wherein Encdoer is a speed deviation value, encoder last is a speed deviation value at the last moment, and a is a coefficient;
The calculation formula for obtaining the steering deviation value by making the difference between the z-axis angular velocity and the expected value 0 is as follows:
TurnBias=0-GryoZ
Wherein TurnBias is the steering bias value, gryoZ is the z-axis angular velocity;
If the mobile phone controls left steering, setting a left steering value and a right steering value to be positive values; if the mobile phone controls the right steering, setting the left steering value and the right steering value as negative values; if no steering signal exists, setting a left steering value and a right steering value to be zero;
the calculation formula of the addition of the output of the steering ring P and the steering value is:
Turn=TurnBias*kp2 (11)
Turn=Turn+TurnLR (12)
Wherein Turn is the output value of the steering ring P control, turnBias is the input value of the P control, kp2 is a constant value, turn LR is the left and right steering value;
The EPWMA and EPWMB calculation process for the compare register of EPWM is:
M1=|PD_Control+PI_Control-Turn| (13)
M2=|PD_Control+PI_Control+Turn| (14)
the value of M1 calculated in equation (13) is assigned to EPWMA of the EPWM compare register, and the value of M2 calculated in equation (14) is assigned to EPWMB of the EPWM compare register.
2. The control method of the two-wheeled intelligent balance car according to claim 1, wherein when the inclination angle of the intelligent balance car is controlled to be larger than 45 degrees, the motor is turned off, and EPWM is forbidden to output.
3. The utility model provides a controlling means of balanced dolly of two-wheeled intelligence which characterized in that includes:
the vertical ring PD control module is used for acquiring the linear speed and the angular speed, and calculating the vertical ring PD control quantity through the linear speed and the angular speed;
The speed loop PI control module is used for acquiring the rotation speed information, calculating the rotation speed information and a given speed to acquire speed deviation, and calculating the speed loop PI control quantity through the speed deviation, an integral value of the speed deviation and a control speed quantity;
The steering ring control module is used for obtaining a steering deviation value by making a difference between the z-axis angular speed and an expected value 0, inputting the steering deviation value into a steering ring P, and obtaining a steering ring control quantity by adding the output of the steering ring P and the steering value;
EPWM module for adding and subtracting the control quantity of the vertical ring PD, the control quantity of the speed ring PI and the control quantity of the steering ring to obtain EPWMA and EPWMB of the comparison register of EPWM, and controlling the intelligent balance trolley through the duty ratio of EPWM;
the calculation formula of the linear velocity is as follows:
wherein accelY and accelZ are linear velocities in the Y and Z directions, respectively;
the calculation formula of the angular velocity is as follows:
GyroX is the angular velocity in the X direction, gyroX is the output value of the X axis, and the setting of k is related to the initialization of the pose detection module;
the inclination angle of the trolley relative to the X direction is obtained by the linear velocity and the angular velocity:
angle=(1-W)*angleY+W*(GyroX*dt+angle) (3);
The calculation formula of the control amount of the vertical ring PD is as follows:
PD_Control=angle*kp+gryoX*kd (4)
Wherein, PD_control is the output Control quantity of the vertical ring PD, angle is the angle of inclination of the trolley relative to the X direction, kp and kd are constants, gryoX is the angular velocity of the X axis obtained by measurement;
the calculation formula of the speed deviation is as follows:
EncoderNew=0-(EnocderL+EncoderR) (5)
Wherein EncoderNew is the deviation value of the latest speed, 0 is a given speed value, encoderL and EncoderR are the information acquired by the first incremental Hall encoder (2) and the second incremental Hall encoder (3) respectively;
Calculating the latest speed deviation and the speed deviation at the last moment to obtain stable speed deviation, wherein the calculation formula is as follows:
Encoder=Encoderlast×a+(1-a)×EncoderNew
wherein Encdoer is a speed deviation value, encoder last is a speed deviation value at the last moment, and a is a coefficient;
The calculation formula for obtaining the steering deviation value by making the difference between the z-axis angular velocity and the expected value 0 is as follows:
TurnBias=0-GryoZ
Wherein TurnBias is the steering bias value, gryoZ is the z-axis angular velocity;
If the mobile phone controls left steering, setting a left steering value and a right steering value to be positive values; if the mobile phone controls the right steering, setting the left steering value and the right steering value as negative values; if no steering signal exists, setting a left steering value and a right steering value to be zero;
the calculation formula of the addition of the output of the steering ring P and the steering value is:
Turn=TurnBias*kp2 (11)
Turn=Turn+TurnLR (12)
Wherein Turn is the output value of the steering ring P control, turnBias is the input value of the P control, kp2 is a constant value, turn LR is the left and right steering value;
The EPWMA and EPWMB calculation process for the compare register of EPWM is:
M1=|PD_Control+PI_Control-Turn| (13)
M2=|PD_Control+PI_Control+Turn| (14)
the value of M1 calculated in equation (13) is assigned to EPWMA of the EPWM compare register, and the value of M2 calculated in equation (14) is assigned to EPWMB of the EPWM compare register.
4. A control system of a two-wheeled intelligent balance trolley controlled by the device of claim 3, which is characterized by comprising a main control board (1), wherein the main control board (1) is connected with a motor driving module (6), and the motor driving module (6) is simultaneously connected with a first direct current brush motor (4) and a second direct current brush motor (5); a first incremental Hall encoder (2) is arranged on the first direct-current brush motor (4), and a second incremental Hall encoder (3) is arranged on the second direct-current brush motor (5);
the main control board (1) is also connected with a pose detection module (10) and a debugging module (11).
5. The control system of the two-wheeled intelligent balance car according to claim 4, wherein the main control board (1), the first incremental hall encoder (2) and the second incremental hall encoder (3) are powered by a 12V battery (7).
CN202210563601.8A 2022-05-23 2022-05-23 Control method, device and system for two-wheeled intelligent balance trolley Active CN114859700B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210563601.8A CN114859700B (en) 2022-05-23 2022-05-23 Control method, device and system for two-wheeled intelligent balance trolley

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210563601.8A CN114859700B (en) 2022-05-23 2022-05-23 Control method, device and system for two-wheeled intelligent balance trolley

Publications (2)

Publication Number Publication Date
CN114859700A CN114859700A (en) 2022-08-05
CN114859700B true CN114859700B (en) 2024-09-13

Family

ID=82638639

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210563601.8A Active CN114859700B (en) 2022-05-23 2022-05-23 Control method, device and system for two-wheeled intelligent balance trolley

Country Status (1)

Country Link
CN (1) CN114859700B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN214648784U (en) * 2021-04-09 2021-11-09 西安建筑科技大学 An electronic control system for single-track self-balancing bicycle based on different working conditions
CN114280920A (en) * 2021-12-08 2022-04-05 广东博力威科技股份有限公司 Electric balance vehicle balance control method and device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8467888B2 (en) * 2009-06-05 2013-06-18 The Mathworks, Inc. Automated PID controller design

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN214648784U (en) * 2021-04-09 2021-11-09 西安建筑科技大学 An electronic control system for single-track self-balancing bicycle based on different working conditions
CN114280920A (en) * 2021-12-08 2022-04-05 广东博力威科技股份有限公司 Electric balance vehicle balance control method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114859700A (en) 2022-08-05

Similar Documents

Publication Publication Date Title
CN207718226U (en) A kind of double-wheel self-balancing trolley automatic following system
CN103192394B (en) Robot control system based on double-wheel self-balance gravity inductive control
CN108759822B (en) Mobile robot 3D positioning system
CN102981504B (en) System and method for controlling formations of a plurality of robots based on Zigbee communication
CN105807689A (en) Two-wheel self-balance car control system
CN205068166U (en) But remote control two -wheeled is upright from balancing trolley
CN102841620A (en) Novel micro-mouse quick sprint automatic control system
CN102890890A (en) Upright self-balancing intelligent vehicle
CN109571467B (en) Motion model calibration method, device and odometer system of a two-wheel differential robot
CN110162068A (en) A kind of control method of self-balance robot
CN107344587A (en) A kind of Self-Balancing vehicle obstacle avoidance system based on PID controller
CN110801368A (en) Universal motion control device and control method for rehabilitation robot
CN114859700B (en) Control method, device and system for two-wheeled intelligent balance trolley
CN108806689A (en) Acoustic control self-balancing trolley and its control method
CN102707717A (en) Free dance step generation method for two-wheel robot
CN106335584A (en) Double-wheel balance vehicle control system
CN211786769U (en) High-efficient low-cost balance car patrols line system
CN203037261U (en) Image stabilizing system for small-sized gyroscope
CN209327874U (en) The Control System of Electromagnetic Tracing Image Acquisition Car
CN105690400A (en) Interactive consultation and event multi-purpose simulation robot and expert consultation system thereof
CN210605410U (en) A control device for omnidirectional mobile chassis based on Mecanum wheels
CN112256036A (en) Chassis operation control method, system and device and AGV
You et al. Design of two-wheel balance car based on STM32
CN111338355A (en) Intelligent wheeled robot
CN203443592U (en) Vehicle-mounted artificial intelligence system based on dynamic image identification

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant