Motor Control Device

The motor control device efficiently switches between PWM and angle synchronization control using a timer circuit with compare registers, addressing the complexity and cost issues of dedicated microcomputers, thereby stabilizing motor operation and reducing overcurrent and torque fluctuations.

JP7619300B2Active Publication Date: 2025-01-22DENSO CORP
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2022022150
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2022-02-16
Publication Date
2025-01-22
Estimated Expiration
2042-02-16

AI Technical Summary

Technical Problem

Existing motor control devices that switch between PWM control and angle synchronization control require dedicated microcomputers with angle timers, leading to increased complexity and cost due to the need for additional hardware components.

Method used

A motor control device that utilizes a timer circuit with compare registers and counters to manage on/off timings for switching elements, allowing for seamless switching between PWM and angle synchronization control without a dedicated microcomputer with an angle timer, using a general-purpose microcomputer.

Benefits of technology

Enables cost-effective operation by preventing interference between control modes, stabilizing motor control, reducing overcurrent and torque fluctuations, and ensuring safe vehicle operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007619300000001
    Figure 0007619300000001
  • Figure 0007619300000002
    Figure 0007619300000002
  • Figure 0007619300000003
    Figure 0007619300000003
Patent Text Reader

Abstract

To make it possible to achieve a motor control device that drives a motor by switching inverter control methods between a PWM control and an angle synchronous control at low cost without using a microcomputer including an angle timer.SOLUTION: A motor control device includes a timer circuit 60, a control mode setting unit 44, a PWM control unit 46, an angle calculation unit 48, and an angle synchronous control unit 52. The PWM control unit switches the operation mode of the angle synchronous control unit in accordance with a control mode set in the control mode setting unit and executes a PWM control when the operation mode of the angle synchronous control unit is the PWM mode. The angle synchronous control unit executes an angle synchronous control when the operation mode is an angle synchronous mode.SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present disclosure relates to a motor control device that operates an inverter to drive a motor. [Background technology]

[0002] Patent Document 1 discloses a control device that switches the control method of an inverter between PWM control and angle synchronous control according to the modulation rate of an output voltage vector for driving a motor with a command torque. Note that PWM is an abbreviation for Pulse Width Modulation.

[0003] This control device is provided with two modulation units for generating drive signals for a plurality of switching elements that constitute the inverter according to each control method. One of the drive signals generated by each modulation unit is selectively input to the inverter via a selector. [Prior art documents] [Patent documents]

[0004] [Patent Document 1] JP 2017-93029 A Summary of the Invention [Problem to be solved by the invention]

[0005] In the above control device, in order to output drive signals from the two modulation sections to turn on and off multiple switching elements of the inverter according to each control method, each modulation section must be provided with a timer circuit for detecting the rising and falling timing of the drive signal. Specifically, the modulation section for PWM control must be provided with a timer circuit equipped with a counter for counting time so that the drive signal can be output at the desired timing. In addition, the modulation section for angle synchronization control must be provided with an angle timer equipped with a counter for counting the rotation angle of the motor so that the drive signal can be output at the desired rotation angle of the motor.

[0006] The above control device is usually configured with a microcomputer capable of executing various types of calculation processing, but a general-purpose microcomputer is not equipped with an angle timer. Therefore, in order to realize the above control device, a dedicated microcomputer equipped with an angle timer is necessary. However, if the motor control device is configured with a dedicated microcomputer equipped with an angle timer, the device configuration becomes complicated, which causes a problem of increased costs.

[0007] One aspect of the present disclosure aims to provide a motor control device that drives a motor by switching the control method of an inverter between PWM control and angle synchronous control, which can be realized at low cost without using a microcomputer equipped with an angle timer. [Means for solving the problem]

[0008] A motor control device according to one aspect of the present disclosure drives a motor by operating an inverter including a plurality of switching elements that connect a positive electrode and a negative electrode of a DC power supply to a plurality of terminals of the motor. The motor control device includes a timer circuit (60), a control mode setting unit (44), a PWM control unit (46), an angle calculation unit (48), and an angle synchronization control unit (52).

[0009] The timer circuit includes a plurality of compare registers (CM0, CM1) that store the on / off timing of each switching element for each pair of positive and negative switching elements that are respectively connected to a plurality of terminals of the motor in the inverter.

[0010] The timer circuit also includes a counter for measuring time, and is configured to output a signal indicating the on / off timing of each switching element when the value of each compare register matches the value of the counter.

[0011] The control mode setting unit is configured to set the motor control mode to either PWM mode or angle synchronous mode based on a command torque input from an external device. The PWM mode is a control mode in which each switching element of the inverter is turned on and off at a predetermined timing every fixed time. The angle synchronous mode is a control mode in which each switching element is turned on and off according to the rotation angle of the motor.

[0012] When the control mode set by the control mode setting unit is the PWM mode, the PWM control unit executes PWM control at regular intervals, calculating the on / off timing to be set in each compare register in order to drive the motor with the command torque and outputting the timing to the timer circuit.

[0013] The angle calculation unit calculates, for each predetermined rotation angle of the motor, the on / off timing of each switching element for driving the motor with a command torque as the rotation angle of the motor. The angle synchronization control section executes angle synchronization control by writing on / off timing to each compare register so that each switching element is turned on / off at the rotation angle calculated by the angle calculation section.

[0014] Therefore, the timer circuit outputs signals for turning on and off multiple switching elements of the inverter according to the on / off timing calculated by the PWM control unit or the on / off timing calculated by the angle calculation unit.

[0015] However, if the PWM control unit and the angle synchronization control unit directly write the on / off timing for PWM control or angle synchronization control to the compare register of the timer circuit, each control may interfere with each other when switching the control mode.

[0016] For example, when switching control modes, the on / off timing set in the compare register of the timer circuit for the control after the switch may be overwritten by the on / off timing for the control before the switch. In this case, the motor control becomes unstable, causing an overcurrent to flow through the motor, resulting in large torque fluctuations in the motor.

[0017] Therefore, in the motor control device disclosed herein, the timer circuit, angle synchronization control unit, and PWM control unit are configured as follows so that the controls do not interfere with each other when switching the control mode.

[0018] That is, the timer circuit includes a plurality of data registers (SR0, SR1) that store a plurality of on / off timings output from the PWM control unit to each compare register, and writes the on / off timings stored in the plurality of data registers to each compare register at regular intervals.

[0019] Next, when the angle synchronization control unit receives a first switching command while its own first operating mode is the PWM mode, the angle synchronization control unit switches the first operating mode to the angle synchronization mode and starts angle synchronization control when the motor next reaches a specified rotational angle position.

[0020] This is because, in angle synchronous control, the on / off timing of each switching element is controlled according to the rotation angle of the motor, and therefore, in order to execute angle synchronous control with high precision, it is necessary to start the angle synchronous control at a predetermined rotation angle position of the motor.

[0021] Furthermore, when the angle synchronization control unit receives a second switching command while its own first operation mode is the angle synchronization mode, it switches the first operation mode to the PWM mode and stops the angle synchronization control (S210).

