Self-adjusting method for Bluetooth manual control motor of vehicle

文档序号:1946645 发布日期:2021-12-10 浏览:6次 中文

阅读说明:本技术 一种用于车辆的蓝牙手动控制电机的自调整方法 (Self-adjusting method for Bluetooth manual control motor of vehicle ) 是由 王立云 王科 谢海东 石利俊 邱燕 缓莹 苏明泽 黄灿 于 2021-03-12 设计创作,主要内容包括:本发明涉及一种用于车辆的蓝牙手动控制电机的自调整方法,S1、采用姿态角度传感器测量车身角度;S2、采用双闭环控制来调整车身角度,通过速度、角度位置实现控制;S21、先确定电机全速运行时编码器输出的脉冲数量,并将该数据作为期望值的最大限制数据;S22、在第一个测量周期内测得实际数据;S23、计算得到实际数据与期望值的当前误差值E、上一次误差值E-(1)、上上次误差值E-(2);S24、计算得到速度闭环输出值X-(OUT-υ)、角度位置闭环输出值X-(OUT-φ);S25、确定麦轮底盘各种运动方式,将输出值进行相应的逻辑加减融合;S3、将融合值作为最终的速度赋值给驱动系统。本发明达到的有益效果是:自动纠正偏差、精确度高。(The invention relates to a self-adjusting method of a Bluetooth manual control motor for a vehicle, S1, measuring the angle of a vehicle body by adopting an attitude angle sensor; s2, adjusting the angle of the vehicle body by adopting double closed-loop control, and realizing control through speed and angle position; s21, firstly, determining the pulse number output by the encoder when the motor runs at full speed, and taking the data as the maximum limit data of the expected value; s22, measuring actual data in a first measuring period; s23, calculating to obtain the current error value E and the last error value E of the actual data and the expected value 1 Last error value E 2 (ii) a S24, calculating to obtain the speed closed-loop output value X OUT‑υ Angle position closed loop output value X OUT‑φ (ii) a S25, determining various motion modes of the wheel chassis, and performing corresponding logical addition, subtraction and fusion on the output values; and S3, assigning the fused value as a final speed to the driving system. The invention achieves the following beneficial effects: the deviation is automatically corrected, and the accuracy is high.)

1. A self-adjusting method for a bluetooth manually controlled motor for a vehicle, characterized by:

s1, measuring the angle of the vehicle body by adopting an attitude angle sensor, and then adjusting;

s2, when the angle of the vehicle body is adjusted, the angle is controlled through double closed-loop control, namely the speed and the angle position are controlled;

s21, firstly, determining the pulse quantity output by the encoder when the motor runs at full speed, and taking the data as the maximum limit data of expected values, wherein the expected values comprise expected speed values and expected angle position values;

s22, measuring actual data in a first measuring period, wherein the actual data comprises actual speed data and actual angle position data;

s23, calculating to obtain the current error value E between the actual data and the expected value and the last error value E between the actual data and the expected value1Last error value E of actual data and expected value2

S24, calculating to obtain a closed loop output value XOUT

XOUT=(Kp+Ti+Td)×E2-(Kp+2Td)×E1+TdThe formula (1) of x E,

wherein, Kp、Ti、TdProportional coefficient, integral coefficient and differential coefficient;

the actual speed data and the expected speed value are substituted into the formula to obtain a speed closed-loop output value XOUT-υ

The actual angle position data and the expected angle position value are brought into the formula to obtain an angle position closed loop output value XOUT-φ

S25, determining various motion modes of the wheat wheel chassisAnd the speed is closed-loop output value XOUT-υSum angular position closed loop output value XOUT-φCarrying out corresponding logic addition and subtraction fusion;

s3, assigning the fused value in the step S25 to the driving system as the final speed, wherein the value is XOUT-υAnd XOUT-φAnd after the logic addition and subtraction are carried out on the fused scalar, the driving system can enable the four independent wheat wheels to reach an ideal motion state.

