Driving algorithm for servo motor of automobile air conditioner controller

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

阅读说明:本技术 一种用于汽车空调控制器伺服电机的驱动算法 (Driving algorithm for servo motor of automobile air conditioner controller ) 是由 夏斌 陈丹 李希平 孙靖峰 蒋永强 李桃英 于 2021-09-08 设计创作,主要内容包括:本发明公开了一种用于汽车空调控制器伺服电机的驱动算法,克服了现有技术伺服电机的驱动电压无法慢速调节导致的精度低的问题,目标电压可根据需求进行更改,在电源电压波动的情况下能够维持鼓风机风量稳定输出,PID软件对MCU进行驱动,通过PID软件闭环数据计算出PWM占空比,在伺服电机在不同电压的情况下,都能达到很高的控制精度。(The invention discloses a driving algorithm for a servo motor of an automobile air conditioner controller, which solves the problem of low precision caused by the fact that the driving voltage of the servo motor in the prior art can not be adjusted slowly, the target voltage can be changed according to requirements, the stable output of the air volume of a blower can be maintained under the condition of power supply voltage fluctuation, PID software drives an MCU, the PWM duty ratio is calculated through PID software closed-loop data, and the servo motor can achieve high control precision under the condition of different voltages.)

1. A driving algorithm for a servo motor of an automobile air conditioner controller is characterized by comprising the following steps:

s1, driving the motor by the MCU module and collecting the feedback voltage of the motor;

s2, judging a motor driving mode through a motor set value and a motor feedback value of motor feedback voltage acquired by the MCU;

s3, calculating a PWM value by a motor drive incremental PI control algorithm;

and S4, the PID software drives the MCU module to simulate and send the duty ratio corresponding to the PWM value to drive the motor.

2. The driving algorithm for the servo motor of the air conditioner controller of the automobile as claimed in claim 1, wherein the MCU module employs an ATA6836 chip, 2 Out pins of the ATA6836 chip drive the motor, and an AD terminal of the ATA6836 chip collects the motor feedback voltage.

3. The driving algorithm for the servo motor of the air conditioner controller of the vehicle as set forth in claim 1,

the S2 includes the following:

s21, judging whether the motor drive is in a PID drive mode or a shutdown mode through the motor feedback voltage value and the motor set value; if the motor is in the PID driving mode, performing S22;

s22, setting the current deviation as e, wherein e is mGet-mSet, the current setting value is mSet, and the current obtained feedback voltage is mGet;

s23, judging whether e is smaller than the precision value, if so, stopping the motor, otherwise, carrying out S24;

s24, judging whether the motor rotates forwards or backwards currently;

and S25, calculating a PID algorithm and driving the motor.

4. The driving algorithm for the servo motor of the air conditioner controller of the car as set forth in claim 3, wherein said S25 includes the following contents:

the PID driving mode employs an incremental PI control algorithm, specifically,

ΔSPID(k)=SPID(k)-SPID(k-1)=Kp·(ek-ek-1)+Ki·ek

wherein Δ spid (k) is a PID variation value;

spid (k) is the current PID value;

spid (k-1) is the last PID value;

e (k) is the difference calculated this time;

e (k-1) is the difference calculated last time;

kp is a proportionality coefficient; ki is an integral system, and the heating value is negative;

current set value mSet, current obtained feedback voltage meget, current deviation: e-mGet-mSet;

t is a sampling period and takes 5S;

current PWM Duty is Duty + Δ spid;

the PWM Duty is a PWM value which should be output currently;

duty is the PWM value output this time;

Δ Spid is the calculated PID value.

5. The driving algorithm for the servo motor of the air conditioner controller of the car as set forth in claim 1, wherein said S4 includes the following contents: the ATA6836 chip is driven by software at fixed time, simulates to send PWM value corresponding Duty ratio to drive the motor, firstly judges whether the driving frequency is larger than 100, otherwise calculates PWM Duty, judges whether the PWM Duty is larger than the driving frequency, if so, outputs drive ATA6836, otherwise stops outputting drive ATA 6848.

6. The driving algorithm for the servo motor of the air conditioner controller of the automobile as claimed in claim 1 or 2, wherein the MCU module is connected with a wind speed control module for controlling a blower.

Technical Field

The invention relates to the technical field of automobile air conditioners, in particular to a driving algorithm for a servo motor of an automobile air conditioner controller.

Background

The automobile air conditioner is a branch of the air conditioning field, and controls the temperature, the humidity, the cleanliness and the wind speed of the air in a vehicle room in a certain mode, and enables the air to flow and be distributed in the vehicle room at a certain speed, so as to provide a real-time environmental air treatment process for drivers and passengers, namely the automobile air conditioner has multiple functions of refrigeration, heating, ventilation, air purification, humidification, dehumidification and the like. The air door of the automobile air conditioning system is adjusted by a servo motor, so that the adjustment of modes, internal and external circulation and cooling and heating is realized. Along with the improvement of the requirement of the automobile industry on comfort, the requirement on the control precision of the servo motor is higher and higher, the requirement is generally 0.1V, even 0.05V, the driving voltage of the servo motor is generally fixed voltage, slow speed adjustment cannot be realized, and therefore the precision cannot be improved.