[0022] On the other hand, when the control mode acquired from the control mode setting unit is the angle synchronization mode, the PWM control unit outputs a first switching command to the angle synchronization control unit and continues PWM control until the first operating mode of the angle synchronization control unit is switched from the PWM mode to the angle synchronization mode (S400, S500, S600-S604).

[0023] In addition, when the control mode acquired from the control mode setting unit is PWM mode and the first operation mode of the angle synchronization control unit is angle synchronization mode, the PWM control unit outputs a second switching command to the angle synchronization control unit immediately before starting the next PWM control after a certain period of time, thereby switching the first operation mode of the angle synchronization control unit to PWM mode (S700).

[0024] That is, the PWM control unit outputs a first switching command and a second switching command to the angle synchronization control unit according to the control mode set by the control mode setting unit, thereby controlling the start and stop of the angle synchronization control by the angle synchronization control unit. Therefore, the PWM control unit can execute PWM control without overlapping with the execution period of the angle synchronization control by the angle synchronization control unit.

[0025] Therefore, according to the motor control device of the present disclosure, under the control of the PWM control unit, it is possible to arbitrate the execution periods of each control so that the angle synchronous control and the PWM control do not interfere with each other when switching the control mode.

[0026] Furthermore, when the angle synchronization control unit sets the first operation mode to the angle synchronization mode in accordance with the first switching command output from the PWM control unit, it writes a specified value that will never match the counter value to the data register of the timer circuit, and then starts angle synchronization control (S220).

[0027] This is because when the first operation mode of the angle synchronization control unit is switched to the angle synchronization mode and the angle synchronization control unit starts angle synchronization control, the on / off timing set by the PWM control unit may remain in the data register of the timer circuit.

[0028] In other words, in this case, the value of the compare register is rewritten to the value of the data register at regular time intervals, and the switching elements in the inverter are turned on and off at the rewritten on / off timing.

[0029] Therefore, when the angle synchronization control unit sets the first operation mode to the angle synchronization mode in accordance with the first switching command, the above-mentioned specified value is written to the data register, thereby preventing the switching elements in the inverter from being turned on and off at the on and off timing of the PWM control.

[0030] In this way, the motor control device of the present disclosure can suppress interference between angle synchronization control and PWM control by switching the operation mode of the angle synchronization control unit by the PWM control unit and writing a specified value to the data register by the angle synchronization control unit, thereby suppressing interference between the angle synchronization control and PWM control that would cause motor control to become unstable, resulting in overcurrent flowing through the motor or large torque fluctuations occurring in the motor. [Brief description of the drawings]

[0031] [Figure 1] 1 is an overall configuration diagram showing the overall configuration of a motor control system according to an embodiment; [Diagram 2] 2 is a block diagram illustrating a configuration of the motor control device shown in FIG. [Diagram 3] 10 is an explanatory diagram illustrating switching between PWM control and angle synchronous control by a control mode setting unit. FIG. [Figure 4] 4 is a time chart illustrating the operation of the dead time module. [Diagram 5] 4 is a time chart showing the relationship between a control mode set by a control mode setting unit and a control method switching timing. [Figure 6] 11 is a time chart showing a register setting operation when the control mode is changed to the angle synchronization mode. [Figure 7]7 is a time chart showing details of the register setting operation shown in FIG. 6. [Figure 8] 13 is a flowchart showing a control process executed in a 15° task. [Figure 9] 11 is a flowchart showing a control process executed by a sub-core. [Figure 10] 13 is a flowchart showing a control process executed in a peak / valley task. [Figure 11] 11 is a flowchart showing a control mode arbitration process executed in S400 of FIG. 10. [Figure 12] 11 is a flowchart showing an operation mode acquisition process executed in S500 and S800 of FIG. 10. [Figure 13] 11 is a flowchart showing a PWM duty setting process executed in S600 of FIG. 10. [Figure 14] 11 is a flowchart showing a DMA timer setting process executed in S700 of FIG. 10; [Figure 15] 11 is a flowchart showing the SR resetting process executed in S900 of FIG. 10. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0032] Hereinafter, embodiments of the present disclosure will be described with reference to the drawings. [Embodiment] [composition] The motor control system of the present embodiment is a control system that is mounted on a vehicle (for example, an electric vehicle or a hybrid vehicle) that has a motor 10 as an on-board main engine and controls the motor 10.

[0033] 1, the motor control system includes a DC power supply 2, a motor 10, an inverter 20, and a control device 30. The control device 30 corresponds to the motor control device of the present disclosure.

[0034] Motor 10 is a three-phase AC motor generator and is a drive source for driving the vehicle. For this reason, motor 10 has a function as a motor that generates torque for driving the drive wheels of the vehicle, and a function as a generator that is driven by the kinetic energy of the vehicle to generate electricity.

[0035] The DC power supply 2 includes a battery 4, a converter 6 that boosts the DC voltage supplied from the battery 4, and a power storage capacitor 8. The capacitor 8 is charged with DC power input from the battery 4 via the converter 6 and with power generated by the motor 10, and is discharged when the motor 10 is driven.

[0036] The inverter 20 is a three-phase power conversion device connected between the DC power supply 2 and the motor 10. The inverter 20 converts DC power supplied from the DC power supply 2 into AC power and supplies the AC power to the motor 10. The inverter 20 also converts AC power generated by the motor 10 into DC power and supplies the DC power to the DC power supply 2.

[0037] The inverter 20 includes switching elements Q1 to Q6 and diodes D1 to D6. The switching elements Q1 to Q6 are configured by voltage-controlled semiconductor switching elements, specifically, insulated gate bipolar transistors (IGBTs). The switching elements Q1 to Q6 may be configured by metal oxide semiconductor (MOS) transistors, bipolar transistors, or the like.

[0038] The switching elements Q1 to Q3 are connected between the U-phase, V-phase, and W-phase terminals of the motor 10 and the positive terminal of the DC power supply 2. The switching elements Q4 to Q6 are connected between the U-phase, V-phase, and W-phase terminals of the motor 10 and the negative terminal of the DC power supply 2.

[0039] Therefore, the switching elements Q1 to Q3 function as upper arm switches of the motor 10 for each phase, and the switching elements Q4 to Q6 function as lower arm switches of the motor 10 for each phase.

[0040] The diodes D1 to D6 are connected in parallel to the switching elements Q1 to Q6, respectively. The diodes D1 to D6 function as freewheel diodes that pass a current in the opposite direction to the current that flows when the switching elements Q1 to Q6 are on.

[0041] Therefore, switching elements Q1, Q4 and diodes D1, D4 function as a current supply circuit 22 that supplies current in both directions to the U-phase terminal of motor 10. Additionally, switching elements Q2, Q5 and diodes D2, D5 function as a current supply circuit 24 that supplies current in both directions to the V-phase terminal of motor 10. Additionally, switching elements Q3, Q6 and diodes D3, D6 function as a current supply circuit 26 that supplies current in both directions to the W-phase terminal of motor 10.

