Motor control method based on motor control instruction curve

文档序号:786438 发布日期:2021-04-09 浏览:7次 中文

阅读说明:本技术 一种基于电机控制指令曲线的电机控制方法 (Motor control method based on motor control instruction curve ) 是由 周成森 于 2020-12-17 设计创作,主要内容包括:本发明涉及一种基于电机控制指令曲线的电机控制方法,包括以下步骤:确定控制过程中电压趋势以及电压峰值和电压谷值;建立直角坐标系,其中直角坐标系的x轴为时间,y轴为电压,并根据确定的电压趋势将确定的电压峰值和电压谷值放入所述直角坐标系中,得到各个电压峰值和电压谷值的坐标;在电压峰值和电压谷值处做三次样条插值,消除折点,得到最终曲线;根据最终曲线对电机进行控制。本发明可以通过少量顶点坐标构造整个指令曲线,且曲线不存在折点,减小了特定工况对电机的影响。(The invention relates to a motor control method based on a motor control instruction curve, which comprises the following steps: determining a voltage trend, a voltage peak value and a voltage valley value in the control process; establishing a rectangular coordinate system, wherein the x axis of the rectangular coordinate system is time, the y axis of the rectangular coordinate system is voltage, and the determined voltage peak value and voltage valley value are put into the rectangular coordinate system according to the determined voltage trend to obtain the coordinates of each voltage peak value and voltage valley value; performing cubic spline interpolation at the voltage peak value and the voltage valley value to eliminate break points and obtain a final curve; and controlling the motor according to the final curve. The invention can construct the whole command curve through a small amount of vertex coordinates, and the curve has no break point, thereby reducing the influence of specific working conditions on the motor.)

1. A motor control method based on a motor control command curve is characterized by comprising the following steps:

(1) determining a voltage trend, a voltage peak value and a voltage valley value in the control process;

(2) establishing a rectangular coordinate system, wherein the x axis of the rectangular coordinate system is time, the y axis of the rectangular coordinate system is voltage, and the determined voltage peak value and voltage valley value are put into the rectangular coordinate system according to the determined voltage trend to obtain the coordinates of each voltage peak value and voltage valley value;

(3) one-dimensional linear interpolation is carried out in the interval between adjacent points, and the coordinates of a curve are filled;

(4) performing cubic spline interpolation at the voltage peak value and the voltage valley value to eliminate break points and obtain a final curve;

(5) and controlling the motor according to the final curve.

2. The motor control method based on the motor control command curve according to claim 1, wherein the step (3) is specifically: connecting two adjacent points, and setting the coordinates of the two adjacent points as (x)1,y1) And (x)2,y2) In [ x ]1,x2]Within interval of 1msThe division interval is divided into (x)2-x1) X 1000 equal parts, taking the endpoint value x of each equal partiCorresponding to yiIs calculated by the formulaWill obtain (x)i,yi) And (4) supplementing the rectangular coordinate system so that the interval between adjacent points is 1 ms.

3. The motor control method based on the motor control command curve according to claim 1, wherein the step (4) comprises the following sub-steps:

(41) determining the coordinates (x ', y') of the voltage peak or the voltage valley, setting the transition time T, calculating the slopes of the two lines at the left and the right of the voltage peak or the voltage valley, wherein k is1And k2

