Engee documentation

Controlled PWM Voltage

A pulse width modulated voltage source.

blockType: AcausalElectricPowerSystems.IntegratedCircuits.ControlledPWMVoltage

Path in the library:

/Physical Modeling/Electrical/Integrated Circuits/Controlled PWM Voltage

Description

Block Controlled PWM Voltage It is a pulse width modulated (PWM) voltage source. You can simulate the electrical ports or the input signal by setting the Modeling option parameter to one of two values:

  • Electrical input ports — The unit calculates the duty cycle based on the reference voltage at ports ref+ and ref−. This parameter is used by default.

  • Signal input — setting the borehole value directly using the input control signal.

When setting the values for the Modeling option parameter Electrical input ports The borehole is:

where:

  • — input voltage at ports ref+ and ref−.

  • — minimum reference voltage.

  • — maximum reference voltage.

The value of the parameter Output voltage amplitude determines the amplitude of the output voltage.

At the initial moment of time, the pulse is initialized with a high value, unless the Pulse delay time parameter is greater than zero or the set error is equal to zero.

Using the Pulse delay time and Pulse width offset parameters, you can add a small on-off delay and a small off-off delay. This can be useful when fine-tuning the switching time in order to minimize switching losses.

In PWM mode, the unit operates asynchronously - PWM switching moments generate events, so the switching time is always determined accurately, regardless of the maximum size of the simulation step.

Assumptions and limitations

The model is based on the following assumptions:

  • The REF output of this unit is floating, it is not connected to the electric earth. The consequence of this is that when connecting the electrical ports PWM and REF directly to the electrical ports PWM and REF of the unit H-Bridge or the gate drivers must be connected to the REF connection line of the Electrical Reference unit.

  • Do not connect the controlled PWM unit directly to the semiconductor gate, because in this case there is no output resistance of the gate driver, which determines the switching dynamics. To set the gate-source or gate-emitter voltage, use the gate driver or half-bridge driver unit.

  • Do not use a controlled PWM unit to directly control the motor unit. In the intervals between pulses, the PWM motor driver switches to an open state. To control the engine, use the control unit H-Bridge.

  • When controlling the engine through the block H-Bridge set the Simulation mode parameter to Averaged to speed up the simulation. The Simulation mode parameter of the block H-Bridge It must also be set to the mode Averaged. In this case, the average value of the required PWM voltage is applied to the motor. In the mode Averaged It is assumed that the impedance of the inductive element of the motor is small at the PWM frequency. To test this assumption, run the simulation in PWM mode and compare the results with the results obtained in PWM mode. Averaged.

If you are linearizing the model, set the Simulation mode parameter to Averaged and make sure that you have correctly specified the operating point of the block. Linearization of the block is possible only for inputs corresponding to a duty cycle greater than zero and less than 100%.

Ports

Entrance

u — pass control signal:q[<br>] scalar

The input signal that sets the borehole.

Dependencies

To use this port, set the Modeling option parameter to Signal input.

Non-directional

ref+ — positive terminal
electricity

The electrical port connected to the positive contact of the reference voltage.

Dependencies

To use this port, set the Modeling option parameter to Electrical input ports.

ref− — negative terminal
electricity

The electrical port connected to the negative contact of the reference voltage.

Dependencies

To use this port, set the Modeling option parameter to Electrical input ports.

PWM — Pulse width modulated signal (PWM signal)
electricity

An electrical voltage port connected to a PWM-modulated output signal.

REF — floating ground port
electricity

An electrical port connected to a floating ground.

Parameters

Modeling option — borehole based on electrical ports or the pass:q control signal[<br>] Electrical input ports (default) | Signal input

An option for specifying the type of block ports.

  • Electrical input ports — the unit calculates the borehole based on the reference voltage at ports ref+ and ref−. This parameter is used by default.

  • Signal input — setting the borehole directly using the input port.

PWM frequency — PWM pass frequency:q[<br>] 1000 Hz (default)

The frequency of the output PWM signal.

Dependencies

This parameter is used if the Simulation mode parameter is set to PWM.

Pulse delay time — delay in enabling
0 (default)

The pulse sequence does not start until the simulation time is equal to the value of this parameter.

You can set a small value Pulse delay time to fine-tune the switching time and ensure that the switched-off device is completely turned off before turning on the switched-on device. You can also use large delay time values, for example, if you want the pulse sequence to start after only a few cycles. The specified value must be greater than or equal to zero.

Dependencies

This parameter is used if the Simulation mode parameter is set to PWM.

Pulse width offset — lengthens or shortens the pulse
0 (default)

The required pulse width, determined by the product of the borehole and the pulse frequency, can be shifted by the value set for the Pulse width offset parameter. A positive value extends the pulse by a fixed amount. A negative value shortens the pulse. This parameter, together with the Pulse delay time parameter, can be used to fine-tune the switching time in order to minimize switching losses in some circuits.

Dependencies

This parameter is used if the Simulation mode parameter is set to PWM.

Minimum pulse width — minimum pulse length of
0 (default)

The minimum pulse length based on the internal clock generator or set programmatically to protect the controlled device. The specified value must be greater than or equal to zero.

Dependencies

This parameter is used if the Simulation mode parameter is set to PWM.

Simulation mode — simulation mode
PWM (default) | Averaged

Select one of the following output voltage type options:

  • PWM — The output voltage is a pulse width modulated signal. This is the default option.

  • Averaged — The output voltage is the average value of the PWM signal.

Switching event type — type of the pass switching event:q[<br>] Asynchronous – Best for variable-step solvers (default) | Discrete-time – Best for fixed-step solvers
  • Asynchronous – Best for variable-step solvers — This option is more effective for desktop modeling using variable-step solvers, as it requires fewer simulation steps to achieve the same level of accuracy.

  • Discrete—time – Best for fixed-step solvers — Used with fixed-step solvers, including the local solver.

Dependencies

This parameter is used if the Simulation mode parameter is set to PWM.

Sample time — the interval between the steps of calculating the
1e-6 (default)

The time between updates of the block exit status. The interval between calculation steps should be a multiple of the size of the modeling step. In order for the PWM control to have sufficient resolution, the interval between calculation steps must be less than one hundredth of the PWM period. (The PWM period is one more than the PWM frequency).

Dependencies

This parameter is used if the Switching event type parameter is set to Discrete-time — Best for fixed-step solvers

Input voltage for 0% duty cycle — Vmin
0 (default)

The value of the input voltage, V, at which the PWM signal has a duty cycle of 0%.

Dependencies

This parameter is used if the Modeling option parameter has the value Electrical input ports.

Input voltage for 100% duty cycle — Vmax
5 V (default)

The value of the input voltage at which the duty cycle of the PWM signal is 100%.

Dependencies

This parameter is used if the Modeling option parameter has the value Electrical input ports.

Input value for 0% duty cycle — minimum value of the pass signal:q[<br>] 0 (default)

The value of the input signal at which the PWM signal has a duty cycle of 0%.

Dependencies

This parameter is used if the Modeling option parameter has the value Signal input.

Input value for 100% duty cycle — maximum value of the pass signal:q[<br>] 1 (default)

The value of the input signal at which the accuracy of the PWM signal is 100%.

Dependencies

This parameter is used if the Modeling option parameter has the value Signal input.

Output voltage amplitude — signal amplitude for high level output signal
5 V (default)

The amplitude of the PWM signal at the output.