[0042] Next, the motor control system of this embodiment is provided with a rotation sensor 12, a current sensor 14, and a voltage sensor 16 as sensors for detecting states. The rotation sensor 12 is provided near a rotor (not shown) of the motor 10, detects a rotation angle θe of the rotor, and outputs the detected rotation angle θe to the control device 30. The rotation angle θe is an electrical angle. As the rotation sensor 12, a sensor such as a resolver or an encoder can be used.

[0043] The current sensor 14 detects the current flowing through the windings of each phase of the motor 10, and outputs the detected current values ​​Iu, Iv, and Iw to the control device 30. Note that the current sensor 14 may only detect the current values ​​flowing through the windings of two phases of the motor 10. In this case, the current value of the remaining phase is calculated using Kirchhoff's law.

[0044] The voltage sensor 16 detects the input voltage from the DC power supply 2 to the inverter 20 as a power supply voltage Vin, and outputs it to the control device 30. The control device 30 is mainly configured with a microcomputer including a CPU 40, a memory 32, and a GTM 50, and operates the inverter 20 to feedback control the output torque of the motor 10 to a command torque. Note that the GTM is a generic timer module.

[0045] In detail, the control device 30 generates drive signals P1 to P6 for each of the switching elements Q1 to Q6 constituting the inverter 20 based on the detection values ​​of the above-mentioned sensors, and outputs the drive signals P1 to P6 to the inverter 20 to turn on and off the switching elements Q1 to Q6.

[0046] Here, the drive signals P1, P2, P3 on the upper arm side of each phase of the motor 10 and the corresponding drive signals P4, P5, P6 on the lower arm side are complementary pulse signals to each other, so that the U-phase switching elements Q1 and Q4, the V-phase switching elements Q2 and Q5, and the W-phase switching elements Q3 and Q6 are alternately turned on.

[0047] The command torque is output from a control device for vehicle control that is higher than the control device 30. This higher-level control device determines a target torque according to the driving state of the vehicle based on, for example, an accelerator signal from an accelerator sensor, a brake signal from a brake switch, a shift signal from a shift switch, etc., and outputs this target torque as a command torque.

[0048] [Control device and GTM functions] 2, in the control device 30, the CPU 40 has functions as a torque control unit 42, a control mode setting unit 44, a peak / valley task 46, and a 15° task 48. These functions are realized by the CPU 40 executing a program stored in the memory 32.

[0049] The torque control unit 42 calculates a phase command value φ and an amplitude command value Vn of the output voltage vector of the inverter 20 based on the command torque, the rotation angle θe of the motor 10, and the currents Iu, Iv, Iw of each phase of the motor 10.

[0050] That is, the torque control unit 42 estimates the actual torque of the motor 10 based on the rotation angle θe and the currents Iu, Iv, and Iw of the motor 10, and calculates an amplitude command value Vn and a phase command value φ as manipulated variables for controlling the estimated actual torque to a command torque. The amplitude command value Vn is defined as the square root of the sum of the square of the d-axis voltage Vd, which is the d-axis component of the output voltage vector in the dq coordinate system, and the square of the q-axis voltage Vq, which is the q-axis component.

[0051] The control mode setting unit 44 sets, as the control mode, either a PWM mode in which PWM control is performed or an angle synchronous mode in which angle synchronous control is performed, according to the modulation rate of the output voltage vector, in other words, the voltage utilization rate.

[0052] When the control mode of the motor 10 is the PWM mode, the CPU 40 calculates, in a peak-valley task 46 executed at regular time intervals, the on / off timings of each of the switching elements Q1 to Q6 for driving the motor 10 with the command torque for each phase of the motor 10.

[0053] That is, in peak-valley task 46, first, sinusoidal U-, V-, and W-phase command voltages VU, VV, and VW are calculated based on the amplitude command value Vn and phase command value φ calculated by torque control unit 42. Then, the calculated U-, V-, and W-phase command voltages VU, VV, and VW are normalized by the power supply voltage Vin detected by voltage sensor 16 to calculate U-, V-, and W-phase command time ratios DTu, DTv, and DTw.

[0054] Next, the peak-valley task 46 calculates the on / off timing of the switching elements Q1 to Q6 of each phase by comparing the command time ratios DTu, DTv, and DTw of each phase with a triangular wave, which is a carrier signal for PWM control, as shown in FIG.

[0055] Then, the peak / valley task 46 outputs the calculated on / off timings of each phase to the GTM 50 as a pulse output command, thereby causing the GTM 50 to output drive signals P1 to P6 for driving the motor 10 under PWM control.

[0056] Fig. 4 shows the state in which the command time ratio DTu of the U phase is compared with the triangular wave to calculate the on / off timing of the U phase switching elements Q1, Q4. As shown in Fig. 4, the triangular wave is an isosceles triangle shape with equal increasing and decreasing speeds, and the peak / valley task 46 is executed at each of the upper and lower peaks of the triangular wave. The DUTY shown in Fig. 4 represents the on / off timing of the switching elements Q1 to Q6 of each phase.

[0057] Next, when the control mode of the motor 10 is the angle synchronous mode, the CPU 40 determines a pulse pattern for driving the motor 10 with the command torque in a 15° task 48 that is executed for each predetermined rotation angle of the motor 10, which in this embodiment is for each 15 electrical degrees. Note that this pulse pattern is also calculated for each phase of the motor 10, similar to the on / off timings of the switching elements Q1 to Q6 calculated in the peak / valley task 46.

[0058] That is, the 15° task 48 first obtains the rotational angular velocity, in other words the electrical angular velocity, from the rotational angle θe of the motor detected by the rotation sensor 12, and then obtains the number of pulses to be output per one rotation of the motor based on the rotational angular velocity. Then, based on the number of pulses and the amplitude command value Vn calculated by the torque control unit 42, a pulse pattern for angle synchronization control is selected from a plurality of preset pulse patterns.

[0059] The 15° task 48 outputs a pulse output angle for turning on / off each of the switching elements Q1 to Q6 to the GTM 50 in accordance with the selected pulse pattern, thereby causing a sub-core 52, which is different from the CPU core constituting the CPU 40, to execute angle synchronization control.

[0060] The calculation operations in the peak / valley task 46 and the 15° task 48 described above are described in Patent Document 1, so a detailed description will be omitted here. In this embodiment, the peak / valley task 46 corresponds to the PWM control unit of the present disclosure, and the 15° task 48 corresponds to the angle calculation unit of the present disclosure.

[0061] Here, the control of the motor 10 is switched between PWM control and angle synchronous control in order to switch the control method depending on the modulation factor, which is the ratio between the amplitude command value of the output voltage from the inverter 20 and the power supply voltage, as shown in Figure 3.

[0062] That is, in this embodiment, the rotation region of the motor 10 is divided into a rotation region A where the modulation rate is equal to or lower than a predetermined value MRth (for example, 95%), and a rotation region B where the modulation rate exceeds the predetermined value MRth.

[0063] In the rotation region A, PWM control is selected as the control method, and in the rotation region B, angle synchronous control is selected as the control method. This is because in the rotation region B where the modulation rate exceeds a predetermined value MRth, the voltage utilization rate becomes high, and it is difficult to drive the motor 10 by PWM control.