(42) Calculating endpoint coordinates (x ') of transition interval'1,y′1) And (x'2,y′2) The calculation method is as follows:

(43) in [ < x >'1,x′2]Carrying out cubic spline interpolation in the interval to obtain a spline function expression;

(44) in [ < x >'1,x′2]Within the interval, the interval is divided into (x ') at intervals of 1 ms'2-x′1) X 1000 equal parts, taking endpoint value of each equal part x'iA is toiAnd (4) substituting the spline function expression to obtain a new set of coordinate values, and replacing the curve coordinates filled in the step (3) with the new coordinate values.

4. The motor control method based on the motor control command curve according to claim 3, wherein the step (43) is specifically as follows: let the cubic spline function be S (x ') -a + bx ' + cx '2+dx′3First, n +1 coordinates are specified, n regions being totalAnd n +1 coordinates are all on a spline function S (x '), and the spline function S (x') is in an interval [ x 'according to the definition of cubic spline interpolation'1,x′2]Inside is a piecewise cubic polynomial with S (x '), derivative S' (x '), second derivative S' (x ') in the interval [ x'1,x′2]Inner continuity, then, according to its interpolation and continuity, hasAccording to its differential continuityThe n intervals have 4n unknowns, and the equations show that 4n-2 equations exist in the n intervals, and the derivative values of the curves are limited at the head end and the tail end and are respectively k1And k2I.e. byA spline function expression can be obtained from the above equation.

Technical Field

The invention relates to the technical field of motor motion control, in particular to a motor control method based on a motor control instruction curve.

Background

In the automatic test and control process in the automobile electronic field, the motor is often required to be controlled to rotate according to a specific speed or torque, in practical engineering application, the motor is controlled by continuously outputting voltage to the motor, the time interval of the voltage output is 1ms or less, so that the data volume of the voltage is very large in the whole test or control process, and if the voltage value is specified point by point, the workload can be greatly increased. In addition, when the speed of the motor needs to be controlled to rise and fall at a constant speed, a break point appears in a command curve, and the acceleration at the break point changes sharply, which is very unfavorable for the motor and the system.

Disclosure of Invention

The invention aims to solve the technical problem of providing a motor control method based on a motor control command curve, which can construct the whole command curve through a small number of vertex coordinates, and the curve has no break point, thereby reducing the influence of specific working conditions on the motor.

The technical scheme adopted by the invention for solving the technical problems is as follows: the motor control method based on the motor control command curve comprises the following steps:

(1) determining a voltage trend, a voltage peak value and a voltage valley value in the control process;

(2) establishing a rectangular coordinate system, wherein the x axis of the rectangular coordinate system is time, the y axis of the rectangular coordinate system is voltage, and the determined voltage peak value and voltage valley value are put into the rectangular coordinate system according to the determined voltage trend to obtain the coordinates of each voltage peak value and voltage valley value;

(3) one-dimensional linear interpolation is carried out in the interval between adjacent points, and the coordinates of a curve are filled;

(4) performing cubic spline interpolation at the voltage peak value and the voltage valley value to eliminate break points and obtain a final curve;

(5) and controlling the motor according to the final curve.

The step (3) is specifically as follows: connecting two adjacent points, and setting the coordinates of the two adjacent points as (x)1,y1) And (x)2,y2) In [ x ]1,x2]The interval is divided into (x) within the interval by taking 1ms as an interval2-x1) X 1000 equal parts, taking the endpoint value x of each equal partiCorresponding to yiIs calculated by the formulaWill obtain (x)i,yi) And (4) supplementing the rectangular coordinate system so that the interval between adjacent points is 1 ms.

The step (4) specifically comprises the following substeps:

(41) determining the coordinates (x ', y') of the voltage peak or the voltage valley, setting the transition time T, calculating the slopes of the two lines at the left and the right of the voltage peak or the voltage valley, wherein k is1And k2

(42) Calculating endpoint coordinates (x ') of transition interval'1,y′1) And (x'2,y′2) The calculation method is as follows:

(43) in [ < x >'1,x′2]Carrying out cubic spline interpolation in the interval to obtain a spline function expression;

(44) in [ < x >'1,x′2]Within the interval, the interval is divided into (x ') at intervals of 1 ms'2-x′1) X 1000 equal parts, taking endpoint value of each equal part x'iA is toiAnd (4) substituting the spline function expression to obtain a new set of coordinate values, and replacing the curve coordinates filled in the step (3) with the new coordinate values.

The step (43) is specifically as follows: let the cubic spline function be S (x ') -a + bx ' + cx '2+dx′3First, n +1 coordinates are specified, n intervals are provided, n +1 coordinates are all on a spline function S (x '), and the spline function S (x ') is in the interval [ x '1,x′2]Inside is a piecewise cubic polynomial with S (x '), derivative S' (x '), second derivative S' (x ') in the interval [ x'1,x′2]Inner continuity, then, according to its interpolation and continuity, hasAccording to its differential continuityThe n intervals have 4n unknowns, and the equations show that 4n-2 equations exist in the n intervals, and the derivative values of the curves are limited at the head end and the tail end and are respectively k1And k2I.e. byThe spline function can be obtained from the above equationAnd (5) expressing.

Advantageous effects

Due to the adoption of the technical scheme, compared with the prior art, the invention has the following advantages and positive effects: the invention does not need to appoint the coordinates of the curve point by point, and the time interval between adjacent points of the curve is small, in addition, the broken point of the curve is eliminated by a spline interpolation method, and the influence of the test working condition on the system is effectively reduced.

Drawings

FIG. 1 is a flow chart of the present invention;

FIG. 2 is a schematic diagram of coordinates of a vertex of a curve in an embodiment of the invention;

FIG. 3 is a graph of cubic spline interpolation in an embodiment of the present invention.

Detailed Description

The invention will be further illustrated with reference to the following specific examples. It should be understood that these examples are for illustrative purposes only and are not intended to limit the scope of the present invention. Further, it should be understood that various changes or modifications of the present invention may be made by those skilled in the art after reading the teaching of the present invention, and such equivalents may fall within the scope of the present invention as defined in the appended claims.

The embodiment of the invention relates to a motor control method based on a motor control command curve, which comprises the following steps as shown in figure 1:

(1) determining a voltage trend, a voltage peak value and a voltage valley value in the control process;

(2) establishing a rectangular coordinate system, wherein the x axis of the rectangular coordinate system is time, the y axis of the rectangular coordinate system is voltage, and the determined voltage peak value and voltage valley value are put into the rectangular coordinate system according to the determined voltage trend to obtain the coordinates of each voltage peak value and voltage valley value;

(3) one-dimensional linear interpolation is carried out in the interval between adjacent points, and the coordinates of a curve are filled; the method specifically comprises the following steps: connecting two adjacent points, and setting the coordinates of the two adjacent points as (x)1,y1) And (x)2,y2) In [ x ]1,x2]The interval is divided into (x) within the interval by taking 1ms as an interval2-x1) X 1000 equal parts, each equalNumber of points xiCorresponding to yiIs calculated by the formulaWill obtain (x)i,yi) Supplementing into the rectangular coordinate system to make the interval between adjacent points 1ms

