The present invention relates to a motor control device that detects a motor position by use of a rotary encoder and controls the rotation of a motor based on the detection result. The present invention particularly relates to a motor control device having a function of detecting a motor position at an input timing of an external input signal in a state where a motor is rotating at a constant speed.
In a conventional motor control device, for rotation control, motor position information from a rotary encoder is acquired in a constant sampling cycle, for example, through serial communication. Furthermore, this motor control device is configured so that an external input signal can be supplied from the outside in order to detect the motor position at a timing indicated from the outside. That is, this motor control device is configured to acquire and store the motor position information at a timing when the external input signal is turned on.
Furthermore, in order to improve the detection accuracy of the motor position, a motor drive device including an internal counter inside the device has been proposed (see, for example, PTL 1). This motor drive device stores each of the value of the internal counter for each sampling cycle and the value of the internal counter at the timing of the external input signal. This motor drive device uses each of the stored values of the internal counter to estimate the motor position at the timing when the external input signal is turned on between adjacent samplings.
Furthermore, conventionally, a method for suppressing a decrease in detection accuracy due to an error caused by a transmission delay of the external input signal has been proposed (see, for example, PTL 2). For example, a proposal has been made to accurately estimate the motor position at the timing when the external input signal is input even in a case where a transmission delay time difference between the rise and fall of the external input signal is large and the motor operates at high speed. This motor drive device uses, as the external input signal, a rectangular wave with a clear duty ratio. This motor drive device first stores the value of the internal counter at each timing of the rise and fall of the input rectangular wave. Next, the motor drive device obtains a ratio between the timing from the rise to the fall and the timing from the fall to the rise by use of each of the stored values of the internal counter. The motor drive device estimates, from a difference between this ratio and the duty ratio of the rectangular wave, a relative delay correction amount of the transmission delay time.
However, in the conventional method described above, insulation processing is performed on the external input signal, for example, at a timing from the input of the external input signal to the acquisition of the value of the internal counter, and thus a delay is caused by an analog input circuit or the like that uses an analog element such as a photocoupler. Therefore, in the conventional method described above, the detected motor position includes an error due to the delay.
The present invention has been made in view of the above-described problem, and an object of the present invention is to provide a motor control device capable of accurately detecting a motor position by correcting a delay in an analog input circuit or the like.
In order to achieve the above-described object, a motor control device of the present invention includes an instruction position detector that calculates, as an instruction position detection value, a position detection value at an external instruction timing. The instruction position detector includes an internal counter, a detection position calculator, and a correction value generator. The internal counter outputs a count value counted at a cyclic interval shorter than a position read cycle that is an interval at which a motor position detected by a rotary encoder mounted on a motor is read as a position detection value. The detection position calculator controls a rotation of the motor by use of the position detection value, is supplied with an external detection instruction signal including an instruction pulse, and calculates the instruction position detection value by use of a count value at the external instruction timing indicated by an edge of the instruction pulse. The correction value generator includes an external input terminal, an input circuit, a count value acquisition unit, and a correction value calculator. The external input terminal is supplied with the external detection instruction signal. The input circuit performs analog processing that causes a pulse delay on the external detection instruction signal to be input, and outputs a detection instruction signal including an acquisition pulse as the delayed instruction pulse. The count value acquisition unit acquires a count value of an internal counter signal at a data acquisition timing indicated by an edge of the acquisition pulse, and holds the count value of the internal counter signal as an acquisition count value. The correction value calculator calculates a correction value for correcting an error between the count value at the external instruction timing and the acquisition count value, the error being caused by the pulse delay. The correction value generator supplies, instead of the instruction pulse, a measurement pulse generated by use of the count value output from the internal counter to the input circuit to measure a pulse delay of the measurement pulse in a state where the motor is rotating at a constant speed, and calculates the correction value based on the pulse delay. The detection position calculator corrects the acquisition count value by use of the correction value to generate the count value at the external instruction timing.
According to such a configuration, the acquisition count value is corrected by use of the correction value generated based on the measurement in the correction value generator. Therefore, the influence of the delay in the input circuit can be suppressed. Therefore, the desired instruction position detection value at the external instruction timing can be accurately obtained.
The motor control device of the present invention can suppress the influence of the delay in the input circuit on the instruction position detection value by performing correction using the correction value generated by the correction value generator. Therefore, the present invention can provide a motor control device capable of accurately detecting the motor position.
Hereinafter, an exemplary embodiment of the present invention will be described with reference to the drawings. Note that the exemplary embodiment described below shows a preferred specific example of the present disclosure. Therefore, the numerical values, shapes, materials, components, arrangement positions and connection forms of the components, and the like shown in the following exemplary embodiment are examples, and are not intended to limit the present disclosure. Therefore, among the components in the following exemplary embodiment, components not described in the independent claim indicating the highest level concept of the present disclosure will be described as optional components.
The drawings are schematic diagrams and are not necessarily exactly illustrated. Therefore, the scales and the like do not always match in the drawings. In the drawings, substantially the same components are designated by the same reference marks, and duplicate description will be omitted or simplified.
As illustrated in
Host controller 75 performs processing such as supplying command information to motor control device 10, for example, and controls the entire system via motor control device 10. Host controller 75 is a controller for such servo control, and for example, a microcontroller is suitable. Motor 70 is energized and driven by motor control device 10 while being controlled to rotate according to, for example, the command information. Furthermore, in order to detect a motor position, that is, to detect a rotation position of a rotor of motor 70, rotary encoder 71 is mounted on motor 70.
With such a configuration of the motor control system, motor control device 10 is notified of a command regarding the rotation position, rotation speed, and the like from host controller 75 arranged outside motor control device 10, for example. While receiving position information from rotary encoder 71, motor control device 10 drives motor 70 so that the rotor reaches a predetermined position and speed according to the command from host controller 75.
In the present exemplary embodiment, as illustrated in
Motor 70 driven by motor control device 10 is preferably a brushless motor including a stator with three-phase windings of U-phase, V-phase, and W-phase and a rotor facing the stator and rotatably arranged around a rotation shaft. The rotor of motor 70 rotates when the windings of the stator are energized and driven by the drive voltage DRv from motor control device 10. By the rotation of the rotor, motor 70 is rotationally driven so as to rotate the load via the rotation shaft.
In order to control the rotation of motor 70, rotary encoder (hereinafter, simply referred to as encoder as appropriate) 71 that detects the rotation position (hereinafter, also referred to as motor position as appropriate) of the rotor is mounted on motor 70. Encoder 71 that functions as such a position sensor outputs the position sensor signal Dps indicating the detected rotation position, and the position sensor signal Dps is supplied to motor control device 10.
In particular, in the present exemplary embodiment, an incremental rotary encoder is adopted as encoder 71. The incremental encoder includes a grid disk in which a plurality of slits is uniformly formed in a circumferential direction, a photoelectric element for measuring the number of passages of the slits, and position counter 73 for counting the number of passages. The grid disk is mounted on the rotation shaft of motor 70. As a result, the passing of the slits according to rotation is detected by use of the photoelectric element, and the number of passing slits is counted by position counter 73. A count value indicating this count number corresponds to a rotation angle. Incremental encoder 71 is a motor position detector that measures, based on such a configuration, the rotation angle, that is, the rotation position of the rotor. As described above, in
Next, as illustrated in
The external command signal CEx from host controller 75 to motor control device 10 as described above is supplied to control unit 11. Control unit 11 includes, for example, a central processing unit (CPU) or a processor. Control unit 11 performs various types of processing and control in motor control device 10 based on a program stored in a memory. As an example of the processing, control unit 11 extracts control commands, which are various commands for controlling motor 70, from the supplied external command signal CEx.
Furthermore, in the present exemplary embodiment, each operation is executed mainly by digital processing in motor control device 10. Therefore, motor control device 10 includes clock generator 12 that generates a clock signal, as is well known, for the digital processing. That is, clock generator 12 generates a clock Ck, which is a cyclic pulse signal, in motor control device 10. The clock Ck is used as a reference of an operation cycle of the digital processing in motor control device 10, for example, for digital processing such as latching data.
Motor control device 10 further includes timing signal generator 13 that generates various timing signals based on the clock Ck. Specifically, timing signal generator 13 generates pulse signals indicating various timings by, for example, dividing the clock Ck.
Note that, in the present exemplary embodiment, unless otherwise specified, each digital processing circuit will be described with an example of operating at a rising edge where the level of a pulse signal such as the clock Ck, the control clock SCk, or the read clock RCk changes from Low to High. That is, in the present exemplary embodiment, a configuration example, the details of which will be further described below, is given in which a D-type flip-flop is used as a latch for temporarily storing data. As is well known, this D-type flip-flop holds the value of a D input as a Q output at a rising edge of a pulse signal supplied to a clock terminal.
Next, a configuration in which motor 70 is controlled, energized, and driven by motor control device 10 will be described. In the present exemplary embodiment, basically, motor control device 10 executes feedback control using the position information with the position sensor signal Dps from encoder 71. By this feedback control, the movement of the rotor in motor 70 is controlled so that the rotation position of motor 70 follows the position command signal Pcm from control unit 11.
Motor control device 10 includes motor position receiver 16 in order to acquire the position information from the position sensor signal Dps. Motor position receiver 16 and encoder 71 are communicated and connected by, for example, serial communication. The count value of the position counter signal Pos by position counter 73 of encoder 71 is transmitted, as the position sensor signal Dps in a predetermined transmission format, to motor position receiver 16. Furthermore, the read clock RCk is supplied to motor position receiver 16. Motor position receiver 16 restores the position information from the position sensor signal Dps in the cycle of the read clock RCk. The data, which is the restored position information, is then used as the position detection value, and is sequentially output as a position detection value signal Dpos in the cycle of the read clock RCk. That is, the position detection value signal Dpos is a digital signal in which position count values of the position counter signal Pos by encoder 71 are arranged as position detection values in time series in the sampling cycle of the read clock RCk. As described above, motor control device 10 reads, as the position detection value with the position detection value signal Dpos, the position count value indicating the motor position detected by encoder 71 for each read clock RCk, which is an interval of the position read cycle. The position detection value signal Dpos is output from motor position receiver 16. The position detection value signal Dpos is supplied to rotation control unit 14, and rotation control unit 14 controls the rotation of motor 70 using the position detection value of the position detection value signal Dpos. Furthermore, the position detection value signal Dpos is also supplied to instruction position detector 20 that calculates an instruction position detection value at the timing indicated from the outside.
Rotation control unit 14 receives the position detection value signal Dpos and the position command signal Pcm supplied from control unit 11, and generates a drive signal Trq for driving motor 70 by arithmetic processing based on these signals. Furthermore, rotation control unit 14 is supplied with the control clock SCk. Rotation control unit 14 executes processing such as this arithmetic processing in the cycle of the control clock SCk. In order to execute the position feedback control, rotation control unit 14 executes, for example, the following arithmetic processing. That is, rotation control unit 14 sequentially calculates a position deviation, which is a difference between the position command signal Pcm and the position detection value signal Dpos. Rotation control unit 14 generates the drive signal Trq by proportional integral differential (PID) arithmetic processing or the like on the position deviation. Note that, in the present exemplary embodiment, an example in which motor control device 10 mainly controls the rotation position will be described. However, rotation control unit 14 may be configured so that, for example, the speed is calculated from position data and the drive signal Trq is generated by speed feedback control.
The drive signal Trq is supplied to motor drive unit 15. Motor drive unit 15 generates and outputs the drive voltage DRv that energizes and drives the windings of motor 70 based on the drive signal Trq. That is, motor drive unit 15 includes a pulse width modulation (PWM) circuit for generating a drive waveform, a so-called inverter, and the like, and uses these circuits to generate the drive voltage DRv according to the supplied drive signal Trq. When the drive voltage DRv is applied to the windings of motor 70, motor 70 is energized and driven. When motor 70 is energized and driven, the rotor in motor 70 rotates according to the position command signal Pcm.
As described above, in the present exemplary embodiment, encoder 71 notifies rotation control unit 14 of the position detection value signal Dpos indicating the actual rotation position of the rotor via motor position receiver 16. At the same time, control unit 11 notifies rotation control unit 14 of the position command signal Pcm, which is a command to control the rotation position. Then, rotation control unit 14 configures a position control loop that performs the feedback control so that the rotation position of the rotor follows a command position based on the position detection value signal Dpos and the position command signal Pcm. Motor control device 10 continuously executes the above-described series of loop processing to control the rotation of motor 70.
Furthermore, in the present exemplary embodiment, motor control device 10 includes instruction position detector 20, and instruction position detector 20 enables the detection of the position of the rotor at the timing indicated from the outside. In the present exemplary embodiment, in order to indicate the timing of such motor position detection, a pulse signal as an external detection instruction signal PEx is supplied from the outside. In the present exemplary embodiment, the pulse in the external detection instruction signal PEx is used as an instruction pulse, and more specifically, an example is given in which a rising timing of an edge of the instruction pulse is set as an external instruction timing, which is an instruction timing from the outside.
In order to detect a rotor position corresponding to such an instruction, instruction position detector 20 includes, as illustrated in
First, as illustrated in
Furthermore, the rotation of the rotor is controlled at a constant rotation speed, and thus, in the position counter signal Pos, the movement amount of the rotor in the cycle of the read clock RCk is constant.
In contrast with the position detection value signal Dpos as described above, the external instruction timing is an arbitrary timing that is not related to a sampling timing in encoder 71. Thus, there is an irregular time lag between the external instruction timing and a read timing in the cycle of the read clock RCk.
Therefore, as illustrated in
Furthermore, in the present exemplary embodiment, as illustrated in
Therefore, in the present exemplary embodiment, instruction position detector 20 further has a correction function of measuring, by use of the count value of internal counter 21, the delay amount of the pulse signal generated by input circuit 22 and correcting, by use of the measured delay amount, the error due to the delay.
Internal counter 21 provided in instruction position detector 20 in order to take these measures is a counter that counts the number, similarly to position counter 73 of encoder 71. Internal counter 21 is configured to output count values counted at cyclic intervals shorter than the cycles of the read clock RCk. In the present exemplary embodiment, as illustrated in
As illustrated in
Note that, in the case of the present exemplary embodiment, the read clock RCk is generated by the clock Ck being divided by timing signal generator 13, and internal counter 21 counts the clock Ck to generate the internal counter signal Cap. Therefore, for example, in a case where the clock Ck is divided by 1000 to generate the read clock RCk, DFF 45 acquires count values that change by 1000 from the internal counter signal Cap. Hereinafter, the amount by which the count value changes for each read clock RCk will be described as a change value Ncap of the internal counter as illustrated in
As illustrated in
Note that, as described above, the detection instruction signal PLt is a signal as the delayed external detection instruction signal PEx. In response to the external instruction timing by the external detection instruction signal PEx, the data is actually acquired by the detection instruction signal PLt. As a result, regarding the detection instruction signal PLt, the rising timing of the acquisition pulse, that is, the time point tdl in
As described above, count value acquisition unit 24c acquires the value of the internal counter signal Cap at the data acquisition timing delayed by input circuit 22. Therefore, in the present exemplary embodiment, as described above, instruction position detector 20 has the correction function of correcting the delay caused by input circuit 22. In order to implement this correction function, instruction position detector 20 further includes pulse generator 23, changeover switch 22s, and correction value calculator 25. As illustrated in
First, as illustrated in
As illustrated in
As illustrated in
As illustrated in
Note that, in
As described above, correction value generator 30 generates the measurement pulse by using the internal counter signal Cap. Correction value generator 30 supplies the measurement pulse to input circuit 22, measures the pulse delay of the measurement pulse, and calculates the correction value Crr based on the pulse delay of the measured measurement pulse. Note that the correction value Crr may be constantly stored, for example, in control unit 11 by use of a non-volatile memory or the like and used for each position detection instruction from the outside.
As described above, the correction value Crr calculated based on the measurement by the configuration of correction value generator 30 as illustrated in
Position data acquisition unit 24p is supplied with the position detection value signal Dpos from motor position receiver 16 and the detection instruction signal PLt from input circuit 22. Position data acquisition unit 24p acquires the position detection value from the position detection value signal Dpos at the data acquisition timing by the detection instruction signal PLt and temporarily holds the position detection value.
Furthermore, detection position calculator 26 is supplied with the internal count value signal Dcap from count value storage 24m, the count value acquired by count value acquisition unit 24c, the correction value Crr calculated by correction value calculator 25, the position detection value signal Dpos from motor position receiver 16, and the position detection value acquired by position data acquisition unit 24p. That is, in a period from the time point t0 to the time point t1, when the data acquisition timing by the detection instruction signal PLt as illustrated in
Detection position calculator 26 calculates the instruction position detection value Dpex at the external instruction timing at the time point tex by using these values in the period from the time point t0 to the time point t1. That is, detection position calculator 26 calculates the instruction position detection value Dpex by interpolation using the count value Cap0 of the count values acquired at intervals of the read cycle Trc and a count value CapE at the external instruction timing. Furthermore, regarding this count value CapE, as described above, the acquisition count value CapX is corrected by use of the correction value Crr, so that the count value CapE at this external instruction timing is generated.
Note that the instruction position detection value Dpex is an estimated value calculated by the back calculation for the value Ppex indicating the accurate position at the external instruction timing described in
In
Delay correction unit 61 illustrated in
The corrected count value CapE and the count value Cap0 output from count value storage 24m are supplied to subtractor 62. Subtractor 62 subtracts the count value Cap0 from the corrected count value CapE and outputs the subtraction result as a difference value dtC.
Here, a time from the time point t0 at which the internal counter signal Cap is the count value Cap0 to the time point tex at the external instruction timing is set as the time Ter as illustrated in
Furthermore, detection position calculator 26 calculates the count value of the position counter signal Pos at the external instruction timing, that is, the target instruction position detection value Dpex by position change amount calculator 65, multiplier 64, and adder 66.
First, position change amount calculator 65 calculates a change value of the position detection value for each read cycle Trc by, for example, differentiating the position detection value signal Dpos.
The change value Npoc0 and the ratio Rto described above are supplied to multiplier 64. Here, the change value Npoc0 indicates the amount of change in the position detection value in the read cycle Trc, and the ratio Rto is a ratio of the time Ter to the read cycle Trc. Thus, the change value Npoc0 is multiplied by the ratio Rto, so that it is possible to obtain the amount of change in the position detection value during the period of the time Ter. That is, multiplier 64 outputs a position interpolation value dtR indicating this amount of change.
Adder 66 adds the position interpolation value dtR, which is the amount of change in the period of the time Ter, to the position detection value Pos0 at the time point t0. As a result, adder 66 can calculate the target instruction position detection value Dpex, as illustrated in
As described above, motor control device 10 of the present exemplary embodiment includes instruction position detector 20 that calculates, as an instruction position detection value, a position detection value at an external instruction timing. Instruction position detector 20 includes internal counter 21, detection position calculator 26, and correction value generator 30. Internal counter 21 outputs a count value counted at a cyclic interval shorter than a position read cycle that is an interval at which a motor position detected by rotary encoder 71 mounted on motor 70 is read as a position detection value. Detection position calculator 26 controls a rotation of the motor by use of the position detection value, is supplied with an external detection instruction signal PEx including an instruction pulse, and calculates an instruction position detection value Dpex by use of a count value at the external instruction timing indicated by an edge of the instruction pulse. Correction value generator 30 includes external input terminal 27, input circuit 22, count value acquisition unit 24c, and correction value calculator 25. External input terminal 27 is supplied with the external detection instruction signal PEx. Input circuit 22 performs analog processing causing a pulse delay on the external detection instruction signal PEx to be input, and outputs a detection instruction signal PLt including an acquisition pulse as the delayed instruction pulse. Count value acquisition unit 24c acquires a count value Cap of an internal counter signal at a data acquisition timing indicated by an edge of the acquisition pulse, and holds the count value Cap of the internal counter signal as an acquisition count value CapX. Correction value calculator 25 calculates a correction value Crr for correcting an error between a count value Pst at the external instruction timing and the acquisition count value CapX, the error being caused by the pulse delay. Correction value generator 30 supplies, instead of the instruction pulse, a measurement pulse generated by use of the count value Cap output from internal counter 21 to input circuit 22 to measure a pulse delay of the measurement pulse in a state where motor 70 is rotating at a constant speed, and calculates the correction value Crr based on the pulse delay. Detection position calculator 26 corrects the count value CapX by use of the correction value Crr to generate a count value CapE at the external instruction timing. Instruction position detector 20 calculates the instruction position detection value Dpex by interpolation using a count value Cap0 acquired at the interval of the position read cycle and the corrected count value CapE.
As described above, according to motor control device 10, the acquisition count value CapX is corrected by use of the correction value Crr generated based on the measurement by correction value generator 30, it is possible to suppress the influence of the delay in input circuit 22, and to accurately obtain the desired instruction position detection value Dpex at the external instruction timing.
In addition, correction value generator 30 may further include pulse generator 23 that generates the measurement pulse by use of the count value Cap output from internal counter 21, a start value Pst indicating a start timing of the measurement pulse, and a stop value Pen indicating an end timing of the measurement pulse.
Correction value calculator 25 may calculate the correction value Crr by use of the acquisition count value CapX and the start value Pst, the acquisition count value CapX being acquired by count value acquisition unit 24c based on the measurement pulse.
Motor control device 10 may further include a non-volatile memory that stores the correction value Crr.
Note that, in the above description, for example, an example has been described in which the position read clock signal RCk or the detection instruction signal PLt is acquired or operated at the rising edge of the pulse, but the falling edge of the pulse may be used as appropriate. Furthermore, either the rising edge or the falling edge may be used depending on the signal. In addition, these pulses have been described as pulses whose pulse period is High, but these pulses may be pulses whose pulse period is Low and motor control device 10 can be configured according to such pulses. Furthermore, an example has been described in which internal counter 21 counts up, but the count may be down. In this case, motor control device 10 can be configured according to the down count as appropriate.
A motor control device of the present invention is useful for a motor control device that requires accurate position detection, a semiconductor manufacturing device or an electronic component mounting machine that requires accurate positioning, and the like.
Number | Date | Country | Kind |
---|---|---|---|
2019-006713 | Jan 2019 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2019/045505 | 11/20/2019 | WO | 00 |