2. A self-adjusting method of bluetooth manual control motor for vehicle according to claim 1, characterized in that: the four independent wheat wheels are driven by a single PMSM motor;

the driving system simultaneously controls four independent PMSM motors to realize self-adjustment of the vehicle.

3. A self-adjusting method of bluetooth manual control motor for vehicle according to claim 2, characterized in that: when the driving system is driven, the environment information and the speed information are combined to form motion information, and the motion states of the four wheat wheels are adjusted through the motion information;

the speed information is determined by the steps S1 to S25;

the environment information is difference information obtained by comparing the actual shot picture with the picture library.

4. A self-adjusting method of bluetooth manual control motor for vehicle according to claim 3, characterized in that: when the angle of the vehicle body is adjusted, manual control is performed through Bluetooth, and data transmitted during the manual control of the Bluetooth comprise packet header data, continuous data bytes and an end check bit;

the packet header data is used for identifying Bluetooth data; the continuous data bytes comprise speed information, environment information and motion information;

the technical check bits are used to check for errors in the data packet.

Technical Field

The invention relates to the technical field of vehicle direction adjustment, in particular to a self-adjusting method for a Bluetooth manual control motor of a vehicle.

Background

During the running process of the vehicle, the vehicle is usually steered artificially. For some intelligent automobiles, the automatic lane changing action of the automobile is realized through set control logic according to the self speed of the automobile, the distance between the automobile and the surrounding automobiles and other environmental information.

Namely, when the driving posture of the ordinary vehicle is changed, the posture is changed mainly according to the automobile condition and the road trend condition, and the randomness is high when the posture is adjusted, so that the driving posture is not accurate enough.

Therefore, the automatic adjusting method for manually controlling the motor through the Bluetooth is designed, although manual adjustment is carried out, specific actions are automatically judged according to the self condition of the vehicle and then fine adjustment is carried out, and therefore the precision is improved.

In this scheme, mainly used on the carrier, but also be applicable to ordinary vehicle. Unlike a common vehicle, the speed of the truck is not particularly fast, but the running track is accurate, otherwise other objects are easy to touch, so that the accurate control of the truck is very important. When the position of the artificial parking or loading goods has errors or position deviation occurs in the operation, the automatic correction and adjustment can be automatically carried out.

Disclosure of Invention

The invention aims to overcome the defects of the prior art and provides a self-adjusting method of a Bluetooth manual control motor for a vehicle, which can automatically correct deviation and has high accuracy.

The purpose of the invention is realized by the following technical scheme: a self-adjusting method for a bluetooth manually controlled motor of a vehicle:

s1, measuring the angle of the vehicle body by adopting an attitude angle sensor, and then adjusting;

s2, when the angle of the vehicle body is adjusted, the angle is controlled through double closed-loop control, namely the speed and the angle position are controlled;

s21, firstly, determining the pulse quantity output by the encoder when the motor runs at full speed, and taking the data as the maximum limit data of expected values, wherein the expected values comprise expected speed values and expected angle position values;

s22, measuring actual data in a first measuring period, wherein the actual data comprises actual speed data and actual angle position data;

s23, calculating to obtain the current error value E between the actual data and the expected value and the last error value E between the actual data and the expected value1Last error value E of actual data and expected value2

S24, calculating to obtain a closed loop output value XOUT

In the formula (1),

wherein, Kp、Ti、TdProportional coefficient, integral coefficient and differential coefficient;

the actual speed data and the expected speed value are substituted into the formula to obtain a speed closed-loop output value XOUT-υ

The actual angle position data and the expected angle position value are brought into the formula to obtain an angle position closed loop output value XOUT-φ

S25, determining various motion modes of the wheat wheel chassis and outputting a speed closed loop output value XOUT-υSum angular position closed loop output value XOUT-φCarrying out corresponding logic addition and subtraction fusion;

