RL78/G1G Sensorless Speed control of 120-degree conducting controlled permanent magnetic synchronous motor (Implementation)
R01AN3582EJ0100 Rev.1.00
Page 36 of 46
Jan 13, 2017
Table 3-25
List of Macro definitions “mtr_ctrl_rl78g1g.h”
File name
Macro name
Definition value
Remarks
mtr_ctrl_rl78g1g.h
MTR_OC_USE_INTP
1
Select the external circuit to detect overcurrent
(default)
MTR_OC_USE_PGACMP
0
Select PGA+CMP0, CMP1 to detect overcurrent
MTR_OC_DETECT_CMP0
83
Comparator internal reference voltage to detect
overcurrent (CMP0)
MTR_OC_DETECT_CMP1
120
Comparator internal reference voltage to detect
overcurrent (CMP1)
Table 3-26
List of Macro definitions “mtr_ctrl_rl78g1g_mrssk.h” [1/2]
File name
Macro name
Definition value
Remarks
mtr_ctrl_rl78g1g_
mrssk.h
MTR_PWM_TIMER_FREQ
48.0f
PWM timer count frequency [MHz]
MTR_CARRIER_FREQ
20.0f
Carrier frequency [kHz]
MTR_DEADTIME
2000
Dead time [ns]
MTR_DEADTIME_SET
(int16)(MTR_DEADTIME *
MTR_PWM_TIMER_FREQ / 1000)
Dead time setting value
MTR_CARRIER_SET
(MTR_PWM_TIMER_FREQ * 1000
/ MTR_CARRIER_FREQ / 2) +
MTR_DEADTIME_SET - 2
Carrier setting value
MTR_HALF_CARRIER_SET
MTR_CARRIER_SET / 2
Half of
“MTR_CARRIER_SET”
MTR_NDT_CARRIER_SET
MTR_CARRIER_SET -
MTR_DEADTIME_SET
MTR_PORT_UP
CA
P1.5
CC
-RL
P1_bit.no5
U phase (positive phase) output port
MTR_PORT_UN
P1.4
P1_bit.no4
U phase (negative phase) output port
MTR_PORT_VP
P1.3
P1_bit.no3
V phase (positive phase) output port
MTR_PORT_VN
P1.1
P1_bit.no1
V phase (negative phase) output port
MTR_PORT_WP
P1.2
P1_bit.no2
W phase (positive phase) output port
MTR_PORT_WN
P1.0
P1_bit.no0
W phase (negative phase) output port
MTR_PORT_SW1
P0.5
P0_bit.no5
SW1 input port
MTR_PORT_SW2
P0.6
P0_bit.no6
SW2 input port
MTR_PORT_LED1
P14.1
P14_bit.no1
LED1 output port
MTR_PORT_LED2
P14.0
P14_bit.no0
LED2 output port
MTR_LED_ON
0
LED active in case of “Low”
MTR_LED_OFF
1
MTR_INPUT_V
(int16) 24 * 0x80
input DC voltage [V] (scale: Q7)
MTR_MCU_ON_V
(int16) MTR_INPUT_V * 0.8
MCU power on voltage (scale: Q7)
MTR_VDC_SCALING
3555
Calculate parameter for scaling invertor
bus voltage from A/D converted value
(scale: Q7)
MTR_RECIVDC_SCALING
64
Reciprocal value of
MTR_VDC_SCALING (scale: Q7)
MTR_OVERVOLTAGE_LIMIT
(int16) 28 * 0x80
High voltage limit [V]
MTR_UNDERVOLTAGE_LIMIT
(int16) 15 * 0x80
Low voltage limit [V]
MTR_TAU1_CNT
TCR01
Counter register of Free-run timer to
measure rotational speed