Constant-speed control method for direct-current permanent magnet brush motor

文档序号:1076379 发布日期:2020-10-16 浏览:11次 中文

阅读说明:本技术 一种直流永磁有刷电机恒速控制方法 (Constant-speed control method for direct-current permanent magnet brush motor ) 是由 杨京华 钱俊华 涂有波 于 2020-07-21 设计创作,主要内容包括:本发明涉及一种直流永磁有刷电机恒速控制方法,包括单片机和电机,所述电机的正极连接有开关管、驱动模块和电压采样模块,所述开关管连接所述驱动模块,所述驱动模块和所述电压采样模块均与所述单片机连接,所述单片机连接面板电位器,所述单片机内部设置有PWM模块和A/D模块;该方法使用所述单片机产生PWM并利用PWM死区时间对所述电机的电压进行采样,经所述A/D模块转换后与所述面板电位器的给定值进行比较,经所述单片机内部程序计算后,控制所述电机恒速运转。利用PWM的死区时间对电机电压进行采样,避免传统反馈信号中有驱动电压的成分;可以在很宽的速度范围内实现电机恒速运转,低速状态下的效果尤其出色。(The invention relates to a constant speed control method of a direct current permanent magnet brush motor, which comprises a single chip microcomputer and a motor, wherein the positive electrode of the motor is connected with a switch tube, a driving module and a voltage sampling module, the switch tube is connected with the driving module, the driving module and the voltage sampling module are both connected with the single chip microcomputer, the single chip microcomputer is connected with a panel potentiometer, and a PWM (pulse width modulation) module and an A/D (analog/digital) module are arranged in the single chip microcomputer; the method uses the single chip microcomputer to generate PWM, utilizes PWM dead time to sample the voltage of the motor, compares the voltage with a given value of the panel potentiometer after being converted by the A/D module, and controls the motor to run at a constant speed after being calculated by an internal program of the single chip microcomputer. The dead time of PWM is utilized to sample the motor voltage, so that the component of driving voltage in the traditional feedback signal is avoided; the motor can be operated at a constant speed in a wide speed range, and the effect in a low-speed state is particularly excellent.)

1. A constant speed control method of a direct current permanent magnet brush motor is characterized by comprising the following steps: the single-chip microcomputer U1 and the motor are included, the positive electrode of the motor is connected with a switch tube, a driving module and a voltage sampling module, the switch tube is connected with the driving module, the driving module and the voltage sampling module are both connected with the single-chip microcomputer U1, the single-chip microcomputer U1 is connected with a panel potentiometer RP1, and a PWM module and an A/D module are arranged inside the single-chip microcomputer U1;

the method uses the single chip microcomputer U1 to generate PWM, utilizes PWM dead time to sample the voltage of the motor, compares the voltage with a given value of the panel potentiometer RP1 after the voltage is converted by the A/D module, and controls the motor to run at a constant speed after the voltage is calculated by an internal program of the single chip microcomputer U1.

2. The constant speed control method of the direct current permanent magnet brush motor according to claim 1, characterized in that: the period of the PWM module is equal to the conversion period of the A/D module, and the PWM dead time of the PWM module is larger than the conversion period of the A/D module.

3. The constant speed control method of the direct current permanent magnet brush motor according to claim 1, characterized in that: the negative pole of the motor is connected with a milliohm-level sampling resistor R5, and the sampling resistor R5 is grounded.

Technical Field

The invention relates to the field of driving and controlling of motors, in particular to a constant-speed control method of a direct-current permanent magnet brush motor.

Background

The DC permanent-magnet brush motor is a widely used motor, and has the advantages of simple structure, small volume, high efficiency, convenient use and low price. As is well known, a dc permanent magnet brush motor is equivalent to a generator when it runs by inertia, and the voltage generated by the generator has a certain proportional relationship with the rotational speed of the motor when the structural constant K is constant. When the requirement on constant rotating speed exists, motor voltage feedback is generally introduced into a control circuit, but a sampling point of a voltage signal is in conjunction with the driving voltage of the motor, and the simple introduction of the voltage signal as rotating speed feedback is unreasonable, so that the effect of the constant speed control method of the motor is not ideal.