Disclosure of Invention

The invention provides a driving algorithm for a servo motor of an automobile air conditioner controller, aiming at overcoming the problem of low precision caused by the fact that the driving voltage of the servo motor in the prior art can not be adjusted slowly, and the high-precision control can be realized when the servo motor is not under the voltage.

In order to achieve the purpose, the invention adopts the following technical scheme:

a driving algorithm for a servo motor of an automotive air conditioning controller comprises the following steps:

s1, driving the motor by the MCU module and collecting the feedback voltage of the motor;

s2, judging a motor driving mode through a motor set value and a motor feedback value of motor feedback voltage acquired by the MCU;

s3, calculating a PWM value by a motor drive incremental PI control algorithm;

and S4, the PID software drives the MCU module to simulate and send the duty ratio corresponding to the PWM value to drive the motor.

The motor adopts a carbon film feedback servo motor, and the motor can realize the positioning of the motor position through the feedback voltage of the carbon film.

The driving voltage of the servo motor is generally fixed voltage, and slow speed adjustment cannot be realized, so that the precision cannot be improved;

the invention describes a method for controlling a servo motor by utilizing PWM modulation by an automobile air conditioner controller, and the duty ratio of PWM is calculated by adopting PID software closed-loop data. Under the condition that the servo motors are at different voltages, high control precision can be achieved.

Preferably, the MCU module adopts an ATA6836 chip, 2 Out pins of the ATA6836 chip drive a motor, and an AD end of the ATA6836 chip collects motor feedback voltage.

Preferably, the S2 includes the following contents:

s21, judging whether the motor drive is in a PID drive mode or a shutdown mode through the motor feedback voltage value and the motor set value; if the motor is in the PID driving mode, performing S22;

s22, setting the current deviation as e, wherein e is mGet-mSet, the current setting value is mSet, and the current obtained feedback voltage is mGet;

s23, judging whether e is smaller than the precision value, if so, stopping the motor, otherwise, carrying out S24;

s24, judging whether the motor rotates forwards or backwards currently;

and S25, calculating a PID algorithm and driving the motor.

Preferably, the S25 includes the following contents:

the PID driving mode employs an incremental PI control algorithm, specifically,

ΔSPID(k)=SPID(k)-SPID(k-1)=Kp·(ek-ek-1)+Ki·ek

wherein Δ spid (k) is a PID variation value;

spid (k) is the current PID value;

spid (k-1) is the last PID value;

e (k) is the difference calculated this time;

e (k-1) is the difference calculated last time;

kp is a proportionality coefficient; ki is an integral system, and the heating value is negative;

current set value mSet, current obtained feedback voltage meget, current deviation: e-mGet-mSet;

t is a sampling period and takes 5S;

current PWM Duty is Duty + Δ spid;

the PWM Duty is a PWM value which should be output currently;

duty is the PWM value output this time;

Δ Spid is the calculated PID value.

Preferably, the S4 includes the following contents: the ATA6836 chip is driven by software at fixed time, simulates to send PWM value corresponding Duty ratio to drive the motor, firstly judges whether the driving frequency is larger than 100, otherwise calculates PWM Duty, judges whether the PWM Duty is larger than the driving frequency, if so, outputs drive ATA6836, otherwise stops outputting drive ATA 6848.

Preferably, the MCU module is connected with a wind speed control module for controlling the blower.

Therefore, the invention has the following beneficial effects:

the invention can achieve very high precision only when the servo motor is at different voltages, the PID software is adopted to drive the MCU, the PWM duty ratio is calculated through the closed-loop data of the PID software, the slow speed regulation is realized under the condition that the servo motor is at different voltages, and the high precision which can not be achieved by the traditional servo motor can be achieved.

Drawings

Fig. 1 is a flowchart of the present embodiment.

Fig. 2 is a schematic diagram of the MCU in this embodiment.

Fig. 3 is a blower control model.

Fig. 4 is a flowchart of motor drive mode determination.

Fig. 5 is a software driver chip flow diagram.

Detailed Description

The invention is further described with reference to the following detailed description and accompanying drawings.

Example 1:

the embodiment provides a driving algorithm for a servo motor of an automobile air conditioner controller, as shown in fig. 1, comprising the following steps:

s1, driving the motor by the MCU module and collecting the feedback voltage of the motor;

s2, judging a motor driving mode through a motor set value and a motor feedback value of motor feedback voltage acquired by the MCU;

