Description
This block processes the communication and configuration between the RT-LAB CPU-based model and the FPGA-based Electrical Machine model. It supports up to 4 machines, and each of them can be one of the following machine types:
Synchronous Machine with Round Rotor
Synchronous Machine with Salient-pole Rotor
Induction Machine with Squirrel-cage Rotor
Induction Machine with Double Squirrel-cage Rotor
Doubly-fed (Wound Rotor) Induction Machine
Permanent Magnet Synchronous Machine
Brushless DC motors
The Synchronous Machine model is presented
in Synchronous Machine Model page.
The Induction Machine model is presented
in Induction Machine Model page.
The Permanent Magnet Synchronous Machine model is presented
in Permanent Magnet Synchronous Machine Model page.
The Brushless DC Machine Machine model is presented
Block mode:
This parameter is used to select which type of FPGA-based machine model that is available in the firmware. It supports:
Quad generic machine model
mode for simulation of up to 4 Synchronous Machine or Asynchronous machine models.
Dual PMSM Variable DQ
mode for simulation of up to 2 Permanent Magnet Synchronous Machine or Brushless DC motor models.
Once the selection is made, the available model types will be refreshed in each machine tab. This parameter is global to the block. For simulating of a Induction machine and a Permanent magnet machine in the same CPU model, it will be require to use two seperate Generic Machines CPU block, one configured with the generic machine model option and the second configured with the PMSM option.
Number of Machines:
In the General tab, the number of machines (up to 4 for Generic Machine mode, up to 2 for PMSM modes) can be selected.
Solver Time Step [Ts(sec)]:
Time step of the FPGA solver of the Generic Machines in seconds. It is 500ns by default.
Hardware Controller Name (OpCtrl):
FPGA controller name that refers to the motor model bitstream (in OpCtrl or Oplnk block). It is usually 'OpCtrl'.
FPGA Clock Period [Tfpga(sec)]:
The clock period of the FPGA. It is 5ns by default.
CPU Clock Period [Tcpu(sec)]:
The time step of the CPU model. It is 20μs by default.
Communications Settings Automatic Configuration:This will enable the automatic setting of the communications ports. The *.conf file linked to the *.bin file selected in the OpCtrl Controller will be parsed and the communications settings will be set accordingly. If unchecked, the fields become modifiable for manual user settings.
Machine Core:
If Communications Settings Automatic Configuration is enabled, Machine Core allows the selection of which machine defined in the *.conf to use for automatic configuration. To know more about how cores are defined inside a *.conf file, see: Conf File Writing Conventions.
Configuration Port Number: Data In/Load In/Data Out port:
Number of communication ports from/to FPGA to send/receive solver data. Port numbers depend on the bitstream. See the associated bitstream *.conf file to get the right port numbers. These parameters should be updated at every firmware update.
The description keys to look depend on the selected block mode:
For Generic machine mode, the description key used is IM_SM
For PMSM Vdq mode, the description key used if PMSMVDQ
Machine TABs
Depending on the number of machines selected in the General tab, corresponding tabs will appear. Each tab has Configuration, Electrical, Mechanical, Resolver, and Encoder Parameters sections:
Configuration
Machine Type:
In the dropdown list of each tab, the machine and its rotor type can be selected as Synchronous Machine Round Rotor/Salient-pole Rotor or Doubly-fed Induction Machine or Induction Machine with Squirrel-cage when the Generic machine mode is selected in the general tab. In PMSM mode, the machine parameter can be set as "Fixed Ld Lq values" for PMSM with salency simulation or "BLDC" for brushless dc motor emulation with trapezoidal back emf.
Configure Machine Inputs:
This button opens a voltage mapping table for each machine as follows:
Input Name shows the stator and rotor (if applicable) supply voltage names for the selected machine type and rotor type,
Input Source gives the option of selecting between different available eHS sources,
Measurement Index is to assign the eHS indexed measurement to the corresponding machine input.
For different types of machine voltage mapping, refer to the info below:
For Synchronous Machine, the stator voltages and field rotor voltage should be mapped,
For Doubly-fed (Wound Rotor) Induction Machine, the stator voltages and rotor voltages should be mapped,
For Induction Machine with Squirrel-cage Rotor, PMSM or BLDC, the stator voltages should be mapped.
Configure eHS inputs:
This button opens a current mapping table for each machine as follows:
Input Name shows the stator and rotor (if applicable) current names for the selected machine type,
Input Source gives the option of selecting between different machine types, either PMSM or generic machine,
Measurement Index is to assign the eHS current measurement to the corresponding machine.
Same as Machine Inputs, eHS inputs mapping could be different for each type of machine.
For Synchronous Machine, stator currents and field rotor current should be mapped,
For Doubly-fed (Wound Rotor) Induction Machine, stator currents and rotor currents should be mapped,
For Induction Machine with Squirrel-cage Rotor, stator currents should be mapped.
For PMSM or BLDC, stator currents should be mapped. Since the model supports only balanced mode, only 2 currents needs to be injected to the eHS.
For more info about the number of current measurements for each type of machine, refer to the following link: Generic
For measurement index, eight current measurements channels are assigned for each machine, while up to the first six of them could output current values during real-time simulation.
Refer to the following table for the right signal indexes of
the Generic machine
outputs to the eHS, SM represents for Synchronous Machine.
Index | Current Sources | Notes |
1 | Machine #1 Ia Stator Current | |
2 | Machine #1 Ib Stator Current | |
3 | Machine #1 Ic Stator Current | |
4 | Machine #1 Ia Rotor Current | SM #1 Field Rotor Current |
5 | Machine #1 Ib Rotor Current | Not available for SM #1 |
6 | Machine #1 Ic Rotor Current | Not available for SM #1 |
7/8 | Reserved for internal use | |
9 | Machine #2 Ia Stator Current | |
10 | Machine #2 Ib Stator Current | |
11 | Machine #2 Ic Stator Current | |
12 | Machine #2 Ia Rotor Current | SM #2 Field Rotor Current |
13 | Machine #2 Ib Rotor Current | Not available for SM #2 |
14 | Machine #2 Ic Rotor Current | Not available for SM #2 |
15/16 | Reserved for internal use | |
17 | Machine #3 Ia Stator Current | |
18 | Machine #3 Ib Stator Current | |
19 | Machine #3 Ic Stator Current | |
20 | Machine #3 Ia Rotor Current | SM #3 Field Rotor Current |
21 | Machine #3 Ib Rotor Current | Not available for SM #3 |
22 | Machine #3 Ic Rotor Current | Not available for SM #3 |
23/24 | Reserved for internal use | |
25 | Machine #4 Ia Stator Current | |
26 | Machine #4 Ib Stator Current | |
27 | Machine #4 Ic Stator Current | |
28 | Machine #4 Ia Rotor Current | SM #4 Field Rotor Current |
29 | Machine #4 Ib Rotor Current | Not available for SM #4 |
30 | Machine #4 Ic Rotor Current | Not available for SM #4 |
31/32 | Reserved for internal use |
Refer to the following table for the right signal indexes of
the PMSM VDQ
outputs to the eHS.
Index | Current Sources | Notes |
1 | Machine #1 Ia Stator Current | |
2 | Machine #1 Ib Stator Current | |
3 | Machine #2 Ia Stator Current | |
4 | Machine #2 Ia Rotor Current |
Notes: Ic current is not available for coupling eHS with PMSM VDQ model since the model supports balanced mode only.
Electrical Parameters
Synchronous Machine with Round Rotor:
This configuration is used for dynamic modeling of a Round Rotor Synchronous Machine, which models stator, field, and up to three damper windings one on the D-Axis (Kd) and two on the Q-axis (Kq1 and Kq2). All the rotor parameters, including the field and damper windings, are referred to the stator identified by a prime sign. By choosing open-winding option, the model has the option of having neutral point connection for the star-connected stator winding. The mask and electrical parameters of a Round Rotor Synchronous Machine are presented as follows:
Symbol | Name | Description | Unit |
Rs | Stator resistance | Per-phase stator winding resistance | Ω |
Lls | Stator leakage inductance | Per-phase stator winding leakage inductance | H |
Lmd | D-axis magnetizing inductance | Magnetizing inductance in direct-axis direction | H |
Lmq | Q-axis magnetizing inductance | Magnetizing inductance in quadrature-axis direction | H |
Rfd' | Field resistance | Direct-axis field winding resistance, referred to the stator | Ω |
Llfd' | Stator leakage inductance | Direct-axis field winding leakage inductance, referred to the stator | H |
Rkd' | D-axis damper resistance | Direct-axis damper winding resistance, referred to the stator | Ω |
Llkd' | D-axis damper leakage inductance | Direct-axis damper winding leakage inductance, referred to the stator | H |
Rkq1' | 1st q-axis damper resistance | 1st quadrature-axis damper winding resistance, referred to the stator | Ω |
Llkq1' | 1st q-axis damper leakage inductance | 1st quadrature-axis damper winding leakage inductance, referred to the stator | H |
Rkq2' | 2nd q-axis damper resistance | 2nd quadrature-axis damper winding resistance, referred to the stator | Ω |
Llkq2' | 2nd q-axis damper leakage inductance | 2nd quadrature-axis damper winding leakage inductance, referred to the stator | H |
Nsf | Stator to field turn ratio | This turn ratio is used when the voltage ratio between the stator and the field is not unitary | - |
R0 | Zero-sequence resistance | Zero-sequence stator winding resistance | Ω |
L0 | Zero-sequence inductance | Zero-sequence stator winding leakage inductance | H |
Synchronous Machine with Salient-pole Rotor:
This configuration is used for dynamic modeling of a Salient-pole Rotor Synchronous Machine, which models stator, field, and up to two damper windings one on the D-Axis (Kd) and one on the Q-axis (Kq1). All the rotor parameters, including the field and damper windings, are reffered to the stator identified by a prime sign. By choosing open-winding option, the model has the option of having neutral point connection for the star-connected stator winding. The mask and electrical parameters of a Salient-pole Rotor Synchronous Machine are presented as follows:
Symbol | Name | Description | Unit |
Rs | Stator resistance | Per-phase stator winding resistance | Ω |
Lls | Stator leakage inductance | Per-phase stator winding leakage inductance | H |
Lmd | D-axis magnetizing inductance | Magnetizing inductance in direct-axis direction | H |
Lmq | Q-axis magnetizing inductance | Magnetizing inductance in quadrature-axis direction | H |
Rfd' | Field resistance | Direct-axis field winding resistance, referred to the stator | Ω |
Llfd' | Stator leakage inductance | Direct-axis field winding leakage inductance, referred to the stator | H |
Rkd' | D-axis damper resistance | Direct-axis damper winding resistance, referred to the stator | Ω |
Llkd' | D-axis damper leakage inductance | Direct-axis damper winding leakage inductance, referred to the stator | H |
Rkq1' | 1st q-axis damper resistance | 1st quadrature-axis damper winding resistance, referred to the stator | Ω |
Llkq1' | 1st q-axis damper leakage inductance | 1st quadrature-axis damper winding leakage inductance, referred to the stator | H |
Nsf | Stator to field turn ratio | This turn ratio is used when the voltage ratio between the stator and the field is not unitary | - |
R0 | Zero-sequence resistance | Zero-sequence stator winding resistance | Ω |
L0 | Zero-sequence inductance | Zero-sequence stator winding leakage inductance | H |
Induction Machine with Squirrel-Cage Rotor:
This configuration is used for dynamic modeling of a Squirrel-cage Induction Machine, which models the stator winding and squirrel-cage rotor. All the rotor parameters are reffered to the stator identified by a prime sign. By choosing open-winding option, each stator induction can be access allowing wie with neutral or delta connection on the stator side. The mask and electrical parameters of a Squirrel-Cage Induction Machine are presented as follows:
Symbol | Name | Description | Unit |
Rs | Stator resistance | Per-phase stator winding resistance | Ω |
Lls | Stator leakage inductance | Per-phase stator winding leakage inductance | H |
Rr' | Rotor resistance | Per-phase equivalent rotor winding resistance referred to the stator | Ω |
Llr' | Rotor leakage inductance | Per-phase equivalent rotor winding leakage inductance referred to the stator | H |
Lm | Mutual inductance | Stator-rotor mutual (magnetizing) inductance | H |
R0 | Zero-sequence resistance | Zero-sequence stator winding resistance | Ω |
L0 | Zero-sequence inductance | Zero-sequence stator winding leakage inductance | H |
Induction Machine with Double Squirrel-cage Rotor:
This configuration is used for dynamic modeling of a Double Squirrel-cage Induction Machine, which models the stator winding and two squirrel-cages for the rotor. All the rotor parameters are reffered to the stator identified by a prime sign. The mask and electrical parameters of a Double Squirrel-cage Induction Machine are presented as follows:
Symbol | Name | Description | Unit |
Rs | Stator resistance | Per-phase stator winding resistance | Ω |
Lls | Stator leakage inductance | Per-phase stator winding leakage inductance | H |
Rr1' | Cage 1 rotor resistance | Cage 1 per-phase equivalent rotor winding resistance referred to the stator | Ω |
Llr1' | Cage 1 rotor leakage inductance | Cage 1 per-phase equivalent rotor winding leakage inductance referred to the stator | H |
Rr2' | Cage 2 rotor resistance | Cage 2 per-phase equivalent rotor winding resistance referred to the stator | Ω |
Llr2' | Cage 2 rotor leakage inductance | Cage 2 per-phase equivalent rotor winding leakage inductance referred to the stator | H |
Lm | Mutual inductance | Stator-rotor mutual (magnetizing) inductance | H |
Doubly-fed Induction Machine:
This configuration is used for dynamic modeling of a Doubly-fed Induction Machine, which models the stator and rotor windings. All the rotor parameters are reffered to the stator identified by a prime sign. The mask and electrical parameters of a Doubly-fed Induction Machine are presented as follows:
Symbol | Name | Description | Unit |
Rs | Stator resistance | Per-phase stator winding resistance | Ω |
Lls | Stator leakage inductance | Per-phase stator winding leakage inductance | H |
Rr' | Rotor resistance | Per-phase rotor winding resistance referred to the stator | Ω |
Llr' | Rotor leakage inductance | Per-phase rotor winding leakage inductance referred to the stator | H |
Lm | Mutual inductance | Stator-rotor mutual (magnetizing) inductance | H |
Nsr | Stator to rotor turn ratio | Stator to rotor turn ratio | - |
Rs0 | Zero-sequence resistance (Stator) | Zero-sequence stator winding resistance | Ω |
Ls0 | Zero-sequence inductance (Stator) | Zero-sequence stator winding leakage inductance | H |
Rr'0 | Zero-sequence resistance (Rotor) | Zero-sequence rotorwinding resistance | Ω |
Lr'0 | Zero-sequence inductance (Rotor) | Zero-sequence rotor winding leakage inductance | H |
PMSM Fix Ld Lq mode:
This configuration is used for dynamic modeling of a PMSM with constant parameters. The mask and electrical parameters of the PMSM in Fix DQ mode are presented as follows:
Symbol | Name | Description | Unit |
Rs | Stator resistance | Per-phase stator winding resistance | Ω |
Ld | Direct-axis inductance | Stator winding phase to neutral inductance on the D-Axis | H |
Lq | Quadrature-axis inductance | Stator winding phase to neutral inductance on the Q-Axis | H |
FluxPM | Permanent magnet flux linkage | The constant flux per pole pairs induced in the stator windings by the rotor magnets | Wb |
DqTheta | Rotor flux position at theta = 0 | Offset angle applied to the dq transform to have magnet flux aligned or 90degree behind phase A | Deg |
BLDC mode:
This configuration is used for dynamic modeling of a BLDC with constant parameters. The mask and electrical parameters of the BLDC mode are presented as follows:
Symbol | Name | Description | Unit |
Rs | Stator resistance | Per-phase stator winding resistance | Ω |
Ls | Stator leakage inductance | Stator winding phase to neutral inductance | H |
FluxPM | Permanent magnet flux | The constant flux per pole pairs induced in the stator windings by the rotor magnets | Wb |
BEMFFlatArea | Back EMF flat area | Electrical angle width of the flat area of the trapezoidal back EMF | Deg |
DqTheta | Rotor flux position at theta = 0 | Offset angle applied to the dq transform to have magnet flux aligned or 90degree behind phase A | Deg |
Mechanical Parameters
In the mechanical section, the Mechanical Mode drop down list gives the following options
Speed, which excludes the mechanical model to run the machine in speed mode. In this mode, Enable Mechanical Port gives the option of setting the speed command as a constant parameter in the mask, or as an extrenal port at the input of the block.
Mechanical Torque, which includes the mechanical model to run the machine in torque mode. In this mode, Enable Mechanical Port gives the option of setting the torque command as a constant parameter in the mask, or as an external port at the input of the block. The machines can operate in both motor mode, when the torque (load) is positive, and generating mode, when the torque (input) is negative.
External mode, which allows controling the mechanical mode from outside of the block specially when the mechanical mode change during the simulation is required. By selecting this option three ports of Mechanical Mode, Speed, and Torque will appear at the input of the block. Mechanical Mode input constant of 0 or 1 corresponds to the speed or mechanical torque mode, respectively.
Symbol | Name | Description | Unit |
pp | Pole Pair | Number of pole pairs | - |
J | Rotor Inertia | Rotor moment of inertia | kg.m^2 |
Fv | Viscous Friction Coefficient | Viscous friction coefficient | N.m.s/rad |
Fs | Static Friction Torque | Static friction torque | N.m |
W0 | Initial Speed | Initial speed | rpm |
Be aware the max number of pole pair supported is increased to 127 rather than 31 since eFPGAsim 2.7.
Resolver and Encoder Parameters
By checking the Enable Resolver/Encoder, the resolver/encoder parameters appear in the mask. Two encoder mode can be available (Quadrature or Hall effect). Direction of Sensor Rotation determines if it is either clockwise or counter clockwise. For the resolver, the Excitation Source Type determines the source from which the excitation of the resolver is generated. It can either be AC, which is generated inside the FPGA with the specified frequency, DC, which is generated with a 90-degree from the rotor and External, which is generated from outside the model through Analog In Channel assignment. The Resolver Sine and Cosine Gains are in a vector of 4×1.
For Resolver Sine and Cosine Gains [Rk], four parameters are Sin.Sin, Sin.Cos, Cos.Sin and Cos.Cos. The resolver Sine and Cosine outputs are calculated by using the following two equations. To simulate the resolver ideally, set Sin.Sin and Cos.Cos to 1 while Sin.Cos and Cos.Sin to 0.
Symbol | Name | Description | Unit |
Rpp | Number of Pole Pairs of the Resolver and Encoder | Number of pole pairs of the resolver and encoder Note: Only disabled when both Resolver and Encoder are disabled | - |
Roffset | Resolver Angle Offset | Angle offset between the resolver and the rotor position from 0 to 360 degrees | deg |
Rk | Resolver Sine and Cosine Gains | Vector of 4 sine/cosine modulation output sine/cosine component amplitude between 0 and 1 | - |
Ef | Excitation Frequency | Frequency of the excitation when the source is in AC mode | Hz |
Ets | Excitation Time Shift | This parameter is used to compensate the time offset between the carrier generation's input in the system and modulated signals' output | s |
Qppr | Number of pulses per revolution | Number of pulses in one full revolution of the encoder | - |
Roffset | Encoder Angle Offset | Angle offset between the encoder and the rotor position from 0 to 360 degrees | deg |
Hpos | Hall effect sensor positions | Vector of 3 elements that give in electrical angle the positions of the Hall effect sensors A B C in this order | deg |
Inputs
Mechanical Mode:This port allows controling the mechanical mode from outside of the block specially when the mechanical mode change during the simulation is required. Mechanical Mode input constant of 0 or 1 corresponds to the speed or mechanical torque mode, respectively.
Speed:
This port is used for the speed command. It is available when the mechanical mode is set to external, or it is set to speed and the Enable Mechanical Port is set to external port.
Torque:
This port is used for the load torque command. It is available when the mechanical mode is set to external, or it is set to torque and the Enable Mechanical Port is set to external port.
Outputs
Machine signals (Generic machine mode):
For each machine, the following signals are available at the monitoring port:
Signal Name | Description |
Vsq | Quadratic stator voltage. |
Vsd | Direct stator voltage. |
Vrq | Quadratic rotor voltage, seen from stator. |
Vrd | Direct rotor voltage, seen from stator. |
Phisq | Quadratic stator flux. |
Phisd | Direct stator flux. |
Phirq | Quadratic rotor flux, seen from stator. |
Phird | Direct rotor flux, seen from stator. |
Isq | Quadratic stator current. |
Isd | Direct stator current. |
Irq | Quadratic rotor current, seen from stator. |
Ird | Direct rotor current, seen from stator. |
isa | First stator phase current. |
isb | Second stator phase current. |
isc | Third stator phase current. |
ira | First rotor phase current, seen from stator. |
irb | Second rotor phase current, seen from stator. |
irc | Third rotor phase current, seen from stator. |
Torque | Electrical torque |
w | Motor speed in rpm |
thetam | Mechanical rotor angle in degrees |
Resolver sin | sin waveform from the resolver |
Resolver cos | cos waveform from the resolver |
Resolver carrier | carrier waveform from the resolver |
Machine signals (PMSM mode):
For each machine, the following signals are available at the monitoring port:
Signal Name | Description |
Ia | First stator phase current. |
Ib | Second stator phase current. |
Ic | Third stator phase current. |
VaFiltered | First stator phase voltage filtered. |
VbFiltered | Second stator phase voltage filtered. |
VcFiltered | Third stator phase voltage filtered. |
ActivePower | Instantaneous active power. |
ReactivePower | Instantaneous reactive power. |
Id | D-axis current. |
Iq | Q-axis current. |
ThetaMec | Mechanical rotor angle in degrees. |
ThetaElec | Electrical rotor angle in degrees. |
ElectomagneticTorque | Electrical torque in Nm. |
SineResolver | sin waveform from the resolver. |
CosineResolver | cos waveform from the resolver. |
ExcitationResolver | carrier waveform from the resolver. |
ThetaResolver | Resolver angle in degrees use for Sine Cosine modulation. |
SpeedRPM | Electrical machine speed in Revolution per minutes. |
TotalTorque | Torque resultant after static friction (electromagnetic torque - torque load - static friction). |
BackEmfA | Back Emf voltage of phase A in Volts. |
BackEmfB | Back Emf voltage of phase B in Volts. |
BackEmfC | Back Emf voltage of phase C in Volts. |
Characteristics and limitations
Offline simulation:
This block is not capable of offline simulation.
Communication delays:
The block latency is 2 CPU Time steps.
Direct Feedthrough | NO |
Discrete sample time | YES |
XHP support | YES |
Work offline | NO |
If you require more information, please