Disclosure of Invention

The technical problem to be solved by the invention is as follows: in order to solve the above problems, the present invention provides a constant speed control method for a dc permanent magnet brush motor, which samples the motor voltage by using the dead time of PWM, and can realize constant speed operation in a wide speed range, and the effect is particularly excellent in a low speed state.

In order to achieve the purpose, the invention provides the following technical scheme: the invention provides a constant speed control method of a direct current permanent magnet brush motor, which comprises a single chip microcomputer U1 and a motor, wherein the positive electrode of the motor is connected with a switch tube, a driving module and a voltage sampling module, the switch tube is connected with the driving module, the driving module and the voltage sampling module are both connected with the single chip microcomputer U1, the single chip microcomputer U1 is connected with a panel potentiometer RP1, and a PWM module and an A/D module are arranged inside the single chip microcomputer U1; the method uses the single chip microcomputer U1 to generate PWM, utilizes PWM dead time to sample the voltage of the motor, compares the voltage with a given value of the panel potentiometer RP1 after the voltage is converted by the A/D module, and controls the motor to run at a constant speed after the voltage is calculated by an internal program of the single chip microcomputer U1.

The working principle is as follows: the direct-current permanent magnet brush motor is controlled in a PWM mode, in order to sample a voltage signal of the motor, the switch tube is connected to the positive pole of the motor, and meanwhile, the voltage signal is sampled at the positive pole of the motor. The singlechip U1 reads a feedback voltage signal only when the singlechip U1 generates an interrupt signal to the switch tube to interrupt the switch tube when detecting that the PWM duty ratio is finished. The feedback signal reflects the rotation speed of the motor, and the signal is compared with the given signal to control the PWM duty ratio, so that the motor can be well controlled to operate at constant speed.

Furthermore, the period of the PWM module is equal to the conversion period of the A/D module, so that the accuracy of a sampling time point is ensured; the PWM dead time of the PWM module is larger than the conversion period of the A/D module, and the accuracy of sampling data is guaranteed.

Further, the negative electrode of the motor is connected with a milliohm-level sampling resistor R5, and the sampling resistor R5 is grounded; the sampling resistor R5 can be used not only to sample the current of the motor, but also to limit the maximum current of the motor.

The invention has the beneficial effects that: according to the constant-speed control method for the direct-current permanent magnet brush motor, provided by the invention, the motor voltage is sampled by using the dead time of PWM (pulse width modulation), so that the condition that the traditional feedback signal contains the component of the driving voltage is avoided; the control method can realize the constant-speed operation of the motor in a wide speed range, and the effect is particularly excellent in a low-speed state; at present, the control method is widely applied to the control of the wire feeding motor for argon arc welding, and a good effect is achieved.

Drawings

The invention is further illustrated with reference to the following figures and examples.

Fig. 1 is a circuit schematic of the present invention.

Fig. 2 is a graph of the relationship between the sampling point and PWM according to the present invention.

Detailed Description

The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic views illustrating only the basic structure of the present invention in a schematic manner, and thus show only the constitution related to the present invention.

As shown in fig. 1, the constant speed control method for the direct current permanent magnet brush motor provided by the invention comprises a single chip microcomputer U1 and a motor, wherein the single chip microcomputer U1 is an 8-position middle-grade single chip microcomputer, 51 series are not selected, and the model is not STC89C52 RC; the positive electrode of the motor is connected with a switch tube, a driving module and a voltage sampling module, the switch tube is connected with the driving module, the driving module and the voltage sampling module are both connected with the single chip microcomputer U1, the voltage sampling module is R2 and R3 for dividing the voltage of the motor, and the voltage is filtered by C4 and then enters the single chip microcomputer U1; the single chip microcomputer U1 is connected with a panel potentiometer RP1, and a PWM module and an A/D module are arranged inside the single chip microcomputer U1; the method uses the single chip microcomputer U1 to generate PWM, utilizes PWM dead time to sample the voltage of the motor, compares the voltage with a given value of the panel potentiometer RP1 after the voltage is converted by the A/D module, and controls the motor to run at a constant speed after the voltage is calculated by an internal program of the single chip microcomputer U1.

