Disclosure of Invention
The invention mainly aims to provide a motion control method, a motion control device, motion control equipment and a storage medium of a balance car, and aims to solve the technical problem of realizing stable and accurate steering control of the balance car.
In order to achieve the above object, the present invention provides a motion control method of a balance car, including:
acquiring current attitude information of a balance car under a preset road condition, and determining a first wheel balance parameter and a second wheel balance parameter of the balance car according to the current attitude information;
fusing the first wheel balance parameter and the second wheel balance parameter to obtain a target balance parameter;
and driving a motor of the balance car according to the target balance parameter so as to realize motion control.
Optionally, the step of obtaining current posture information of the balance car under the preset road condition includes:
acquiring first data of an acceleration sensor in a balance car and second data of a gyroscope under a preset road condition;
obtaining a real-time angular velocity value according to the first data, and obtaining an angular value according to the second data;
and determining the current attitude information of the balance car according to the real-time angular velocity value and the angular value.
Optionally, before the step of obtaining the real-time angular velocity value according to the first data, the method further includes:
acquiring a first data type corresponding to the first data;
judging whether the first data type meets a preset angular velocity type condition or not;
and when the first data type meets the preset angular velocity type condition, executing the step of obtaining the real-time angular velocity value according to the first data.
Optionally, before the step of obtaining the first data type corresponding to the first data, the method further includes:
acquiring a first data storage capacity corresponding to the first data;
judging whether the first data storage quantity meets a preset data storage condition or not;
and when the first data storage capacity meets the preset data storage condition, executing the step of acquiring the first data type corresponding to the first data.
Optionally, before the step of obtaining the angle value according to the second data, the method further includes:
acquiring a second data type corresponding to the second data;
judging whether the second data type meets a preset angle type condition or not;
and when the second data type meets the preset angle type condition, executing the step of obtaining the angle value according to the second data.
Optionally, before the step of obtaining the second data type corresponding to the second data, the method further includes:
acquiring a second data storage capacity corresponding to the second data;
judging whether the second data storage quantity meets a preset data storage condition or not;
and when the second data storage quantity meets the preset data storage condition, executing the step of acquiring a second data type corresponding to the second data.
Optionally, the step of obtaining a real-time angular velocity value according to the first data includes:
determining the angular speed of the balance car according to the first data;
performing integral processing on the angular velocity to obtain an output attitude dip angle, an attitude dip angle deviation and a noise value;
and determining a real-time angular velocity value according to the output attitude inclination angle, the attitude inclination angle deviation and the noise value.
Optionally, the step of determining a real-time angular velocity value according to the output attitude dip, the attitude dip deviation, and the noise value includes:
calculating a real-time angular velocity value through a preset angular velocity formula according to the output attitude inclination angle, the attitude inclination angle deviation and the noise value;
the preset angular velocity formula is as follows:
in the formula, Y 1 (t) is the output attitude dip angle, Y 2 (t) is attitude dip angle deviation, w (t) is noise value, y 1 (t) is an estimate of the Kalman filter, y 2 (t) deviation of Kalman filterValue u gyro And (t) is a real-time angular velocity value.
Optionally, obtaining a measurement noise value from the second data;
calculating an angle value through a preset angle formula according to the measurement noise value, the estimated value of the Kalman filter and the deviation value of the Kalman filter;
the preset angle formula is as follows:
where v (t) measures the noise value and z (t) is the angle value.
Optionally, the step of determining a first wheel balance parameter and a second wheel balance parameter of the balance vehicle according to the current attitude information includes:
analyzing the current attitude information to obtain the running state of the balance car;
and determining a first wheel balance parameter and a second wheel balance parameter of the balance vehicle according to the running state.
Optionally, the step of determining a first wheel balance parameter and a second wheel balance parameter of the balance vehicle according to the driving state comprises:
searching a corresponding sample wheel balance parameter from a preset driving state mapping relation table according to the driving state;
determining a first sample wheel balance parameter and a second sample wheel balance parameter according to the sample wheel balance parameter;
the preset driving state mapping relation table comprises a corresponding relation between a driving state and a sample wheel balance parameter.
Optionally, the step of performing fusion processing on the first wheel balance parameter and the second wheel balance parameter to obtain a target balance parameter includes:
determining a first motor output value according to the first wheel balance parameter, and determining a second motor output value according to the first motor output value and the second wheel balance parameter;
and carrying out fusion processing on the first motor output value and the second motor output value to obtain a target balance parameter.
In order to achieve the above object, the present invention further provides a motion control device for a balance vehicle, including:
the acquisition module is used for acquiring current attitude information of the balance car under a preset road condition and determining a first wheel balance parameter and a second wheel balance parameter of the balance car according to the current attitude information;
the processing module is used for carrying out fusion processing on the first wheel balance parameter and the second wheel balance parameter to obtain a target balance parameter;
and the control module is used for driving a motor of the balance car according to the target balance parameters so as to realize motion control.
Optionally, the obtaining module is further configured to obtain first data of an acceleration sensor in the balance car and second data of a gyroscope under a preset road condition;
the acquisition module is further used for acquiring a real-time angular velocity value according to the first data and acquiring an angular value according to the second data;
the acquisition module is further used for determining the current attitude information of the balance car according to the real-time angular velocity value and the angle value.
Optionally, the obtaining module is further configured to determine an angular velocity of the balance car according to the first data;
the acquisition module is further used for carrying out integral processing on the angular velocity to obtain an output attitude dip angle, an attitude dip angle deviation and a noise value;
the acquisition module is further used for determining a real-time angular velocity value according to the output attitude inclination angle, the attitude inclination angle deviation and the noise value.
Optionally, the obtaining module is further configured to analyze the current attitude information to obtain a driving state of the balance car;
the acquisition module is further used for determining a first wheel balance parameter and a second wheel balance parameter of the balance vehicle according to the running state.
Optionally, the obtaining module is further configured to search a corresponding sample wheel balance parameter from a preset driving state mapping relation table according to the driving state;
the acquisition module is further used for determining a first sample wheel balance parameter and a second sample wheel balance parameter according to the sample wheel balance parameter;
the obtaining module is further configured to obtain a corresponding relationship between a driving state and a sample wheel balance parameter in the preset driving state mapping relationship table.
Optionally, the processing module is further configured to determine a first motor output value according to the first wheel balance parameter, and determine a second motor output value according to the first motor output value and the second wheel balance parameter;
and the processing module is also used for carrying out fusion processing on the first motor output value and the second motor output value to obtain a target balance parameter.
In addition, to achieve the above object, the present invention also provides a motion control apparatus of a balance car, the apparatus including: the system comprises a memory, a processor and a motion control program of the balance car, wherein the motion control program of the balance car is stored on the memory and can run on the processor, and the motion control program of the balance car is configured to realize the steps of the motion control method of the balance car.
In addition, in order to achieve the above object, the present invention further provides a storage medium having a motion control program of the balance car stored thereon, wherein the motion control program of the balance car realizes the steps of the motion control method of the balance car as described above when executed by a processor.
The method comprises the steps of firstly obtaining current attitude information of the balance car under a preset road condition, determining a first wheel balance parameter and a second wheel balance parameter of the balance car according to the current attitude information, then carrying out fusion processing on the first wheel balance parameter and the second wheel balance parameter to obtain a target balance parameter, and then driving a motor of the balance car according to the target balance parameter to realize motion control. Compared with the prior art, the left-right balance of the balance car needs to be realized by depending on the control of a body, the acquired first wheel balance parameter and second wheel balance parameter are subjected to fusion processing to obtain a target balance parameter, and then the motor of the balance car is driven according to the target balance parameter, so that the stable and accurate steering control of the balance car is realized, and the riding experience of a user is further improved.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a motion control device of a balance car in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the motion control apparatus of the balance car may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory, or may be a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in FIG. 1 does not constitute a limitation of the motion control apparatus of the balance car and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a data storage module, a network communication module, a user interface module, and a motion control program of the balance car.
In the motion control apparatus of the balance car shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the motion control apparatus of the balance vehicle of the present invention may be provided in the motion control apparatus of the balance vehicle, and the motion control apparatus of the balance vehicle calls the motion control program of the balance vehicle stored in the memory 1005 through the processor 1001 and executes the motion control method of the balance vehicle provided by the embodiment of the present invention.
An embodiment of the present invention provides a motion control method for a balance car, and referring to fig. 2, fig. 2 is a schematic flow diagram of a first embodiment of the motion control method for the balance car according to the present invention.
In this embodiment, the motion control method of the balance car includes the following steps:
step S10: the method comprises the steps of obtaining current attitude information of the balance car under a preset road condition, and determining a first wheel balance parameter and a second wheel balance parameter of the balance car according to the current attitude information.
It is easy to understand that the executing body of the embodiment may be a motion control device of the balance car with functions of data processing, network communication, program operation, and the like, or may be other computer devices with similar functions, and the embodiment is not limited.
The preset road condition may be various road surfaces on which the user rides the balance car, may be an uphill road condition, may also be a downhill road condition, and the like, and the embodiment is not limited.
It can be understood that the current attitude information of the balance car may be a real-time angular velocity value, an angle value, and the like of the balance car, and the step of obtaining the current attitude information of the balance car under the preset road condition may be obtaining first data of an acceleration sensor in the balance car under the preset road condition and second data of a gyroscope, obtaining the real-time angular velocity value according to the first data, obtaining the angle value according to the second data, and determining the current attitude information, and the like of the balance car according to the real-time angular velocity value and the angle value.
It should be noted that, in the present embodiment, a gyroscope and an acceleration sensor inside the two-wheel two-side control system of the balance vehicle are used to detect a change of the vehicle body attitude, that is, the two-wheel two-side control system of the balance vehicle acquires respective attitude information through a high-precision 6-axis attitude sensor, and uses a servo control system to accurately drive a motor to perform corresponding adjustment, so as to maintain the balance of the system.
The first data may be a single angular velocity or multiple angular velocities acquired by using an acceleration sensor in the balance car, and the second data may be a single angle value or multiple angle values acquired by using a gyroscope in the balance car, which is not limited in this embodiment.
In order to obtain accurate first data, before the step of obtaining the real-time angular velocity value according to the first data, a first data type corresponding to the first data needs to be obtained, whether the first data type meets a preset angular velocity type condition or not is judged, and when the first data type meets the preset angular velocity type condition, the real-time angular velocity value and the like are obtained according to the first data.
The first data type may be understood as a type corresponding to an angular velocity value, and the preset angular velocity type condition may be a type corresponding to an angular velocity, and the present embodiment is not limited thereto.
Assuming that a first data type corresponding to the acquired first data is an A type and the condition of the preset angular velocity type is the A type, then judging whether the A type of the first data type is consistent with the A type of the preset angular velocity, and when the A type of the first data type is consistent with the A type of the preset angular velocity, obtaining a real-time angular velocity value and the like according to the first data.
Before the step of obtaining the first data type corresponding to the first data, a first data storage amount corresponding to the first data is also required to be obtained, whether the first data storage amount meets a preset data storage condition is judged, and when the first data storage amount meets the preset data storage condition, the first data type corresponding to the first data is obtained.
The first data storage amount may be understood as a storage size corresponding to a single angular velocity or multiple angular velocities, and the preset data storage condition may be set by a user in a customized manner, and may be 5kb, or may be 5M, and the embodiment is not limited.
If the first data storage amount corresponding to the acquired first data is 5kb and the preset data storage condition is 5kb, judging whether the first data storage amount is consistent with a preset data storage threshold value, and acquiring a first data type corresponding to the first data when the first data storage amount is consistent with the preset data storage threshold value.
Further, in order to accurately obtain the angle value, before the step of obtaining the angle value according to the second data, a second data type corresponding to the second data needs to be obtained, and then it is determined whether the second data type meets a preset angle type condition, and when the second data type meets the preset angle type condition, the angle value is obtained according to the second data, and the like.
The second data type may be understood as a type corresponding to an angle value, and the preset angular velocity type condition may be a type corresponding to an angle, and the present embodiment is not limited thereto.
And if the second data type corresponding to the acquired second data is a B type and the preset angle type condition is the same as the B type, judging whether the second data type B is consistent with the preset angle type B, and when the second data type B is consistent with the preset angle type B, obtaining an angle value and the like according to the second data.
Before the step of obtaining the second data type corresponding to the second data, a second data storage amount corresponding to the second data is also required to be obtained, whether the second data storage amount meets a preset data storage condition is judged, and when the second data storage amount meets the preset data storage condition, the second data type corresponding to the second data is obtained, and the like.
The second data storage amount may be understood as a storage size corresponding to a single angle value or a plurality of angle values, and the like, and the preset data storage condition may be set by a user in a self-defined manner, may be 8kb, may also be 6M, and the like, and this embodiment is not limited.
And if the second data storage amount corresponding to the acquired second data is 6M and the preset data storage condition is 6M, judging whether the second data storage amount is consistent with a preset data storage threshold value, and acquiring a second data type corresponding to the second data when the second data storage amount is consistent with the preset data storage threshold value.
The step of obtaining the real-time angular velocity value according to the first data may be determining an angular velocity of the balance car according to the first data, then performing integration processing on the angular velocity to obtain an output attitude inclination angle, an attitude inclination angle deviation and a noise value, and finally determining the real-time angular velocity value according to the output attitude inclination angle, the attitude inclination angle deviation and the noise value.
The real-time angular velocity value can be determined according to the output attitude inclination angle, the attitude inclination angle deviation and the noise value by calculating the real-time angular velocity value through a preset angular velocity formula according to the output attitude inclination angle, the attitude inclination angle deviation and the noise value;
the preset angular velocity formula is:
in the formula, Y 1 (t) is the output attitude dip angle, Y 2 (t) is attitude dip angle deviation, w (t) is noise value, y 1 (t) is an estimate of the Kalman filterValue, y 2 (t) deviation value of Kalman filter, u gyro And (t) is a real-time angular velocity value.
The preset angular velocity formula can be a state formula in the Kalman filter which is required to be subjected to integral processing when the acceleration sensor is used for solving the attitude angle, and can be constructed according to the characteristic of the acceleration sensor.
The method for obtaining the angle value according to the second data may be that a measurement noise value is obtained according to the second data, and then the angle value is calculated through a preset angle formula according to the measurement noise value, the estimation value of the kalman filter and the deviation value of the kalman filter;
the formula of the preset angle is as follows:
where v (t) measures the noise value and z (t) is the angle value.
The accelerometer can detect acceleration components on each axis of the space rectangular coordinate system during movement, namely a space vector of current movement can be obtained, and the current attitude angle of the direction can be obtained by calculating the included angle between any axis and the space vector.
The step of determining the first wheel balance parameter and the second wheel balance parameter of the balance car according to the current attitude information may be to analyze the current attitude information to obtain a running state of the balance car, and then determine the first wheel balance parameter and the second wheel balance parameter of the balance car according to the running state.
The method for determining the first wheel balance parameter and the second wheel balance parameter of the balance vehicle according to the driving state may be that a corresponding sample wheel balance parameter is searched from a preset driving state mapping relation table according to the driving state, then the first sample wheel balance parameter and the second sample wheel balance parameter are determined according to the sample wheel balance parameter, then the preset driving state mapping relation table includes a corresponding relation between the driving state and the sample wheel balance parameter, and a plurality of driving states and a plurality of sample wheel balance parameters and the like exist in the preset driving state mapping relation table.
The first wheel balance parameter may be a parameter required to maintain balance for a left wheel of the balance vehicle, and the second wheel balance parameter may be a parameter required to maintain balance for a right wheel of the balance vehicle, and the embodiment is not limited.
The driving state may be an acceleration state, a pause state, a steering state, and the like, and the embodiment is not limited thereto.
Step S20: and carrying out fusion processing on the first wheel balance parameter and the second wheel balance parameter to obtain a target balance parameter.
The target balance parameter is obtained by performing fusion processing on the first wheel balance parameter and the second wheel balance parameter, wherein a first motor output value is determined according to the first wheel balance parameter, a second motor output value is determined according to the first motor output value and the second wheel balance parameter, and then the first motor output value and the second motor output value are subjected to fusion processing to obtain the target balance parameter and the like.
The manner of determining the first motor output value according to the first wheel balance parameter may be to convert the first wheel balance parameter to obtain a corresponding first motor output value, or to calculate a first motor output value required for respective balance through a balance control algorithm, or the like.
The step of obtaining the output value of the second motor may be that the two-side control system performs communication and data exchange at a high frequency of 500HZ to obtain the output value of the second motor required by the control calculation of the other side, or may determine the output value of the second motor according to the output value of the first motor and the balance parameter of the second wheel, and the like, which is not limited in this embodiment.
In specific implementation, the first motor output value and the second motor output value need to be fused through a self-adaptive algorithm to obtain a final output motor value, namely a target balance parameter and the like.
It should be noted that the control algorithm of the balance car is more intelligent than the prior art. The parameters are optimized and matched aiming at different loads, different riding pavements and riding at different speeds. Gather angle, angular velocity, speed of traveling, current electric current, voltage isoparametric in real time, through multisensor data fusion, current state of riding is discerned to the intelligence to calculate optimal parameter, reach better riding experience etc..
Step S30: and driving a motor of the balance car according to the target balance parameter so as to realize motion control.
It should be understood that the target balance parameters obtained drive the motor of the balance car to realize motion control, and besides, the steering damping control algorithm can be customized for the balance car, so that stable and accurate steering control is realized. Make balance car ride more stable and smooth. Under different loads and different speeds, the steering damping algorithm calculates the currently most appropriate compensation coefficient according to real-time dynamic voltage, current and speed, then obtains steering control outputs on two sides respectively through damping filtering calculation, and further drives a motor of the balance car according to the steering control outputs on the two sides so as to realize motion control and the like.
In this embodiment, first, current attitude information of the balance vehicle under a preset road condition is obtained, a first wheel balance parameter and a second wheel balance parameter of the balance vehicle are determined according to the current attitude information, then the first wheel balance parameter and the second wheel balance parameter are subjected to fusion processing to obtain a target balance parameter, and then a motor of the balance vehicle is driven according to the target balance parameter to realize motion control. Compare in prior art, need rely on the control of health to realize the balance car control balance, and this embodiment fuses the processing to the first wheel balance parameter and the second wheel balance parameter that acquire, obtains the target balance parameter, later according to the motor of target balance parameter drive balance car, has realized the steady and accurate steering control of balance car, and then has improved user's the experience of riding.
Referring to fig. 3, fig. 3 is a schematic flow chart of a motion control method of a balance car according to a second embodiment of the present invention.
Based on the first embodiment, in this embodiment, the step S10 further includes:
step S101: acquiring first data of a gyroscope and second data of an acceleration sensor in the balance car under a preset road condition.
The preset road condition may be various road surfaces on which the user rides the balance car, may be an uphill road condition, may also be a downhill road condition, and the like, and the present embodiment is not limited.
It can be understood that the current attitude information of the balance car may be a real-time angular velocity value, an angle value, and the like of the balance car, and the step of obtaining the current attitude information of the balance car under the preset road condition may be obtaining first data of an acceleration sensor and second data of a gyroscope in the balance car under the preset road condition, obtaining the real-time angular velocity value according to the first data, obtaining the angle value according to the second data, and determining the current attitude information of the balance car according to the real-time angular velocity value and the angle value, and the like.
It should be noted that, in the present embodiment, the gyroscope and the acceleration sensor inside the two-wheel two-side control system of the balance vehicle are used to detect the change of the vehicle body attitude, that is, the two-wheel two-side control system of the balance vehicle collects respective attitude information through the high-precision 6-axis attitude sensor, and uses the servo control system to accurately drive the motor to perform corresponding adjustment, so as to maintain the balance of the system.
The first data may be a single angular velocity or multiple angular velocities acquired by using an acceleration sensor in the balance car, and the second data may be a single angle value or multiple angle values acquired by using a gyroscope in the balance car, which is not limited in this embodiment.
Step S102: and obtaining a real-time angular velocity value according to the first data, and obtaining an angular value according to the second data.
In order to obtain accurate first data, before the step of obtaining the real-time angular velocity value according to the first data, a first data type corresponding to the first data is also required to be obtained, whether the first data type meets a preset angular velocity type condition or not is then judged, and when the first data type meets the preset angular velocity type condition, the real-time angular velocity value and the like are obtained according to the first data.
The first data type may be understood as a type corresponding to an angular velocity value, and the preset angular velocity type condition may be a type corresponding to an angular velocity, and the present embodiment is not limited thereto.
Assuming that a first data type corresponding to the acquired first data is an A type and the condition of the preset angular velocity type is the A type, then judging whether the A type of the first data type is consistent with the A type of the preset angular velocity, and when the A type of the first data type is consistent with the A type of the preset angular velocity, obtaining a real-time angular velocity value and the like according to the first data.
Before the step of obtaining the first data type corresponding to the first data, a first data storage amount corresponding to the first data is also required to be obtained, whether the first data storage amount meets a preset data storage condition is judged, and when the first data storage amount meets the preset data storage condition, the first data type corresponding to the first data is obtained.
The first data storage amount may be understood as a storage size corresponding to a single angular velocity or multiple angular velocities, and the preset data storage condition may be set by a user in a customized manner, and may be 5kb, or may be 5M, and the embodiment is not limited.
If the first data storage amount corresponding to the acquired first data is 5kb and the preset data storage condition is 5kb, judging whether the first data storage amount is consistent with a preset data storage threshold value, and acquiring a first data type corresponding to the first data when the first data storage amount is consistent with the preset data storage threshold value.
Further, in order to accurately obtain the angle value, before the step of obtaining the angle value according to the second data, a second data type corresponding to the second data needs to be obtained, and then it is determined whether the second data type meets a preset angle type condition, and when the second data type meets the preset angle type condition, the angle value is obtained according to the second data, and the like.
The second data type may be understood as a type corresponding to an angle value, and the preset angular velocity type condition may be a type corresponding to an angle, and the present embodiment is not limited thereto.
And if the second data type corresponding to the acquired second data is a B type and the preset angle type condition is the B type, judging whether the second data type B is consistent with the preset angle type B, and acquiring an angle value and the like according to the second data when the second data type B is consistent with the preset angle type B.
Before the step of obtaining the second data type corresponding to the second data, a second data storage amount corresponding to the second data is also required to be obtained, whether the second data storage amount meets a preset data storage condition is judged, and when the second data storage amount meets the preset data storage condition, the second data type corresponding to the second data is obtained, and the like.
The second data storage amount may be understood as a storage size corresponding to a single angle value or multiple angle values, and the preset data storage condition may be set by a user in a self-defined manner, and may be 8kb, or may be 6M, and the embodiment is not limited.
And if the second data storage amount corresponding to the acquired second data is 6M and the preset data storage condition is 6M, judging whether the second data storage amount is consistent with a preset data storage threshold value, and acquiring a second data type corresponding to the second data when the second data storage amount is consistent with the preset data storage threshold value.
The step of obtaining the real-time angular velocity value according to the first data may be determining an angular velocity of the balance car according to the first data, then performing integral processing on the angular velocity to obtain an output attitude inclination angle, an attitude inclination angle deviation and a noise value, and finally determining the real-time angular velocity value according to the output attitude inclination angle, the attitude inclination angle deviation and the noise value.
The real-time angular velocity value may be determined according to the output attitude inclination angle, the deviation of the attitude inclination angle, and the noise value by calculating the real-time angular velocity value according to a preset angular velocity formula according to the output attitude inclination angle, the deviation of the attitude inclination angle, and the noise value.
The preset angular velocity formula can be a state formula in the Kalman filter which is required to be subjected to integral processing when the acceleration sensor is used for solving the attitude angle, and can be constructed according to the characteristic of the acceleration sensor.
The manner of obtaining the angle value according to the second data may be to obtain a measurement noise value according to the second data, and then calculate the angle value according to the measurement noise value, the estimation value of the kalman filter, and the deviation value of the kalman filter by a preset angle formula.
The accelerometer can detect acceleration components on each axis of the space rectangular coordinate system during movement, namely a space vector of current movement can be obtained, and the current attitude angle of the direction can be obtained by calculating the included angle between any axis and the space vector.
Step S103: determining the current attitude information of the balance vehicle according to the real-time angular velocity value and the angular value, and determining a first wheel balance parameter and a second wheel balance parameter of the balance vehicle according to the current attitude information.
The step of determining the first wheel balance parameter and the second wheel balance parameter of the balance car according to the current attitude information may be to analyze the current attitude information to obtain a running state of the balance car, and then determine the first wheel balance parameter and the second wheel balance parameter of the balance car according to the running state.
The method for determining the first wheel balance parameter and the second wheel balance parameter of the balance vehicle according to the driving state may be that a corresponding sample wheel balance parameter is searched from a preset driving state mapping relation table according to the driving state, then the first sample wheel balance parameter and the second sample wheel balance parameter are determined according to the sample wheel balance parameter, then the preset driving state mapping relation table includes a corresponding relation between the driving state and the sample wheel balance parameter, and a plurality of driving states and a plurality of sample wheel balance parameters and the like exist in the preset driving state mapping relation table.
The first wheel balance parameter may be a parameter required for balancing a left wheel of the vehicle, and the like, and the second wheel balance parameter may be a parameter required for balancing a right wheel of the vehicle, and the like, and this embodiment is not limited.
The driving state may be an acceleration state, a pause state, a steering state, and the like, and the embodiment is not limited thereto.
In the implementation, first data of an acceleration sensor and second data of a gyroscope in a balance car under a preset road condition are firstly acquired, then a real-time angular velocity value is acquired according to the first data, an angle value is acquired according to the second data, and finally current attitude information of the balance car is determined according to the real-time angular velocity value and the angle value, so that accurate attitude information of the balance car is acquired.
Referring to fig. 4, fig. 4 is a schematic flow chart of a motion control method of a balance car according to a third embodiment of the present invention.
Based on the foregoing first embodiment, in this embodiment, the step S20 further includes:
step S201: and determining a first motor output value according to the first wheel balance parameter, and determining a second motor output value according to the first motor output value and the second wheel balance parameter.
The manner of determining the first motor output value according to the first wheel balance parameter may be to convert the first wheel balance parameter to obtain a corresponding first motor output value, or to calculate a first motor output value required for respective balance through a balance control algorithm, or the like.
The step of obtaining the output value of the second motor may be that the two-side control system performs communication and data exchange at a high frequency of 500HZ to obtain the output value of the second motor required by the control calculation of the other side, or may determine the output value of the second motor according to the output value of the first motor and the balance parameter of the second wheel, and the like, which is not limited in this embodiment.
Step S202: and carrying out fusion processing on the first motor output value and the second motor output value to obtain a target balance parameter.
In specific implementation, the first motor output value and the second motor output value need to be fused through a self-adaptive algorithm to obtain a final output motor value, namely a target balance parameter and the like.
It should be noted that the control algorithm of the balance car is more intelligent than the prior art. The parameters are optimized and matched according to different loads, different riding pavements and riding at different speeds. Gather angle, angular velocity, speed of traveling, current electric current, voltage isoparametric in real time, through multisensor data fusion, current state of riding is discerned to the intelligence to calculate optimal parameter, reach better riding experience etc..
In this embodiment, first motor output value is determined according to a first wheel balance parameter, second motor output value is determined according to the first motor output value and a second wheel balance parameter, and then the first motor output value and the second motor output value are fused to obtain a target balance parameter, so that an accurate target balance parameter is obtained, and stable and accurate steering control of the balance car is realized.
Referring to fig. 5, fig. 5 is a block diagram illustrating a motion control apparatus of a balance car according to a first embodiment of the present invention.
As shown in fig. 5, a motion control device for a balance car according to an embodiment of the present invention includes:
the obtaining module 5001 is configured to obtain current attitude information of the balance car under a preset road condition, and determine a first wheel balance parameter and a second wheel balance parameter of the balance car according to the current attitude information;
a processing module 5002, configured to perform fusion processing on the first wheel balance parameter and the second wheel balance parameter to obtain a target balance parameter;
and the control module 5003 is used for driving a motor of the balance car according to the target balance parameters so as to realize motion control.
In this embodiment, first, current posture information of the balance car under a preset road condition is obtained, a first wheel balance parameter and a second wheel balance parameter of the balance car are determined according to the current posture information, then the first wheel balance parameter and the second wheel balance parameter are subjected to fusion processing to obtain a target balance parameter, and then a motor of the balance car is driven according to the target balance parameter to realize motion control. Compare in prior art, need rely on the control of health to realize the balance car control balance, and this embodiment fuses the processing to the first wheel balance parameter and the second wheel balance parameter that acquire, obtains the target balance parameter, later according to the motor of target balance parameter drive balance car, has realized the steady and accurate steering control of balance car, and then has improved user's the experience of riding.
Further, the obtaining module 5001 is further configured to obtain first data of an acceleration sensor in the balance car and second data of a gyroscope under a preset road condition;
the obtaining module 5001 is further configured to obtain a real-time angular velocity value according to the first data, and obtain an angular value according to the second data;
the obtaining module 5001 is further configured to determine the current attitude information of the balance car according to the real-time angular velocity value and the angle value.
Further, the obtaining module 5001 is further configured to obtain a first data type corresponding to the first data;
the obtaining module 5001 is further configured to determine whether the first data type meets a preset angular velocity type condition;
the obtaining module 5001 is further configured to execute the operation of obtaining the real-time angular velocity value according to the first data when the first data type meets the preset angular velocity type condition.
Further, the obtaining module 5001 is further configured to obtain a first data storage amount corresponding to the first data;
the obtaining module 5001 is further configured to determine whether the first data storage amount meets a preset data storage condition;
the obtaining module 5001 is further configured to execute the operation of obtaining the first data type corresponding to the first data when the first data storage amount meets the preset data storage condition.
Further, the obtaining module 5001 is further configured to obtain a second data type corresponding to the second data;
the obtaining module 5001 is further configured to determine whether the second data type meets a preset angle type condition;
the obtaining module 5001 is further configured to execute the operation of obtaining the angle value according to the second data when the second data type meets the preset angle type condition.
Further, the obtaining module 5001 is further configured to obtain a second data storage amount corresponding to the second data;
the obtaining module 5001 is further configured to determine whether the second data storage amount meets a preset data storage condition;
the obtaining module 5001 is further configured to execute the operation of obtaining the second data type corresponding to the second data when the second data storage amount meets the preset data storage condition.
Further, the obtaining module 5001 is further configured to determine an angular velocity of the balance car according to the first data;
the obtaining module 5001 is further configured to perform integration processing on the angular velocity to obtain an output attitude inclination angle, an attitude inclination angle deviation, and a noise value;
the obtaining module 5001 is further configured to determine a real-time angular velocity value according to the output attitude tilt angle, the attitude tilt angle deviation, and the noise value.
Further, the obtaining module 5001 is further configured to calculate a real-time angular velocity value according to the output attitude inclination angle, the attitude inclination angle deviation and the noise value through a preset angular velocity formula;
the preset angular velocity formula is as follows:
in the formula, Y 1 (t) is the output attitude dip, Y 2 (t) is attitude dip angle deviation, w (t) is noise value, y 1 (t) is an estimate of the Kalman filter, y 2 (t) is the deviation value of the Kalman filter, u gyro And (t) is a real-time angular velocity value.
Further, the obtaining module 5001 is further configured to obtain a measurement noise value according to the second data;
the obtaining module 5001 is further configured to calculate an angle value according to the measurement noise value, the estimated value of the kalman filter, and the deviation value of the kalman filter by using a preset angle formula;
the preset angle formula is as follows:
where v (t) measures the noise value and z (t) is the angle value.
Further, the obtaining module 5001 is further configured to analyze the current attitude information to obtain a driving state of the balance car;
the obtaining module 5001 is further configured to determine a first wheel balance parameter and a second wheel balance parameter of the balance vehicle according to the driving state.
Further, the obtaining module 5001 is further configured to search a corresponding sample wheel balance parameter from a preset driving state mapping relationship table according to the driving state;
the obtaining module 5001 is further configured to determine a first sample wheel balance parameter and a second sample wheel balance parameter according to the sample wheel balance parameter;
the obtaining module 5001 is further configured to use the preset driving state mapping relationship table to include a corresponding relationship between a driving state and a sample wheel balance parameter.
Further, the processing module 5002 is further configured to determine a first motor output value according to the first wheel balance parameter, and determine a second motor output value according to the first motor output value and the second wheel balance parameter;
the processing module 5002 is further configured to perform fusion processing on the first motor output value and the second motor output value to obtain a target balance parameter.
Other embodiments or specific implementation manners of the motion control device of the balance car of the present invention may refer to the above method embodiments, and are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or system comprising the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., a rom/ram, a magnetic disk, an optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.