[0064] Next, the GTM 50 includes a sub-core 52, an angle detection unit 54, an ARU-connected Timer Output Module (hereinafter, ATOM) 60, and a Dead Time Module (hereinafter, DTM) 70.

[0065] Here, ATOM 60 outputs pulse signals Pu, Pv, and Pw that complementarily turn on and off switching elements, i.e., Q1 and Q4, Q2 and Q5, and Q3 and Q6, in current supply circuits 22, 24, and 26 provided in inverter 20. ATOM 60 corresponds to the timer circuit of the present disclosure.

[0066] The ATOM 60 is provided with timer circuits 62, 64, 66 for the U phase, the V phase, and the W phase in order to generate the pulse signals Pu, Pv, and Pw for each phase. The ATOM 60 is also provided with a timer counter 68 for measuring time.

[0067] The timer circuits 62, 64, 66 for the U-phase, V-phase, and W-phase respectively include compare registers CM0, CM1 in which the on / off timings of the switching elements Q1 and Q4, Q2 and Q5, and Q3 and Q6 of each phase are written.

[0068] Each timer circuit 62, 64, 66 raises a pulse signal Pu, Pv, Pw when the value of the compare register CM0 and the timer counter 68 match, and lowers the pulse signal Pu, Pv, Pw when the value of the compare register CM1 and the timer counter 68 match.

[0069] Therefore, when the peak / valley task 46 is performing PWM control, the on / off timings of the U, V, and W phases calculated by the peak / valley task 46 are written to the compare registers CM0 and CM1 of the corresponding timer circuits 62, 64, and 66.

[0070] Then, pulse signals Pu, Pv, Pw are output from the timer circuits 62, 64, 66 in accordance with the on / off timing written in the compare registers CM0, CM1 as shown in Fig. 4. Note that Fig. 4 shows the pulse signal Pu output from the timer circuit 62 for the U phase.

[0071] Next, based on the pulse signals Pu, Pv, and Pw output from each timer circuit 62, 64, and 66, the DTM 70 generates drive signals P1 to P6 that complementarily turn on and off the switching elements Q1 and Q4, Q2 and Q5, and Q3 and Q6 of each phase, respectively.

[0072] In addition, the DTM 70 delays the rising edges of the drive signals P1 to P6 output to each of the switching elements Q1 to Q6 by a predetermined dead time so that the switching elements Q1 and Q4, Q2 and Q5, and Q3 and Q6 are not turned on simultaneously.

[0073] That is, as shown in FIG. 4, DTM 70 delays the rising edges of pulse signals Pu, Pv, Pw input from timer circuits 62, 64, 66 by a predetermined dead time to generate drive signals P1 to P3 for switching elements Q1 to Q3, which are upper arm switches.

[0074] Drive signals P4 to P6 for switching elements Q4 to Q6, which are lower arm switches, are generated by inverting pulse signals Pu, Pv, and Pw input from timer circuits 62, 64, and 66 and delaying the rising edge of each signal by a predetermined dead time.

[0075] As a result, it is possible to prevent the switching elements Q1 and Q4, Q2 and Q5, and Q3 and Q6 for each phase from being turned on at the same time. Next, the sub-core 52 and the angle detection unit 54 are provided to output pulse signals Pu, Pv, and Pw from the timer circuits 62, 64, and 66 at the pulse output angles of the respective phases output from the 15° task 48.

[0076] In other words, ATOM 60 generates pulse signals Pu, Pv, Pw by detecting on / off timing using a timer counter 68 for timing, and cannot generate pulse signals Pu, Pv, Pw according to the rotation angle of motor 10.

[0077] Therefore, in this embodiment, the angle detection unit 54 monitors the rotation angle of the motor 10 based on the detection signal from the rotation sensor 12. Then, when the rotation angle of the motor 10 monitored by the angle detection unit 54 becomes constant with the pulse output angle of each phase, the sub-core 52 generates pulse signals Pu, Pv, and Pw from the corresponding timer circuits 62, 64, and 66.

[0078] Specifically, when the rotation angle of the motor 10 matches the pulse output angle of each phase, the sub-core 52 sets a predetermined value in the compare register CM0 or CM1 of each phase, thereby immediately outputting pulse signals Pu, Pv, and Pw from the corresponding timer circuits 62, 64, and 66.

[0079] Furthermore, in order to properly perform angle synchronization control, the sub-core 52 starts angle synchronization control when the rotation angle of the motor 10 is an electrical angle of 0°, 60°, 120°, 180°, 240°, or 300°. Note that the sub-core 52 executes angle synchronization control in accordance with the pulse pattern calculated in the 15° task 48, and thus corresponds to the angle synchronization control unit of the present disclosure.

[0080] On the other hand, the peak-valley task 46 is configured to perform PWM control by writing on / off timing for PWM control to shadow registers SR0 and SR1 provided in timer circuits 62, 64, and 66 of each phase of the ATOM 60. The shadow registers SR0 and SR1 correspond to the data register of the present disclosure.

[0081] In ATOM 60, the on / off timing written to the shadow registers SR0 and SR1 of each phase by the peak / valley task 46 is written to the compare registers CM0 and CM1 at regular intervals equal to the execution period of the peak / valley task 46.

[0082] Therefore, when the control mode is the PWM mode, the ATOM 60 outputs the pulse signals Pu, Pv, and Pw at the on / off timings written by the peak / valley task 46 to the shadow registers SR0 and SR1.

[0083] Incidentally, the compare registers CM0 and CM1 are updated a predetermined time after the on / off timing is written to the shadow registers SR0 and SR1. Therefore, when the control mode is switched, the pulse signals Pu, Pv, and Pw output from the ATOM60 become signals for other control before the control mode is switched, which may cause mutual interference between the PWM control and the angle synchronization control.

[0084] When mutual interference occurs between PWM control and angle synchronous control in this way, the control of the motor 10 becomes unstable, causing an overcurrent to flow through the motor 10, resulting in large torque fluctuations in the motor 10. Therefore, in this embodiment, the peak / valley task 46 and the sub-core 52 operate so as to prevent mutual interference between the PWM control and the angle synchronous control.

[0085] 5, when the control mode set by the control mode setting unit 44 changes from the PWM mode to the angle synchronization mode, the peak / valley task 46 determines that an angle synchronization request has been input at time t1, and outputs a command to switch to the angle synchronization mode to the sub-core 52. This command to switch to the angle synchronization mode corresponds to the first switching command of the present disclosure.

[0086] Then, at time t2 when the rotation angle of the motor 10 reaches a rotation angle at which the start of angle synchronous control is permitted, for example, 60°, the sub-core 52 switches its operation mode from the PWM mode to the angle synchronous mode and starts the angle synchronous control. The operation mode of the sub-core 52 corresponds to the first operation mode of the present disclosure.

