RL78/G1G Sensorless Speed control of 120-degree conducting controlled permanent magnetic synchronous motor (Implementation)
R01AN3582EJ0100 Rev.1.00
Page 14 of 46
Jan 13, 2017
3. Descriptions of the control program
The target control programs of this application note are explained here.
3.1
Contents of control
3.1.1 Motor start/stop
Starting and stopping of the motor are controlled by input from SW1 & VR1.
A general-purpose port is assigned to SW1. The port is read within the main loop. When the port is at a “Low” level,
it is determined that the start switch is being pressed. Conversely, when the level is switched to “High”, the program
determines that the motor should be stopped.
Also, an analog input port is assigned to VR1. The input is A/D converted within the main loop to generate a
rotational speed command value. When the command value is less than 1200 [rpm], the program determines that the
motor should be stopped.
3.1.2 A/D Converter
(1) Motor rotational speed command value
The motor rotational speed command value can be set by A/D conversion of the VR1 output value (analog value).
The A/D converted VR1 value is used as rotational speed command value, as shown below.
The maximum of the command value is set as the value from which maximum rotational speed is generated by the
resolution of the A/D converter.
Table 3-1 Conversion Ratio of the Rotational Speed Command Value
Item
Conversion ratio
(Command value: A/D conversion value)
Channel
Rotational speed
command value
CW
0 rpm to 3072 rpm: 0200H to 03FFH
ANI0
(Note)
CCW
-3072 rpm to 0 rpm: 0000H to 01FFH
Note: The input channel is ANI0 because the CPU card which is modified as a VR1 signal is input to port 20.
(2) Inverter bus voltage
Inverter bus voltage is measured as given in Table 3-2. It is used for modulation factor calculation and over/under
voltage detection. (When an abnormality is detected, PWM is stopped).
Table 3-2 Inverter Bus Voltage Conversion Ratio
Item
Conversion ratio
(Inverter bus voltage: A/D conversion value)
Channel
Inverter bus voltage
0 V to 111 V: 0000H to 03FFH
ANI3
(3) U phase, V phase, and W phase voltage
The U, V, and W phase voltages are measured as shown in Table 3-3 and used for determining zero-crossing.
Table 3-3 Conversion Ratio of U, V, and W Phase Voltage
Item
Conversion ratio
(U, V, and W phase voltage: A/D conversion value)
Channel
U, V, W phase voltage
0 V to 111 V: 0000H to 03FFH
ANI17, ANI18, ANI19
For more details of A/D conversion characteristics, refer to RL78/G1G User’s Manual: Hardware.