(4) Performing cubic spline interpolation at the voltage peak value and the voltage valley value to eliminate break points and obtain a final curve, and specifically comprising the following substeps:

(41) determining the coordinates (x ', y') of the voltage peak or the voltage valley, setting the transition time T, calculating the slopes of the two lines at the left and the right of the voltage peak or the voltage valley, wherein k is1And k2

(42) Calculating endpoint coordinates (x ') of transition interval'1,y′1) And (x'2,y′2) The calculation method is as follows:

(43) in [ < x >'1,x′2]Carrying out cubic spline interpolation in the interval to obtain a spline function expression; the method specifically comprises the following steps: let the cubic spline function be S (x ') -a + bx ' + cx '2+dx′3First, n +1 coordinates are specified, n intervals are provided, n +1 coordinates are all on a spline function S (x '), and the spline function S (x ') is in the interval [ x '1,x′2]Inside is a piecewise cubic polynomial with S (x '), derivative S' (x '), second derivative S' (x ') in the interval [ x'1,x′2]Inner continuity, then, according to its interpolation and continuity, hasAccording to its differential continuityThe total number of unknowns is 4n in n intervals, and as can be seen from the above equation, there are 4n-2 equations in n intervalsThe derivative values of the curves are limited at the head and tail ends of the curve and are respectively k1And k2I.e. byA spline function expression can be obtained from the above equation.

(44) In [ < x >'1,x′2]Within the interval, the interval is divided into (x ') at intervals of 1 ms'2-x′1) X 1000 equal parts, taking endpoint value of each equal part x'iA is toiAnd (4) substituting the spline function expression to obtain a new set of coordinate values, and replacing the curve coordinates filled in the step (3) with the new coordinate values.

(5) And controlling the motor according to the final curve.

The invention is further illustrated by the following specific example.

(1) Determining a voltage trend, a voltage peak value and a voltage valley value in the control process, wherein the voltage peak value in the control process comprises two voltage peak values which are both 30; the voltage dip also includes two, one 20 and the other 10.

(2) And establishing a rectangular coordinate system, wherein the x axis of the rectangular coordinate system is time, the unit is second, the y axis is voltage, and the coordinates of each voltage peak value and each voltage valley value are determined according to the voltage trend in the control process to obtain five vertex coordinates. As shown in fig. 2, the coordinates of the five vertices of the curve are (0, 0), (10, 30), (20, 20), (30, 30) and (50, 10), respectively.

(2) And performing one-dimensional linear interpolation in the interval of two adjacent vertexes, filling curve coordinates, wherein the one-dimensional linear interpolation method comprises the following steps:

connection points (0, 0), (10, 30) at [0, 10 ]]Within the interval, the interval is divided into 10000 equal parts by taking 1ms as an interval, and the endpoint value x of each equal part is takeniCorresponding to yi=3xi

Connection points (10, 30), (20, 20) at [10, 20 ]]Within the interval, the interval is divided into 10000 equal parts by taking 1ms as an interval, and the endpoint value x of each equal part is takeniCorresponding to yi=-xi+40。

Connection points (20, 20), (30, 30) at [20, 30 ]]Interval(s)Dividing the interval into 10000 equal parts at intervals of 1ms, and taking the endpoint value x of each equal partiCorresponding to yi=xi

Connection points (30, 30), (50, 10) at [30, 50 ]]Dividing the interval into 20000 equal parts at intervals of 1ms, and taking the endpoint value x of each equal partiCorresponding to yi=-xi+60。