[0087] On the other hand, for example, when the control mode set by the control mode setting unit 44 changes from the angle synchronization mode to the PWM mode at time t3, the 15° task 48 determines that a PWM request has been input at time t3. Also, the peak / valley task 46 determines that a PWM request has been input at time t4.

[0088] Then, the peak / valley task 46 outputs an angle synchronization control stop command to the sub-core 52 so that the sub-core 52 stops the angle synchronization control immediately before, for example, 1 μs before, the next start timing so that the PWM control can be started at time t5, which is the next start timing after a certain time. This stop command corresponds to the second switching command of the present disclosure.

[0089] Then, the sub-core 52 switches its operation mode to the PWM mode and stops the angle synchronization control. Therefore, the sub-core 52 stops the angle synchronization control a predetermined time Δt before the time point t5, which is the next start timing of the PWM control, and the peak / valley task 46 becomes able to start the PWM control at the time point t5.

[0090] Therefore, according to the present embodiment, the PWM control by the peak / valley task 46 and the angle synchronization control by the sub-core 52 can be prevented from being executed simultaneously, and each of these controls can be executed appropriately.

[0091] Moreover, the mountain-valley task 46 uses a DMA timer 69 provided in the ATOM 60 to output a stop command as a second switching command to the sub-core 52. DMA is an abbreviation for Direct Memory Access.

[0092] That is, the DMA timer 69 includes compare registers CM0 and CM1, similar to each of the timer circuits 62 to 66. The peak / valley task 46 sets, for example, time "t5-1 μs" in the compare register CM0 of the DMA timer 69 as the timing to start outputting the DMA trigger. The peak / valley task 46 also sets, for example, time t5 in the compare register CM1 of the DMA timer 69 as the timing to stop outputting the DMA trigger.

[0093] As a result, immediately before the next start timing of PWM control, DMA timer 69 outputs a DMA trigger to DMA controller (hereinafter, DMAC) 34 of memory 32. Then, upon receiving the DMA trigger, DMAC 34 causes sub-core 52 to DMA transfer the stop command stored in a predetermined area of ​​memory 32.

[0094] Therefore, the CPU 40 can input a stop command to the sub-core 52 at a desired timing without having the 15° task 48 monitor the timing of outputting the stop command, thereby reducing the processing load.

[0095] Furthermore, the control stop period from when a stop command is output to sub-core 52 until PWM control by peak / valley task 46 starts can be set arbitrarily by adjusting the setting timing of compare registers CM0 and CM1 of DMA timer 69. Therefore, the control stop period can be appropriately adjusted when designing control device 30 so that overcurrent or large torque fluctuations do not occur due to the stop of control.

[0096] 6, when the peak-valley task 46 receives an angle synchronization request from the control mode setting unit 44 at time t01 and outputs a switching command to the sub-core 52, the peak-valley task 46 continues PWM control until the operation mode of the sub-core 52 is switched to the angle synchronization mode. In other words, the peak-valley task 46 continues writing ON timing to the shadow registers SR0 and SR1 of the timer circuits 62, 64, and 66 of the ATOM 60 for each phase.

[0097] As a result, when the control mode set by the control mode setting unit 44 changes from the PWM mode to the angle synchronization mode, the control of the motor 10 can be prevented from being stopped until the sub-core 52 starts the angle synchronization control.

[0098] On the other hand, when the sub-core 52 switches its own operation mode from the PWM mode to the angle synchronization mode in response to a switching command from the peak / valley task 46 (time t02), it writes specified values ​​to the shadow registers SR0 and SR1 of the timer circuits 62, 64 and 66 of the respective phases.

[0099] This specified value is a value that does not match the value of the timer counter 68, in other words, a value that is not compared, and for example, the maximum value "FFFFFFF" is used. Then, when the sub-core 52 switches its own operation mode to the angle synchronization mode and writes the specified value to the shadow registers SR0 and SR1 of each phase, it starts outputting to the compare registers CM0 and CM1 of each phase under angle synchronization control.

[0100] This makes it possible to prevent on / off timing for PWM control from being written to the compare registers CM0 and CM1 until the sub-core 52 causes ATOM 60 to output a pulse signal corresponding to the pulse output angle calculated in the 15° task 48.

[0101] In other words, when sub-core 52 starts angle synchronization control, if on / off timing for PWM control remains in shadow registers SR0 and SR1, a pulse signal may be output from ATOM 60 before sub-core 52 causes ATOM 60 to output a pulse signal.

[0102] Therefore, before starting the angle synchronization control, the sub-core 52 writes a specified value to the shadow registers SR0 and SR1 of each phase, thereby suppressing the output of a pulse signal not for angle synchronization control from the ATOM 60. Therefore, according to this embodiment, the operation of the sub-core 52 can also suppress the occurrence of mutual interference between the PWM control and the angle synchronization control when switching the control mode.

[0103] At the start of angle synchronization control, the sub-core 52 writes specified values ​​to the shadow registers SR0 and SR1 of each phase, thereby delaying the start of angle synchronization control. However, since the delay time is extremely short, motor control does not become unstable.

[0104] As described above, when writing to each register SR0, SR1, CM0, and CM1, the order in which the shadow registers SR0 and SR1 are written or the order in which the compare registers CM0 and CM1 are written may be changed depending on the edge direction of the pulse at the start of angle synchronization control.

[0105] Furthermore, if a delay in starting angle synchronization control can be tolerated, the sub-core 52 may further redundantly write a specified value (FFFFFF) to the compare registers CM0 and CM1 before outputting a rising edge or falling edge command.

[0106] In addition, even if the operating mode of sub-core 52 switches from PWM mode to angle synchronization mode at a predetermined rotation angle position every 60° and sub-core 52 writes a specified value to shadow registers SR0 and SR1 of each phase, the specified value may be rewritten.

[0107] That is, as shown in FIG. 7, at time t02 when the operating mode of the sub-core 52 is switched to the angle synchronization mode, the peak-valley task 46 may be in the middle of writing to the shadow registers SR0 and SR1 of each phase due to the PWM control that started at time t01.

[0108] In this case, even if the sub-core 52 writes specified values ​​to the shadow registers SR0 and SR1 of each phase at the start of angle synchronization control, the on / off timing for PWM control by the peak / valley task 46 is written to some of the shadow registers SR0 and SR1.

[0109] Therefore, the peak-valley task 46 checks whether the operation mode of the sub-core 52 has changed from the PWM mode to the angle synchronization mode after writing the on / off timing for PWM control to the shadow registers SR0 and SR1 of each phase by PWM control (time t12). If the operation mode of the sub-core 52 has changed from the PWM mode to the angle synchronization mode, the peak-valley task 46 performs an SR reset process by writing a specified value to the shadow registers SR0 and SR1 of each phase.

[0110] Therefore, according to the present embodiment, the SR resetting process by the peak / valley task 46 can more effectively prevent the occurrence of interference between the PWM control and the angle synchronous control when the control mode is switched.

[0111] [Control process] Next, the control processing executed in the CPU 40 to realize the functions of the peak / valley task 46 and the 15° task 48 described above, and the control processing executed in the sub-core 52 will be described.