namely, a separate set of logical addition and subtraction fusion algorithm is carried out on each Mecanum wheel: in the prior convention, the numbers of the four wheat wheels of the left front, the left back, the right back and the right front are respectively M1, M2, M3 and M4 when viewed from the top;

the basic motion modes are divided into ten types, namely left translation, right translation, forward movement, backward movement, left front translation, right front translation, left back translation, right back translation, anticlockwise rotation and clockwise rotation;

angles are added only in four motion states of left-right translation and forward and backward movement, and correction is carried out through a logic addition and subtraction fusion table;

s3, assigning the fused value in the step S25 to the driving system as the final speed, wherein the value is XOUT-υAnd XOUT-φAnd after the logic addition and subtraction are carried out on the fused scalar, the driving system can enable the four independent wheat wheels to reach an ideal motion state.

Further, the four independent wheat wheels are driven by separate PMSM motors; the driving system simultaneously controls four independent PMSM motors to realize self-adjustment of the vehicle.

Furthermore, when the driving system is driven, the environment information and the speed information are combined to form motion information, and the motion states of the four wheat wheels are adjusted through the motion information; the speed information is determined in steps S1-S25; the environment information is difference information obtained by comparing the actual shot picture with the picture library.

Furthermore, when the angle of the vehicle body is adjusted, manual control is performed through Bluetooth, and data transmitted during the manual control through the Bluetooth comprise packet header data, continuous data bytes and an end check bit; the packet header data is used for identifying Bluetooth data; the continuous data bytes comprise speed information, environment information and motion information; the technical check bits are used to check for errors in the data packet.

Further, in step S1, the vehicle body angle is measured by the nine-axis attitude angle sensor, and the measurement is calculated as follows:

introducing roll angle revision variables aiming at specific complex environment of plantRevised variable of pitch angleYaw angle revision variableAnd a gravity acceleration revision coefficient Kg, wherein the first three variables are sent to the control system by the Bluetooth control module when the system is debugged, and the relationship among the three variables is as follows:

assuming that the gravity acceleration G is 1G, the three-axis acceleration components a of the gravity acceleration G on the b-system carrier coordinate systemx、ay、az

Formula (2);

under the navigation coordinate system, the gravity acceleration is completely equal to Z under the navigation coordinate systemnThe axes coincide, and XnAnd YnThe component of the axis is 0, when the navigation coordinate system is converted to the carrier coordinate system, the conversion relation is a direction cosine matrix expressed by Euler angle, the specific relation is,

in the formula (3),

in the formula (4),

in the formula (5),

the three formulas are substituted into corresponding revision variables to obtain the final product through calculation

Pitch angle of vehicle body attitudeIn the formula (6),

roll angle of vehicle body attitudeFormula (7);

and because the output of the magnetometer is as follows when the magnetic geographic coordinate system is coincident with the b-system carrier coordinate systemWherein M isnRepresenting the magnetic field of a geographical coordinate system, MdRepresenting a magnetic declination under a magnetic geographic coordinate system;

and the output of the magnetometer in the b-system carrier coordinate system isWherein M isx bRepresenting the north component of the earth's magnetic field in the b coordinate system, My bRepresenting the east component of the magnetic field, Mz bRepresents the perpendicular component of the magnetic field becauseSubstituting equations (6) and (7) into the directional cosine array can obtain:

and finally, calculating and substituting the revised variables to obtain the deflection angle of the vehicle body attitude:

further, the environment information is difference information obtained by comparing the actually shot picture with a picture library;

when comparing, the image can be regarded as a matrix, the element in the matrix is a color value, the value is composed of three RGB parameters, the image is binarized to obtain a matrix only composed of numbers 1 and 0, and the specific method for calculating the image similarity by using the projection contrast method is as follows:

counting the number of black dots of the image row and column to obtain a group of vectors (x, y), and comparing the vectors with the vector (x) of the target image0,y0) Comparing, calculating the distance between two groups of vectors to obtain similarity, dividing the image into n blocks by adopting a block comparison method for the characteristics of the image which is not lost, matching and calculating the similarity of each block to obtain a similarity vector, and calculating the vector distance to obtain the similarity;

wherein, the vector distance is calculated by adopting the formula of Euclidean distance algorithm as,xiDenotes the abscissa, y, of the ith pointiIndicating the ordinate of the ith point.

Further, the driving system drives the PMSM motor in a sine wave driving mode.

The invention has the following advantages: the actual data and the expected data are compared, so that the output value of the speed and the output value of the angle position are continuously corrected, the effect of correcting the final speed (including the magnitude and the direction of the numerical value) is achieved, the effect of automatically correcting the deviation is achieved, and the running precision is improved.

Drawings

Fig. 1 is a schematic flow chart of image comparison in environment information.

Detailed Description

The invention will be further described with reference to the accompanying drawings, but the scope of the invention is not limited to the following.

As shown in fig. 1, a self-adjusting method for a bluetooth manual control motor of a vehicle, the adjusting steps are:

s1, measuring the angle of the vehicle body by adopting an attitude angle sensor, and then adjusting;

s2, when the angle of the vehicle body is adjusted, the angle is controlled through double closed-loop control, namely the speed and the angle position are controlled;

s21, firstly, determining the pulse quantity output by the encoder when the motor runs at full speed, and taking the data as the maximum limit data of expected values, wherein the expected values comprise expected speed values and expected angle position values;

s22, measuring actual data in a first measuring period, wherein the actual data comprises actual speed data and actual angle position data;

s23, calculating to obtain the current error value E between the actual data and the expected value and the last error value E between the actual data and the expected value1Last error value E of actual data and expected value2

S24, calculating to obtain a closed loop output value XOUT

In the formula (1),

wherein, Kp、Ti、TdProportional coefficient, integral coefficient and differential coefficient;

the actual speed data and the expected speed value are substituted into the formula to obtain a speed closed-loop output value XOUT-υ

The actual angle position data and the expected angle position value are brought into the formula to obtain an angle position closed loop output value XOUT-φ

S25, determining various motion modes of the wheat wheel chassis and outputting a speed closed loop output value XOUT-υSum angular position closed loop output value XOUT-φCarrying out corresponding logic addition and subtraction fusion;

each mecanum wheel has a separate set of logical add-subtract fusion algorithms, which are specifically as follows:

in the prior convention, the numbers of the four wheat wheels of the left front, the left back, the right back and the right front are respectively M1, M2, M3 and M4 when viewed from the top;

the basic motion modes are divided into ten types, namely left translation, right translation, forward movement, backward movement, left front translation, right front translation, left back translation, right back translation, anticlockwise rotation and clockwise rotation;

in order to enable the program to have a more efficient and concise execution mode, angle correction is only added in four motion states of left-right translation and forward-backward movement, and specifically, the following logic addition and subtraction fusion table (shown in table 1) is shown, namely, in different motion states, each mecanum wheel should accord with the addition and subtraction logic of the following table at the same time.

TABLE 1 logic Add-subtract fusion table

S3, assigning the fused value in the step S25 to the driving system as the final speed, wherein the value is XOUT-υAnd XOUT-φAnd after the logic addition and subtraction are carried out on the fused scalar, the driving system can enable the four independent wheat wheels to reach an ideal motion state.

Steps S1 to S25 mainly determine speed information. In step S3, when the driving system is driven, the environmental information and the speed information are combined to form motion information, and the motion states of the four wheat wheels are adjusted by the motion information. The environment information is difference information obtained by comparing the actual shot picture with the picture library.

Specifically, when the environment information is obtained, the image can be regarded as a matrix, an element in the matrix is a color value, the color value is composed of three RGB parameters, and a matrix composed of only numbers 1 and 0 is obtained after the binarization processing of the image.