s3, calculating a PWM value by a motor drive incremental PI control algorithm;

and S4, the PID software drives the MCU module to simulate and send the duty ratio corresponding to the PWM value to drive the motor.

Example 2:

the embodiment provides a driving algorithm for a servo motor of an automobile air conditioner controller, which comprises the following steps:

s1, driving the motor by the MCU module and collecting the feedback voltage of the motor;

the MCU module adopts an ATA6836 chip, 2 Out pins of the ATA6836 chip drive a motor, and an AD end of the ATA6836 chip collects motor feedback voltage.

S2, judging a motor driving mode through a motor set value and a motor feedback value of motor feedback voltage acquired by the MCU;

the S2 includes, as shown in fig. 4,

s21, judging whether the motor drive is in a PID drive mode or a shutdown mode through the motor feedback voltage value and the motor set value; if the motor is in the PID driving mode, performing S22;

s22, setting the current deviation as e, wherein e is mGet-mSet, the current setting value is mSet, and the current obtained feedback voltage is mGet;

s23, judging whether e is smaller than the precision value, if so, stopping the motor, otherwise, carrying out S24;

s24, judging whether the motor rotates forwards or backwards currently;

and S25, calculating a PID algorithm and driving the motor.

The S25 includes the following:

the PID driving mode employs an incremental PI control algorithm, specifically,

ΔSPID(k)=SPID(k)-SPID(k-1)=Kp·(ek-ek-1)+Ki·ek

wherein Δ spid (k) is a PID variation value;

spid (k) is the current PID value;

spid (k-1) is the last PID value;

e (k) is the difference calculated this time;

e (k-1) is the difference calculated last time;

kp is a proportionality coefficient; ki is an integral system, and the heating value is negative;

current set value mSet, current obtained feedback voltage meget, current deviation: e-mGet-mSet;

t is a sampling period and takes 5S;

current PWM Duty is Duty + Δ spid;

the PWM Duty is a PWM value which should be output currently;

duty is the PWM value output this time;

Δ Spid is the calculated PID value.

S3, calculating a PWM value by a motor drive incremental PI control algorithm;

and S4, the PID software drives the MCU module to simulate and send the duty ratio corresponding to the PWM value to drive the motor.

As shown in fig. 5, the S4 includes the following contents: the ATA6836 chip is driven by software at fixed time, simulates to send PWM value corresponding Duty ratio to drive the motor, firstly judges whether the driving frequency is larger than 100, otherwise calculates PWM Duty, judges whether the PWM Duty is larger than the driving frequency, if so, outputs drive ATA6836, otherwise stops outputting drive ATA 6848.

The MCU model is ATA6836C, as shown in FIG. 2.

In the present embodiment, a PID algorithm is adopted, and in process control, a PID controller (also called PID regulator) that controls according to the proportion (P), the integral (I) and the derivative (D) of the deviation is the most widely used automatic controller. The method has the advantages of simple principle, easy realization, wide application range, mutually independent control parameters, simpler parameter selection and the like; it can also be shown in theory that a PID controller is an optimal control for the typical objects of process control-the "first order lag + pure lag" and the "second order lag + pure lag" objects of control. The PID regulation rule is an effective method for correcting the dynamic quality of the continuous system, and the parameter setting mode is simple and convenient, and the structure is flexible to change.

And adopts PWM control to simulate low voltage control: and low-voltage regulation is simulated through PWM (pulse-width modulation) so as to realize slow speed regulation of the motor.

As shown in fig. 3, the MCU is connected to the wind speed control module, the wind speed control module is used to transmit the wind speed feedback signal and the speed regulation feedback signal of the blower, the voltage is controlled by PWM, the PID software drives the MCU, the PWM duty ratio is calculated by the PID software closed loop data, and the servo motor can achieve very high control accuracy under different voltages.

ATA6836 is driven by PID0 software at regular time, and simulates the PWM value to drive the motor according to the Duty ratio, and firstly judges whether the driving frequency is more than 100, otherwise calculates the PWM Duty, judges whether the PWM Duty is more than the driving frequency, if so, outputs driving ATA6836, otherwise stops outputting ATA 6848.

The software algorithm is managed by software configuration, the target voltage can be changed according to requirements, namely under the condition that the driving voltage fluctuates, the servo motor is controlled by PWM modulation, the duty ratio of PWM is calculated by PID software closed-loop data, the PWM duty ratio is adjusted according to the set voltage rising rate of the air blower, dynamic adjustment is carried out until the target voltage is reached, and the air volume stability and the high control precision of the air blower are maintained.

The above embodiments are described in detail for the purpose of further illustrating the present invention and should not be construed as limiting the scope of the present invention, and the skilled engineer can make insubstantial modifications and variations of the present invention based on the above disclosure.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于新型趋近律的滑模变结构控制方法

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!