Encoder with current detection function and current detection method

文档序号:1356670 发布日期:2020-07-24 浏览:30次 中文

阅读说明:本技术 一种具有电流检测功能的编码器及电流检测方法 (Encoder with current detection function and current detection method ) 是由 杜佳星 于 2020-03-25 设计创作,主要内容包括:本发明公开了一种具有电流检测功能的编码器及电流检测方法,由伺服驱动器请求获取伺服电机转子位置且发送位置数据请求指令到通信部,由通信部与其进行信息交互,对位置数据请求指令进行接收,并将其反馈到控制部;控制部对位置数据请求指令进行解析,根据解析得到的采样时间Ta和采样周期Ts,控制电流采样部和位置采样部采样的采样时间处于同一时刻;在控制部在进行采样时间同步处理后,结合从位置采样部获取到的实际转子位置pos_act以及电机位置控制参数进行计算,得到转子观测位置pos_fed;由伺服驱动器根据电机的电流和位置反馈,控制电机的扭矩、转速和转动角度。(The invention discloses an encoder with a current detection function and a current detection method.A servo driver requests to acquire the position of a rotor of a servo motor and sends a position data request instruction to a communication part, the communication part performs information interaction with the communication part, receives the position data request instruction and feeds the position data request instruction back to a control part; the control part analyzes the position data request command, and controls the sampling time of the current sampling part and the sampling time of the position sampling part to be at the same time according to the sampling time Ta and the sampling period Ts obtained by analysis; after the control part carries out sampling time synchronization processing, calculating by combining the actual rotor position pos _ act obtained from the position sampling part and the motor position control parameter to obtain a rotor observation position pos _ fed; the torque, the rotating speed and the rotating angle of the motor are controlled by the servo driver according to the current and position feedback of the motor.)

1. An encoder having a current detection function, characterized by comprising a current sampling section, a position sampling section, a communication section, and a control section, wherein:

the current sampling part and the position sampling part are respectively connected to a control part and a servo motor, the control part is connected to a communication part, and the communication part is connected to a servo driver;

the current sampling part is used for sampling UVW phase current of the servo motor to obtain three-phase currents Iu, Iv and Iw, and the three-phase currents Iu, Iv and Iw are fed back to the control part;

the position sampling part is used for sampling the actual position of the servo motor rotor to obtain an actual rotor position pos _ act, and the actual rotor position pos _ act is fed back to the control part;

the communication part is used for carrying out information interaction with the servo driver and receiving a position data request command when the servo driver requests to acquire the position of the rotor of the servo motor and sends the position data request command to the communication part; the position data request command comprises sampling time Ta, a sampling period Ts and a motor position control parameter; the position data request command is fed back to the control part;

the control part is used for analyzing the position data request command, simultaneously triggering the current sampling part and the position sampling part to perform current sampling and position sampling according to the sampling time Ta and the sampling period Ts obtained by analysis, and controlling the sampling time of the current signal and the sampling time of the rotor position signal obtained by the current sampling part and the sampling time of the position sampling part to be at the same moment; on the other hand, after sampling time synchronization processing is carried out, the actual rotor position pos _ act and the motor position control parameter acquired from the position sampling part are combined to carry out calculation, and a rotor observation position pos _ fed is obtained; the rotor observation position pos _ fed and the current signal after sampling time synchronization are fed back to the servo driver through the communication part, and the servo driver controls the torque, the rotating speed and the rotating angle of the motor according to the current and position feedback of the motor.

2. The encoder with current detection function according to claim 1, wherein the motor position control parameter includes a Q-axis current given value Iref or a motor torque given value Tref.

3. The encoder with current detection function according to claim 2, wherein the calculation formula for calculating the rotor observation position pos _ fed by the control unit is:

pos_fed(k)=pos_act(k)+(pos_act(k)-pos_act(k-1))×Iqref(k)÷(pos_act(k-1)-pos_act(k-2))÷Iqref(k-1);

or

pos_fed(k)=pos_act(k)+(pos_act(k)-pos_act(k-1))×Tqref(k)÷(pos_act(k-1)-pos_act(k-2))÷Tqref(k-1);

Where k is the sampling instant.

4. The encoder with current detection function according to claim 1, wherein the position data request command further includes relative time of PWM peak and valley; the control part sets sampling delay time according to the relative time of the peak and the trough of the PWM, sampling time Ta and a sampling period Ts, wherein:

when the control part receives a position data request command at the time t1+ Td, the sampling delay time Tw is set according to the relative time of the PWM trough as follows:

Tw=Ts-Ta-Td;

after time delay processing is carried out, sampling of the current signal and the position signal is carried out in sequence, and a sampling point is adjusted at the bottom of the PWM chopping signal;

or according to the relative time of the PWM wave crest, the set sampling delay time Tw is as follows:

Tw=Ts/2-Ta-Td;

adjusting a sampling point at the top of the PWM chopping signal at present;

before sampling the current signal and the position signal, setting delay time to avoid PWM chopping and ensure the integrity of the sampled signal.

5. A method of current sensing using the encoder according to any of claims 1-4, comprising the steps of:

s1, a servo driver requests to acquire the rotor position of a servo motor and sends a position data request command to a communication part, the communication part and the servo driver carry out information interaction, and the position data request command is received; the position data request command is fed back to the control part by the communication part;

s2, the control part analyzes the position data request command, and according to the sampling time Ta and the sampling period Ts obtained by analysis, the control part simultaneously triggers the current sampling part and the position sampling part to carry out current sampling and position sampling, and controls the sampling time of the current sampling part and the sampling time of the position sampling part to obtain a current signal and the sampling time of a rotor position signal to be at the same moment;

s3, the current sampling part samples UVW phase current of the servo motor to obtain three-phase currents Iu, Iv and Iw, and the three-phase currents Iu, Iv and Iw are fed back to the control part; the position sampling part is used for sampling the actual position of the servo motor rotor to obtain an actual rotor position pos _ act, and the actual rotor position pos _ act is fed back to the control part;

s4, after the control part carries out sampling time synchronization processing, calculating by combining the actual rotor position pos _ act and the motor position control parameter acquired from the position sampling part to obtain a rotor observation position pos _ fed;

and S5, the control part feeds back the rotor observation position pos _ fed and the current signal subjected to sampling time synchronization to the servo driver through the communication part, and the servo driver controls the torque, the rotating speed and the rotating angle of the motor according to the current and the position feedback of the motor.

6. The method for current detection according to claim 5, wherein the motor position control parameter in step S4 comprises a given value of Q-axis current Iref or a given value of motor torque Tref.

7. The method for detecting current according to claim 6, wherein the formula for calculating the observed rotor position pos _ fed by the control unit in step S4 is as follows:

pos_fed(k)=pos_act(k)+(pos_act(k)-pos_act(k-1))×Iqref(k)÷(pos_act(k-1)-pos_act(k-2))÷Iqref(k-1);

or

pos_fed(k)=pos_act(k)+(pos_act(k)-pos_act(k-1))×Tqref(k)÷(pos_act(k-1)-pos_act(k-2))÷Tqref(k-1);

Where k is the sampling instant.

8. The method according to claim 5, wherein the position data request command in step S2 further includes relative time of PWM peak and valley; the control part sets sampling delay time according to the relative time of the peak and the trough of the PWM, sampling time Ta and a sampling period Ts, wherein:

when the control part receives a position data request command at the time t1+ Td, the sampling delay time Tw is set according to the relative time of the PWM trough as follows:

Tw=Ts-Ta-Td;

after time delay processing is carried out, sampling of the current signal and the position signal is carried out in sequence, and a sampling point is adjusted at the bottom of the PWM chopping signal;

or according to the relative time of the PWM wave crest, the set sampling delay time Tw is as follows:

Tw=Ts/2-Ta-Td;

adjusting a sampling point at the top of the PWM chopping signal at present;

before sampling the current signal and the position signal, setting delay time to avoid PWM chopping and ensure the integrity of the sampled signal.

Technical Field

The invention belongs to a servo driving system, and particularly relates to an encoder with a current detection function and a method for detecting current by using the encoder.

Background

The servo motor and the driver are important components of modern motion control, and are widely applied to automation equipment such as industrial robots, numerical control machining centers and the like.

The current alternating current servo driver is generally designed by adopting a closed-loop control algorithm of current, speed and position based on vector control to improve the performance of the servo driver; the current is obtained by sampling by a current sampling element in the servo driver; the speed and position are sampled by encoders mounted on the servo motor side.