The operation of the single chip microcomputer U1 is divided into a main function part and an interruption function part, wherein the main function comprises the following working steps:

s1, initializing, wherein in the step, except for the common GPIO setting, the most important is PWM setting, A/D setting and interruption setting, when in PWM setting, the frequency is not too high, only 1K to 2K is needed, and the maximum duty ratio is not more than 90% to reserve enough dead time to execute a feedback sampling program; the switching speed is fast enough to perform the entire switching process within 10% of the PWM period for the a/D setting. The interrupt sets two interrupt sources: a timer overflow interrupt and a PWM duty cycle end interrupt. The timer overflow interruption period is the same as the PWM period, and after initialization is completed, the two period timers are simultaneously cleared to realize synchronization of feedback sampling.

And S2, detecting and updating external signals, wherein in the step, the single chip microcomputer continuously reads a given voltage value from the panel potentiometer RP1 and stores the given voltage value for later use. If other external signals are also detected according to different working conditions, for example: start/stop signals, overheat protection signals, power supply abnormality signals, etc., may also be done in this step.

S3, comparing and calculating data, wherein in the step, the singlechip analyzes and calculates the collected current and voltage signals, and the specific method comprises the following steps: when the current is less than 5A (the data is for the wire feeding motor of argon arc welding, if the data is used in other occasions, the current signal is ignored according to different working conditions). If the current is greater than 5A, the PWM duty cycle is reduced, either by a conventional PID algorithm or by a simple incremental decrease per cycle, for example: one decrement is 5% or 10% of the full pulse width.

Comparing and calculating the voltage only when the current is less than 5A, comparing the collected feedback voltage with the given voltage, and if the given voltage is greater than the feedback voltage, increasing the PWM duty ratio; otherwise, the duty cycle is decreased. The increasing or decreasing mode is better by an equal difference decreasing method, and the algorithm can better keep the stable operation of the motor than the PID.

And S4, executing a calculation result, wherein in the step, the singlechip updates old data by using the new PWM duty ratio data calculated in the step 3, then loads the old data into a PWM duty ratio register, and executes a new duty ratio in the next period.

The operation of the singlechip in the interrupt function is to sample the feedback signal of the voltage and current, and the relation between the sampling point and the PWM is shown in fig. 2. An interrupt source overflowed by the timer points to a current sampling function; and the interrupt source at the end of the PWM duty cycle points to the voltage sampling function. Therefore, the current sampling can be ensured to obtain the peak value of the current, and the voltage sampling can obtain a pure motor rotating speed signal. The two sampling functions are basically the same, a delay program is arranged at the beginning, and the delay can ensure that the current has enough rising time for current sampling; for voltage sampling, the delay can avoid the follow current of the motor, so that the sampling is more accurate. The body of the sampling function is an a/D conversion function, which is a standard function.

As shown in fig. 2, the period of the PWM module is equal to the conversion period of the a/D module, which ensures the accuracy of the sampling time point; the PWM dead time of the PWM module is larger than the conversion period of the A/D module, and the accuracy of sampling data is guaranteed.

As shown in fig. 1, the negative pole of the motor is connected with a milliohm-level sampling resistor R5, and the sampling resistor R5 is grounded; the sampling resistor R5 can be used not only to sample the current of the motor, but also to limit the maximum current of the motor.

According to the constant-speed control method for the direct-current permanent magnet brush motor, provided by the invention, the motor voltage is sampled by using the dead time of PWM (pulse width modulation), so that the condition that the traditional feedback signal contains the component of the driving voltage is avoided; the control method can realize the constant-speed operation of the motor in a wide speed range, and the effect is particularly excellent in a low-speed state; at present, the control method is widely applied to the control of the wire feeding motor for argon arc welding, and a good effect is achieved.

In light of the foregoing description of the preferred embodiment of the present invention, many modifications and variations will be apparent to those skilled in the art without departing from the spirit and scope of the invention. The technical scope of the present invention is not limited to the content of the specification, and must be determined according to the scope of the claims.

6页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种四相五线步进电机驱动IC

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!