[0112] As shown in FIG. 8, the function of the 15° task 48 is realized by the following steps: first, in S110, pre-processing for angle synchronization control is performed; in S120, control mode arbitration processing is performed; and in S130, pulse output angle calculation processing for angle synchronization control is performed.

[0113] In the angle synchronization control pre-processing in S110, as described above, the number of pulses to be output per one rotation of the motor is calculated based on the rotational angular velocity of the motor, and a pulse pattern is selected based on the number of pulses and the amplitude command value Vn calculated by the torque control unit 42.

[0114] In the control mode arbitration process of S120, from when the angle synchronization mode is set by the control mode setting unit 44 until the sub-core 52 stops the angle synchronization control, its own operation mode is set to the angle synchronization mode, and for the rest of the period, its own operation mode is set to the PWM mode.

[0115] In the pulse output angle calculation process of S130, when the operation mode of the motor 10 is the angle synchronization mode, the next pulse output angle is determined according to the pulse pattern of each phase selected in the angle synchronization control pre-processing, and output to the sub-core 52. Note that the processes of S110 and S130 are performed for each phase of the motor 10.

[0116] Next, as shown in FIG. 9, the sub-core 52 repeatedly executes a control mode confirmation process in S210 and a process of issuing an output timing command for a pulse for angle synchronization control in S220. In the control mode confirmation process of S210, the input of an operation mode switching command or a stop command from the peak / valley task 46 is confirmed.

[0117] When the sub-core 52 receives an operation mode switching command from the peak / valley task 46 while its own operation mode is the PWM mode, it switches its own operation mode to the angle synchronous mode at the next rotation angle position of every 60°.

[0118] Furthermore, when the sub-core 52 receives a stop command from the peak / valley task 46 while its own operation mode is the angle synchronization mode, it immediately switches its own operation mode to the PWM mode. Next, in the process of issuing a pulse output timing command for angle synchronization control in S220, when the operation mode of the control unit itself is the angle synchronization mode, the current rotation angle of the motor 10 is obtained from the angle detection unit .

[0119] Then, when the acquired rotation angle matches the pulse output angle input from the 15° task 48, a count value of 1 is set in the compare register CM0 or CM1 of the phase corresponding to the matched pulse output angle, thereby outputting a pulse signal, and the process proceeds to S210.

[0120] Specifically, when the pulse signal of the corresponding phase is to be raised, the compare register CM0 is set to a value of 1, and the compare register CM1 is set to a value that is not to be compared (e.g., FFFFFFF). When the pulse signal of the corresponding phase is to be lowered, the compare register CM1 is set to a value of 1, and the compare register CM0 is set to a value that is not to be compared. As a result, a signal indicating the rise or fall of the pulse signal is output from the compare register CM0 or CM1 in which the value of 1 is set, and the pulse signals Pu, Pv, and Pw of each phase are output from ATOM60.

[0121] Also, in S220, if the rotation angle obtained from the angle detection unit 54 does not match the pulse output angle input from the 15° task 48, the process proceeds to S210 without changing the outputs of the pulse signals Pu, Pv, and Pw from the ATOM 60.

[0122] Next, in the CPU 40, the function of the peak / valley task 46 is realized by executing a control process according to the procedure shown in FIG. 10 at each upper and lower peak timing of the triangular wave, which is the carrier signal for PWM control, that is, at each fixed time interval.

[0123] As shown in FIG. 10, in the control process of the peak / valley task 46, first, in S300, a duty value calculation process is executed to calculate the on / off timing of the switching elements Q1 to Q6 of each phase by PWM control.

[0124] That is, in the duty value calculation process of S300, the peak / valley task 46 first calculates U-, V-, and W-phase command voltages VU, VV, and VW based on the duty amplitude command value Vn and the phase command value φ.Then, the peak / valley task 46 calculates U-, V-, and W-phase command time ratios DTu, DTv, and DTw by normalizing the calculated U-, V-, and W-phase command voltages VU, VV, and VW with the power supply voltage Vin.

[0125] In addition, in the duty calculation process, the calculated command time ratios DTu, DTv, and DTw for each phase are compared with a triangular wave to calculate the on / off timing of the switching element for each phase as a duty value.

[0126] Next, in S400, a control mode arbitration process is executed in the procedure shown in Fig. 11. This control mode arbitration process determines whether or not to switch the operation mode of the sub-core 52 to the angle synchronization mode, based on the control mode set by the control mode setting unit 44.

[0127] That is, in the control mode arbitration process, first in S410, control requests for PWM control and angle synchronization control are obtained from the control mode setting unit 44. Then, in the following S420, based on the control request obtained in S410, it is confirmed whether the PWM request is in the OFF state and the angle synchronization request is in the ON state, that is, whether the control request from the control mode setting unit 44 is a control request for angle synchronization control and not a control request for PWM control.

[0128] If it is determined in S420 that the PWM request is in the OFF state and the angle synchronization request is in the ON state, the process proceeds to S430, where the control mode requested by the control mode setting unit 44 is set to the angle synchronization mode, and the process proceeds to S440.

[0129] In S440, since the control mode is the angle synchronization mode, a switching command is output to the sub-core 52 to set the operation mode of the sub-core 52 to the angle synchronization mode, and the control mode arbitration process ends.

[0130] In addition, by outputting the switching command in S440, the operation mode of the sub-core 52 is switched from the PWM mode to the angle synchronization mode at the next rotation angle position every 60°. On the other hand, if it is determined in S420 that the PWM request is in the OFF state and the angle synchronization request is not in the ON state, the process proceeds to S450, where it is determined whether the PWM request is in the ON state and the angle synchronization request is in the OFF state.

[0131] Then, if the PWM request is in the ON state and the angle synchronization request is in the OFF state, the process proceeds to S460, where the control mode requested by the control mode setting unit 44 is set to be the PWM mode, and the control mode arbitration process is terminated.

[0132] Also, if it is determined in S450 that both the PWM request and the angle synchronization request are in the on or off state, the control request from the control mode setting unit 44 is abnormal, so the control mode arbitration process is terminated without setting the control mode.

[0133] Next, in the peak / valley task 46, when the control mode arbitration process of S400 is completed, the process proceeds to S500, where an operation mode acquisition process is executed according to the procedure shown in FIG. The operation mode acquisition process is executed in S800 not only at the start of operation of the peak / valley task 46 at a fixed time interval, but also at the end of the operation. For this reason, in the following description, the process of S500 is also referred to as the start-time operation mode acquisition process, and the process of S800 is also referred to as the end-time operation mode acquisition process.

[0134] As shown in FIG. 12, in the operation mode acquisition process, first in S510, the control mode set in S430 or S460 of the control mode arbitration process is read, and the operation mode of the sub-core 52 itself is read from the sub-core 52.

[0135] The operation mode of the sub-core 52 itself acquired from the sub-core 52 in S510 corresponds to the first operation mode of the present disclosure, and the operation mode of the peak / valley task 46 itself set in the following process corresponds to the second operation mode of the present disclosure.