However, with the improvement of the resolution of the encoder, the resolution of the current mainstream encoder has been improved to 17bit or more, and the current method of sending pulse signals through TT L level has not been able to meet the related requirements, and in order to solve the above drawbacks, the method mostly adopts the form of communicating and transmitting data to the servo driver at present, however, the closed loop control algorithm adopted by the servo driver is strictly isochronous synchronous, if the existing encoder communication method is adopted, not only is the communication period data delayed, but also the sampling time of the encoder cannot be known by the servo driver, so that the current sampling and the position sampling of the encoder cannot be truly synchronized, and thus the sampling time error can cause the loss of phase margin and performance degradation.

Disclosure of Invention

The invention aims to solve the technical problem that the current detection function of the encoder cannot accurately detect the actual current of a motor in the prior art, and provides the encoder with the current detection function and a method for detecting the current by using the encoder.

The technical scheme adopted by the invention for solving the technical problems is as follows: an encoder having a current detection function is configured to include a current sampling portion, a position sampling portion, a communication portion, and a control portion, wherein:

the current sampling part and the position sampling part are respectively connected to a control part and a servo motor, the control part is connected to a communication part, and the communication part is linked to a servo driver;

the current sampling part is used for sampling UVW phase current of the servo motor to obtain three-phase currents Iu, Iv and Iw, and the three-phase currents Iu, Iv and Iw are fed back to the control part;

the position sampling part is used for sampling the actual position of the servo motor rotor to obtain an actual rotor position pos _ act, and the actual rotor position pos _ act is fed back to the control part;

the communication part is used for carrying out information interaction with the servo driver and receiving a position data request command when the servo driver requests to acquire the position of the rotor of the servo motor and sends the position data request command to the communication part; the position data request command comprises sampling time Ta, a sampling period Ts and a motor position control parameter; the position data request command is fed back to the control part;

the control part is used for analyzing the position data request command, simultaneously triggering the current sampling part and the position sampling part to perform current sampling and position sampling according to the sampling time Ta and the sampling period Ts obtained by analysis, and controlling the sampling time of the current signal and the sampling time of the rotor position signal obtained by the current sampling part and the sampling time of the position sampling part to be at the same moment; on the other hand, after sampling time synchronization processing is carried out, the actual rotor position pos _ act and the motor position control parameter acquired from the position sampling part are combined to carry out calculation, and a rotor observation position pos _ fed is obtained; the rotor observation position pos _ fed and the current signal after sampling time synchronization are fed back to the servo driver through the communication part, and the servo driver controls the torque, the rotating speed and the rotating angle of the motor according to the current and position feedback of the motor.

Because the servo motor control system needs to use the current feedback of the motor to participate in calculation, however, the traditional method is to sample in a servo driver. In this way, leakage currents caused by parasitic capacitances on the power transmission lines, as well as some interference currents, are detected, which can cause system noise. If the sampling is directly carried out on the motor side, the current obtained in the way is the real motor winding current; meanwhile, the current sampling and the encoder position sampling are controlled according to the communication time, so that the time delay is avoided, the data detection precision is prevented from deviating, data is issued through a driver, the relative time of a sampling point and the PWM wave crest and trough is obtained, the encoder position and the current sampling point are controlled, and the PWM chopping is avoided.

The invention provides a method for detecting current by using the encoder, which comprises the following steps:

s1, a servo driver requests to acquire the rotor position of a servo motor and sends a position data request command to a communication part, the communication part and the servo driver carry out information interaction, and the position data request command is received; the position data request command is fed back to the control part by the communication part;

s2, the control part analyzes the position data request command, and according to the sampling time Ta and the sampling period Ts obtained by analysis, the control part simultaneously triggers the current sampling part and the position sampling part to carry out current sampling and position sampling, and controls the sampling time of the current sampling part and the sampling time of the position sampling part to obtain a current signal and the sampling time of a rotor position signal to be at the same moment;

s3, the current sampling part samples UVW phase current of the servo motor to obtain three-phase currents Iu, Iv and Iw, and the three-phase currents Iu, Iv and Iw are fed back to the control part; the position sampling part is used for sampling the actual position of the servo motor rotor to obtain an actual rotor position pos _ act, and the actual rotor position pos _ act is fed back to the control part;

s4, after the control part carries out sampling time synchronization processing, calculating by combining the actual rotor position pos _ act and the motor position control parameter acquired from the position sampling part to obtain a rotor observation position pos _ fed;

and S4, the control part feeds back the rotor observation position pos _ fed and the current signal subjected to sampling time synchronization to the servo driver through the communication part, and the servo driver controls the torque, the rotating speed and the rotating angle of the motor according to the current and the position feedback of the motor.