And (4) supplementing the whole section of curve completely according to the method, wherein the time interval between two adjacent points is 1ms after completion.

(3) Cubic spline interpolation is performed at the vertices (10, 30) by the following steps:

setting the transition time as 2s, and calculating the slopes of straight lines at the left end and the right end of the vertexes (10 and 30) as 3 and-1 respectively.

And secondly, calculating the coordinates of end points of the transition region, namely (9, 27) and (11, 29).

③ in the interval [9, 11]Carrying out cubic spline interpolation, calculating a spline function expression, and setting the cubic spline function as S (x ') -a + bx ' + cx '2+dx′3(ii) a The cubic spline interpolation method is as follows:

first, 3 coordinates (9, 27), (10, 29.5) and (11, 29) are specified, and two intervals are shared, so that the spline function is divided into two segments, and the first segment is S1(x'), the second stage is S2(x'), from the spline function characteristics, S can be solved1(x′)=27+3(x′-9)+0.5(x′-9)2-(x′-9)3,S2(x′)=29.5+(x′-10)-2.5(x′-10)2+(x′-10)3

Within the interval [9, 11 ]]Dividing the interval into 2000 equal parts at intervals of 1ms, and taking the endpoint value x 'of each equal part'iX'iSubstituting into spline function S (x') to obtain a new set of coordinate values, and replacing interval [9, 11 ] with new coordinate values]The break point can be eliminated by the original coordinate value.

(4) Cubic spline interpolation is performed at the break points (20, 20) by the following steps:

setting transition time 2s, and calculating the slopes of two straight lines on the left and right of a break point (20, 20), wherein the slopes are-1 and 1 respectively.

And secondly, calculating the coordinates of end points of the transition region, namely (19, 21) and (21, 21).

③ in the interval [19, 21 ]]Carrying out cubic spline interpolation, calculating a spline function expression, and setting the cubic spline function as S (x ') -a + bx ' + cx '2+dx′3(ii) a The cubic spline interpolation method is as follows:

first, 3 coordinates (19, 21), (20, 20.5) and (21, 21) are specified, two intervals are shared, the spline function is divided into two segments, and the first segment is S1(x'), the second stage is S2(x'), from the spline function characteristics, S can be solved1(x′)=21-(x′-19)+0.5(x′-19)2-3.3307E-16(x′-19)3,S2(x′)=20.5+4.5899E-17(x′-20)-2.5(x′-20)2-2.2204E-16(x′-20)3

Within the interval [19, 21]Dividing the interval into 2000 equal parts at intervals of 1ms, and taking the endpoint value x 'of each equal part'iX'iSubstituting into spline function S (x') to obtain a new set of coordinate values, and replacing interval [19, 21 ] with new coordinate values]The break point can be eliminated by the original coordinate value.

(5) Cubic spline interpolation is performed at the break points (30, 30) by the following steps:

setting transition time 2s, and calculating the slopes of two straight lines on the left and right of a break point (30, 30) to be 1-1 respectively.

And secondly, calculating the coordinates of the end points of the transition section, namely (29, 29) and (31, 29).

③ in the interval [29, 31]Carrying out cubic spline interpolation, calculating a spline function expression, and setting the cubic spline function as S (x ') -a + bx ' + cx '2+dx′3(ii) a The cubic spline interpolation method is as follows:

first, 3 coordinates (29, 29), (30, 29.5) and (31, 29) are specified, two intervals are shared, the spline function is divided into two segments, and the first segment is S1(x'), the second stage is S2(x'), from the spline function characteristics, S can be solved1(x′)=29-(x′-29)-0.5(x′-29)2-3.3307E-16(x′-29)3,S2(x′)=29.5-4.5899E-17(x′-30)-0.5(x′-30)2+2.2204E-16(x′-30)3

Within the interval [29, 31]Dividing the interval into 2000 equal parts at intervals of 1ms, and taking the endpoint value x 'of each equal part'iX'iSubstituting into spline function S (x') to obtain a new set of coordinate values, and replacing intervals [29, 31 ] with new coordinate values]The break point can be eliminated by the original coordinate value.

Fig. 3 is a final curve, and it can be seen that the final curve eliminates the break point and has a smaller error than the curve before spline interpolation. The controller can control the motor according to the curve to complete the test.

It is not difficult to find that the invention does not need to appoint the coordinates of the curve point by point, and the time interval between adjacent points of the curve is small, in addition, the broken point of the curve is eliminated by a spline interpolation method, and the influence of the test working condition on the system is effectively reduced.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:伺服驱动控制系统及绝对位置信号处理方法、装置、设备

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!