[0136] Next, in S520, it is determined whether or not at least one of the control mode acquired in S510 and the operation mode of the sub-core 52 is the PWM mode. Then, in S520, if it is determined that at least one of the control mode acquired in S510 and the operating mode of the sub-core 52 is PWM mode, the process proceeds to S530, in which the operating mode of the peak-valley task 46 itself is set to PWM mode, and the operating mode acquisition process is terminated.

[0137] Also, if it is determined in S520 that both the control mode acquired in S510 and the operation mode of the sub-core 52 are angle synchronization mode, the process proceeds to S540, in which the operation mode of the peak-valley task 46 itself is set to the angle synchronization mode, and the operation mode acquisition process is terminated.

[0138] In this manner, in the peak / valley task 46, when the start operation mode acquisition process is executed in S500, the PWM duty setting process for the U phase, V phase, and W phase is executed in sequence in the following S600, S602, and S604.

[0139] In the U-phase PWM duty setting process, as shown in FIG. 13, first in S610, it is determined whether the operation mode of the peak / valley task 46 itself, which was set in the start-up operation mode acquisition process of S500, i.e., the start-up operation mode, is PWM mode.

[0140] If it is determined in S610 that the initial operating mode is the PWM mode, the process proceeds to S620, where the on / off timings of the U phase calculated in S300 are written to the shadow registers SR0, SR1 of the U phase timer circuit 62 in order to execute PWM control, and the process proceeds to S630.

[0141] On the other hand, if it is determined in S610 that the initial operating mode is not the PWM mode, the process proceeds to S630 without executing the process of S620. Then, in S630, the on / off timing of the U phase calculated in S300 is stored in a predetermined storage area of ​​the memory 32 as the on / off timing for resetting, and the PWM duty setting process is terminated.

[0142] The V-phase PWM duty setting process executed in S602 and the W-phase PWM duty setting process executed in S604 are executed in the same procedure as the U-phase PWM duty setting process shown in FIG. 13, and therefore description thereof will be omitted.

[0143] Next, in the peak / valley task 46, when the PWM duty setting process of S600 to S604 is executed, the process proceeds to S700, where the DMA timer setting process is executed. 14, in the DMA timer setting process, first, in step 710, the start-time control mode of the peak / valley task 46 itself set in step S500 is read. Then, in step S720, it is determined whether the start-time operation mode read in step S710 is the PWM mode and whether the operation mode of the sub-core 52 is the angle synchronization mode.

[0144] When the initial operation mode is the PWM mode and the operation mode of the sub-core 52 is the angle synchronous mode, it is necessary to stop the angle synchronous control by the sub-core 52 and start the PWM control by the peak / valley task 46 .

[0145] Therefore, when it is determined in S720 that the start operation mode is the PWM mode and that the operation mode of the sub-core 52 is the angle synchronization mode, the process proceeds to S730. In S730, the DMA timer 69 is set so that a stop command is output immediately before the peak / valley task 46 starts the next control process.

[0146] As a result, immediately before the peak / valley task 46 starts the control process next time, a DMA trigger is output from the DMA timer 69, and the DMAC 34 causes the stop command stored in a predetermined area of ​​the memory 32 to be DMA transferred to the sub-core 52. Therefore, the sub-core 52 receives the stop command as the second switching command and stops the execution of the angle synchronization control, and the peak / valley task 46 can perform the PWM control by executing the next control process.

[0147] In this way, when the DMA timer setting process is executed in S700 in the peak / valley task 46, the process proceeds to S800 to execute the end operation mode acquisition process. This end operation mode acquisition process is executed in the same manner as the start operation mode acquisition process of S500, as shown in FIG.

[0148] When the termination operation mode acquisition process is executed in S800, the peak / valley task 46 finally executes the SR reset process in S900 and executes the control process. The SR reset process is a process that enables PWM control or angle synchronization control to be properly performed the next time in accordance with the changed operation mode when the end operation mode set in the end operation mode acquisition process has changed from the start operation mode.

[0149] 15, in the SR reset process, first, in S910, it is determined whether the start operation mode is the angle synchronization mode and the end operation mode is the PWM mode. Then, if it is determined in S910 that the start operation mode is the angle synchronization mode and the end operation mode is the PWM mode, the process proceeds to S920.

[0150] In S920, when the PWM duty setting process for each phase is executed, the on / off timing for PWM control stored in the memory 32 in the process of S630 illustrated in FIG. 13 is read and written to the shadow registers SR0 and SR1 for each phase.

[0151] Then, in the next S930, in the same procedure as in the process of S730 in FIG. 14, the DMA timer 69 is set so that a stop command is output immediately before the peak / valley task 46 starts its operation, and the SR reset process is terminated.

[0152] As a result, when the operation mode is changed from the angle synchronization mode to the PWM mode while the peak / valley task 46 is running, the operation mode of the sub-core 52 can be switched to the PWM mode immediately before the peak / valley task 46 is started next time.

[0153] Furthermore, when the peak-valley task 46 next starts the control process, the on / off timing for PWM control has been written in advance to the shadow registers SR0 and SR1 for each phase by the process of S920, so that the PWM control can be started properly.

[0154] Next, if it is determined in S910 that the start operation mode is not the angle synchronization mode or the end operation mode is not the PWM mode, the process proceeds to S940. In S940, it is determined whether the start operation mode is the PWM mode, the sub-core operation mode is the angle synchronization mode, and the end operation mode is the angle synchronization mode.

[0155] If it is determined in S940 that the start operation mode is PWM mode, the sub-core operation mode is angle synchronization mode, and the end operation mode is angle synchronization mode, the process proceeds to S950, and if this is not the case in S940, the SR reconfiguration process is terminated.

[0156] In S950, the above-mentioned specified values ​​are written to the shadow registers SR0 and SR1 of each phase. Then, in the following S960, the DMA timer 69 is cleared to prohibit the operation of the DMAC 34 from outputting a stop command, and the SR reset process is terminated.

[0157] Therefore, when the initial operating mode is PWM mode, if the operating mode of the sub-core 52 is angle synchronization mode and the operating mode of the peak-valley task 46 changes to the angle synchronization mode, angle synchronization control by the sub-core 52 can be started promptly.

[0158] Furthermore, when the sub-core 52 starts the angle synchronization control in this manner, the shadow registers SR0 and SR1 of each phase are written with specified values ​​in S950, so that the compare registers CM0 and CM1 of each phase are prevented from being rewritten for PWM control. Therefore, the angle synchronization control by the sub-core 52 can be properly performed.

[0159] [effect] As described above, in the control device 30 of this embodiment, the peak / valley task 46 switches the operation mode of the sub-core 52, and the sub-core 52 writes a specified value to the shadow registers SR0 and SR1 of each phase when starting angle synchronization control by switching the operation mode. Therefore, according to the control device 30 of this embodiment, it is possible to suppress mutual interference between the angle synchronization control and the PWM control.

[0160] In addition, when the operation mode at the end of control has changed from the operation mode at the start of control, the peak / valley task 46 resets the on / off timing or the specified value for PWM control in the shadow registers SR0 and SR1 of each phase in an SR reset process.