The encoder with the current detection function and the current detection method have the following beneficial effects that:

1. a current sampling part is designed in the encoder to sample the phase current of the servo motor, so that the interference current is prevented from being detected;

2. before sampling the current signal and the position signal, setting delay time to avoid PWM chopping and ensure the integrity of the sampled signal.

3. And the position sampling and the current sampling are ensured to be carried out simultaneously, which is beneficial to the calculation of a servo algorithm.

Drawings

The invention will be further described with reference to the accompanying drawings and examples, in which:

FIG. 1 is a block diagram of an internal circuit of an encoder;

fig. 2 is a timing diagram for avoiding PWM chopping signal interference.

Detailed Description

For a more clear understanding of the technical features, objects and effects of the present invention, embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

Referring to fig. 1, which is a structural diagram of an internal circuit of an encoder, an encoder with a current detection function according to the present invention includes a current sampling unit, a position sampling unit, a communication unit, and a control unit, wherein:

the connection relationship among all the components is as follows:

the current sampling part and the position sampling part are respectively connected to the control part and the servo motor M;

the control section is connected to a communication section, which is connected to a servo driver.

The functions of the various components are:

the current sampling part is mainly used for sampling UVW phase current of the servo motor to obtain three-phase currents Iu, Iv and Iw, and the three-phase currents Iu, Iv and Iw are fed back to the control part; in a servo motor control system, current feedback of a motor is required to participate in calculation, but in the traditional method, sampling is performed in a servo driver. In this way, leakage currents caused by parasitic capacitances on the power transmission lines, as well as some interference currents, are detected, which can cause system noise. In the invention, the current obtained by directly sampling at the motor side is the real motor winding current, so that the noise caused by interference current is effectively avoided;

the position sampling part is mainly used for sampling the actual position of the servo motor rotor to obtain an actual rotor position pos _ act, and the actual rotor position pos _ act is fed back to the control part; because the communication between the encoder and the servo driver is periodic, for example, once communication is performed in 62.5us, pos _ act is obtained by sampling after the encoder receives a request instruction of the servo driver, and if no processing is performed, the pos _ act is directly fed back to the servo driver in a response frame, the pos _ act is obtained by directly feeding back the response frame to the servo driver, and after the servo driver receives data (the data transmission requires more than 20 us), the data is generally processed in the next period, that is, after 62.5us, at this time, the actual position of the motor rotor and the sampling time are not equal, which is why the motor observation position needs to be predicted subsequently through the control part;

the communication part is mainly used for carrying out information interaction with the servo driver and receiving a position data request instruction when the servo driver requests to acquire the position of the rotor of the servo motor and sends the position data request instruction to the communication part; the position data request command comprises sampling time Ta, a sampling period Ts and a motor position control parameter; the position data request command is fed back to the control part; the motor position control parameters comprise a Q-axis current given value Iref or a motor torque given value Tref;

the control part mainly plays two roles:

on one hand, the system is used for analyzing the position data request instruction, and simultaneously triggering the current sampling part and the position sampling part to perform current sampling and position sampling according to the sampling time Ta and the sampling period Ts obtained by analysis, and controlling the sampling time of the current sampling part and the sampling time of the position sampling part to obtain a current signal and the sampling time of a rotor position signal to be at the same moment; when synchronous sampling processing is carried out, a timer of a mcu (micro control unit) can be considered to trigger current sampling and position sampling simultaneously, and the simultaneity of sampling time is ensured;

on the other hand, the control part is used for calculating by combining the actual rotor position pos _ act and the motor position control parameter acquired from the position sampling part after sampling time synchronization processing is carried out, so as to obtain a rotor observation position pos _ fed; the calculation formula of the rotor observation position pos _ fed is as follows:

pos_fed(k)=pos_act(k)+(pos_act(k)-pos_act(k-1))×Iqref(k)÷(pos_act(k-1)-pos_act(k-2))÷Iqref(k-1);

or

pos_fed(k)=pos_act(k)+(pos_act(k)-pos_act(k-1))×Tqref(k)÷(pos_act(k-1)-pos_act(k-2))÷Tqref(k-1);

Where k is the sampling period, for example, Iqref (k-1) is a discrete representation, which is the Q-axis current set value sampled in the previous period.