When the actual shot picture is compared with the picture library, the projection contrast method is used for calculating the picture similarity, and the specific method comprises the following steps: counting the number of black dots of the image row and column to obtain a group of vectors (x, y), and comparing the vectors with the vector (x) of the target image0,y0) Comparing, finding out the distance between two groups of vectors to obtain similarity, dividing the image into n blocks by block comparison method for the features of the image not lost, and calculating the similarity of the two groups of vectorsAnd respectively matching and calculating the similarity of each block to obtain a similarity vector, and then calculating the vector distance to obtain the similarity.

Calculating the vector distance by using an Euclidean distance algorithm according to the formula,xiDenotes the abscissa, y, of the ith pointiIndicating the ordinate of the ith point.

In this scheme, in step S1, a nine-axis attitude angle sensor is used to measure the vehicle body angle, and the measurement calculation is as follows:

in a factory environment, roll angle revision variables are introduced aiming at specific complex environmentsRevised variable of pitch angleYaw angle revision variableAnd a gravity acceleration revision coefficient Kg, wherein the first three variables are sent to the control system by the Bluetooth control module when the system is debugged, and the relationship among the three variables is as follows:

assuming that the gravity acceleration G is 1G, the three-axis acceleration components ax, ay and az of the gravity acceleration G on the b-system carrier coordinate system are respectively,

formula (2);

under the navigation coordinate system, the gravity acceleration is completely equal to Z under the navigation coordinate systemnThe axes coincide, and XnAnd YnThe component of the axis is 0, when the navigation coordinate system is converted to the carrier coordinate system, the conversion relation is a direction cosine matrix expressed by Euler angle, the specific relation is,

in the formula (3),

in the formula (4),

in the formula (5),

the three formulas are substituted into corresponding revision variables to obtain the final product through calculation

Pitch angle of vehicle body attitudeIn the formula (6),

roll angle of vehicle body attitudeFormula (7);

and because the output of the magnetometer is as follows when the magnetic geographic coordinate system is coincident with the b-system carrier coordinate systemWherein M isnRepresenting the magnetic field of a geographical coordinate system, MdRepresenting a magnetic declination under a magnetic geographic coordinate system;

and the output of the magnetometer in the b-system carrier coordinate system isWherein M isx bRepresenting the north component of the earth's magnetic field in the b coordinate system, My bRepresenting the east component of the magnetic field, Mz bRepresents the perpendicular component of the magnetic field becauseSubstituting equations (5) and (6) into the directional cosine array can obtain:

and finally, calculating and substituting the revised variables to obtain the deflection angle of the vehicle body attitude:

(。)

it should be noted that in the scheme, four independent sine wave driven PMSM motors are used as power sources of the driving system, and the four motors drive four wheat wheels. And the four PMSN motors are respectively controlled by four high-power drivers, and the drivers are connected to a main control board of the truck through a CAN bus.

During control, an AD2S1205 rotary transformer decoding chip is adopted to convert sine and cosine modulation signals output by the rotary transformer into digital signals, and the digital signals are output to a driver through an SPI communication interface. The driver controls the switching state of the high-power three-phase bridge arm according to the received decoding signal, and sine wave driving is achieved.

For a PMSM motor, to achieve sine wave driving, a rotating voltage vector of constant magnitude is synthesized by the three-phase windings of the motor. In the motor structure, the phase difference of three windings is 120 degrees, and then the vector-divided voltages which are mutually different by 120 degrees and the voltage of which changes along with the time according to the sine rule can be synthesized into a target voltage vector.

When the angle of the vehicle body is adjusted, manual control is performed through Bluetooth, and data transmitted during the manual control of the Bluetooth comprise packet header data, continuous data bytes and an end check bit; the packet header data is used for identifying Bluetooth data; the continuous data bytes comprise speed information, environment information and motion information; the technical check bits are used to check for errors in the data packet.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:用于运行机动车的转向系统的方法和装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类