[0161] Therefore, the peak / valley task 46 or the sub-core 52 can quickly start PWM control or angle synchronization control depending on the operating mode at the time the control of the peak / valley task 46 ends, and can also prevent each control from interfering with each other when the control starts.

[0162] Therefore, according to the control device 30 of this embodiment, not only can angle synchronization control and PWM control be selectively performed using one timer circuit provided in a general microcomputer, but also it can prevent the motor control from becoming unstable due to interference between these controls.

[0163] In particular, since the control device 30 of this embodiment controls the motor 10, which is the main engine of the vehicle, it is possible to suppress overcurrent and torque fluctuations flowing through the motor, thereby achieving safe vehicle driving, and also to reduce the cost of the control device 30.

[0164] [Other embodiments] Although the embodiments of the present disclosure have been described above, the present disclosure is not limited to the above-described embodiments and can be implemented in various modified forms.

[0165] For example, in the above embodiment, the control method is described as being switchable between four stages as shown in FIG. 3, however, this switching of the control method is only one example, and the technology disclosed herein can be applied to any control device that switches the control method between PWM control and angle synchronous control.

[0166] In the above embodiment, the functions of the control device 30 are described as being realized by control processes, in other words, execution of programs, executed by the CPU 40 or the sub-core 52. However, some of the functions of the control device 30 may be realized by hardware logic circuits.

[0167] A plurality of functions possessed by one component in the above embodiments may be realized by a plurality of components, or a single function possessed by one component may be realized by a plurality of components. A plurality of functions possessed by a plurality of components may be realized by a single component, or a single function realized by a plurality of components may be realized by a single component. A part of the configuration of the above embodiments may be omitted. At least a part of the configuration of the above embodiments may be added to or substituted for the configuration of another of the above embodiments.

[0168] In addition, the present disclosure can be realized in various forms, such as a motor control device, a control system, a program for causing a computer to function as a motor control device, a non-transient physical recording medium such as a semiconductor memory on which this program is recorded, and a motor control method. [Explanation of symbols]

[0169] 10...motor, 20...inverter, 30...control device, 32...memory, 34...DMAC, 40...CPU, 44...control mode setting unit, 46...peak / valley task, 48...15° task, 52...sub-core, 60...ATOM, 62-66...timer circuit, 68...timer counter, 69...DMA timer, CM0, CM1...compare register, SR0, SR1...shadow register.

Claims

1. A motor control device that drives a motor by operating an inverter having a plurality of switching elements that connect a positive electrode and a negative electrode of a DC power supply to a plurality of terminals of the motor, a timer circuit (60) including a plurality of compare registers (CM0, CM1) for storing the on / off timing of each pair of positive and negative switching elements connected to the plurality of terminals of the motor in the inverter, and including a counter for measuring time, the timer circuit being configured to output a signal representing the on / off timing of each switching element when a value of each compare register matches a value of the counter; a control mode setting unit (44) configured to set a control mode of the motor to either a PWM mode in which the switching elements are turned on and off at a predetermined timing every fixed time, or an angle synchronous mode in which the switching elements are turned on and off in accordance with a rotation angle of the motor, based on a command torque input from an external device; a PWM control unit (46) configured to execute PWM control at regular intervals when the control mode set by the control mode setting unit is the PWM mode, the PWM control calculating on / off timings to be set in the compare registers in order to drive the motor with the command torque and outputting the calculated on / off timings to the timer circuit; an angle calculation unit (48) configured to calculate, for each predetermined rotation angle of the motor, on / off timings of the switching elements for driving the motor with the command torque as a rotation angle of the motor; an angle synchronization control unit (52) configured to execute angle synchronization control for writing the on / off timing to each of the compare registers so that each of the switching elements is turned on / off at the rotation angle calculated by the angle calculation unit; Equipped with the timer circuit includes a plurality of data registers (SR0, SR1) in which a plurality of on / off timings output from the PWM control unit to each of the compare registers are stored, and the timer circuit is configured to write the on / off timings stored in the plurality of data registers to each of the compare registers at regular intervals; the angle synchronization control unit is configured to, when a first operation mode, which is the operation mode of the angle synchronization control unit itself, is the PWM mode, switch the first operation mode to the angle synchronization mode and start the angle synchronization control when the motor next reaches a predetermined rotation angle position upon receiving a first switching command, and when the first operation mode is the angle synchronization mode, switch the first operation mode to the PWM mode and stop the angle synchronization control upon receiving a second switching command (S210); The PWM control unit is When the control mode acquired from the control mode setting unit is the angle synchronization mode, the first switching command is output to the angle synchronization control unit, and the PWM control is continued until the first operation mode of the angle synchronization control unit is switched from the PWM mode to the angle synchronization mode (S400, S500, S600-S604); When the control mode acquired from the control mode setting unit is the PWM mode and the first operation mode of the angle synchronization control unit is the angle synchronization mode, the second switching command is output to the angle synchronization control unit immediately before starting the next PWM control after the certain time period, and the first operation mode of the angle synchronization control unit is switched to the PWM mode (S700). It is configured as follows: the angle synchronization control unit is configured to, when setting the first operating mode to the angle synchronization mode in accordance with the first switching command output from the PWM control unit, write a specified value, which does not coincide with the counter value, to the data register of the timer circuit, and then start the angle synchronization control (S220).

2. 2. The motor control device according to claim 1, The PWM control unit is At the start and end of operation at each fixed time, the control mode is acquired from the control mode setting unit and compared with the first operation mode of the angle synchronization control unit, and when the control mode and the first operation mode are both the angle synchronization mode, a second operation mode which is the operation mode of the control unit itself is set to the angle synchronization mode, and when at least one of the control mode and the first operation mode is the PWM mode, the second operation mode is set to the PWM mode (S500); The on / off timings written in the data registers of the timer circuit in the PWM control are stored as reset data (S600-S604), When the second operation mode set at the start of the operation is the angle synchronization mode and the second operation mode set at the end of the operation is the PWM mode, the resetting data is written to each of the data registers, and the second switching command is output to the angle synchronization control unit immediately before starting the operation after the certain time period (S700). When the second operation mode set at the start of the operation is the PWM mode, the first operation mode of the angle synchronization control unit is the angle synchronization mode, and the second operation mode set at the end of the operation is the angle synchronization mode, the specified value is written to the data register of the timer circuit (S900). The motor control device is configured as follows.

3. 3. The motor control device according to claim 1, The motor control device is configured such that the PWM control unit sets the timing for outputting the second switching command to the angle synchronization control unit in the timer circuit (69) and causes the timer circuit to output the second switching command to the angle synchronization control unit at the set timing.

4. The motor control device according to any one of claims 1 to 3, The motor control device is configured with a microcomputer including the timer circuit, and the angle synchronization control unit is configured with a CPU core different from a CPU core that functions as the PWM control unit.

Citation Information

Patent Citations

  • Pulse modulation controller for motor

    JP1986001296A

  • Controller for pulse width modulation system inverter

    JP1988287372A

  • Controller of inverter

    JP2017093029A