The rotor observation position pos _ fed and the current signal after sampling time synchronization are fed back to the servo driver through the communication part, and the servo driver controls the torque, the rotating speed and the rotating angle of the motor according to the current and position feedback of the motor.

In this embodiment, in order to ensure the integrity of the sampling signal, the position data request command further includes the relative time of the PWM peak and the PWM trough; specifically, refer to fig. 2, which is a timing chart avoiding interference of the PWM chopping signal, where the control portion sets the sampling delay time according to the relative time of the PWM peak and the PWM trough, the sampling time Ta, and the sampling period Ts, where:

when the control part receives a position data request command at the time t1+ Td, the sampling delay time Tw is set according to the relative time of the PWM trough as follows:

Tw=Ts-Ta-Td;

after time delay processing is carried out, sampling of the current signal and the position signal is carried out in sequence, and a sampling point is adjusted at the bottom of the PWM chopping signal;

or according to the relative time of the PWM wave crest, the set sampling delay time Tw is as follows:

Tw=Ts/2-Ta-Td;

adjusting a sampling point at the top of the PWM chopping signal at present;

before sampling the current signal and the position signal, setting delay time to avoid PWM chopping and ensure the integrity of the sampled signal.

In this embodiment, the method for detecting a current by using the encoder includes the following steps:

s1, a servo driver requests to acquire the rotor position of a servo motor and sends a position data request command to a communication part, the communication part and the servo driver carry out information interaction, and the position data request command is received; the position data request command is fed back to the control part by the communication part;

s2, the control part analyzes the position data request command, and according to the sampling time Ta and the sampling period Ts obtained by analysis, the control part simultaneously triggers the current sampling part and the position sampling part to carry out current sampling and position sampling, and controls the sampling time of the current sampling part and the sampling time of the position sampling part to obtain a current signal and the sampling time of a rotor position signal to be at the same moment; the position data request command also comprises the relative time of the peak and the trough of the PWM; the control part sets sampling delay time according to the relative time of the peak and the trough of the PWM, sampling time Ta and a sampling period Ts, wherein:

when the control part receives a position data request command at the time t1+ Td, the sampling delay time Tw is set according to the relative time of the PWM trough as follows:

Tw=Ts-Ta-Td;

after time delay processing is carried out, sampling of the current signal and the position signal is carried out in sequence, and a sampling point is adjusted at the bottom of the PWM chopping signal;

or according to the relative time of the PWM wave crest, the set sampling delay time Tw is as follows:

Tw=Ts/2-Ta-Td;

adjusting a sampling point at the top of the PWM chopping signal at present;

before sampling the current signal and the position signal, setting delay time to avoid PWM chopping and ensure the integrity of the sampled signal.

S3, the current sampling part samples and calculates UVW phase current of the servo motor to obtain three-phase currents Iu, Iv and Iw, and the three-phase currents Iu, Iv and Iw are fed back to the control part; and the position sampling part is used for sampling the actual position of the rotor of the servo motor to obtain an actual rotor position pos _ act, and the actual rotor position pos _ act is fed back to the control part.

S4, after the control part carries out sampling time synchronization processing, calculating by combining the actual rotor position pos _ act and the motor position control parameter acquired from the position sampling part to obtain a rotor observation position pos _ fed; the motor position control parameters comprise a Q-axis current given value Iref or a motor torque given value Tref; in this step, a calculation formula for calculating the observed rotor position pos _ fed by the control unit is:

pos_fed(k)=pos_act(k)+(pos_act(k)-pos_act(k-1))×Iqref(k)÷(pos_act(k-1)-pos_act(k-2))÷Iqref(k-1);

or

pos_fed(k)=pos_act(k)+(pos_act(k)-pos_act(k-1))×Tqref(k)÷(pos_act(k-1)-pos_act(k-2))÷Tqref(k-1);

Where k is the sampling instant.

And S5, the control part feeds back the rotor observation position pos _ fed and the current signal subjected to sampling time synchronization to the servo driver through the communication part, and the servo driver controls the torque, the rotating speed and the rotating angle of the motor according to the current and the position feedback of the motor.

In the invention, a current sampling part is designed in an encoder to sample the phase current of the servo motor, so that the interference current is prevented from being detected; before sampling the current signal and the position signal, setting delay time to avoid PWM chopping and ensure the integrity of the sampled signal.

While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种可配置的电机速度位置高速并行检测方法、系统及介质

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!