Diesel generator model

How to create a diesel generator model?

Good question. it all depends on complexity you want to model, which links back to what are you trying to accomplish?

The simple solution is to model a controlled source where you change frequency and voltage to “act” like a diesel gen set.
The picture shows a variable frequency and amplitude source, you can change the frequency and amplitude as lookup tables functions, that are dependent on loading etc. Things can be quite complex if you choose.
you could also choose to model it with a motor model, all PSIM motor models are 4 quadrant.
In this picutre we are using a PMSM and a the mechanical electrical interface block. The controlled voltage source is being used to set the shaft speed, again we will be able to adjust the shaft speed based at will, and it could be a function of electrical load, lookup table, etc.

There is only one input on PMSM
How can I create a diesel generator model like this on PSIM
The first Simulink input is the mechanical power at the machine’s shaft, in Watts or pu. In generating mode, this input can be a positive constant or function or the output of a prime mover block (see the Hydraulic Turbine and Governor or Steam Turbine and Governor blocks). In motoring mode, this input is usually a negative constant or function.

The alternative block input instead of Pm (depending on the value of the Mechanical input parameter) is the machine speed, in rad/s.

The second Simulink input of the block is the field voltage. This voltage can be supplied by a voltage regulator in generator mode (see the Excitation System block). It is usually a constant in motor mode.
If you use the model in SI fundamental units, the field voltage Vf must be entered in volts DC if nominal field current Ifn is specified, or in volts referred to stator if Ifn is not specified. To obtain the Vfd producing nominal voltage, select the Display nominal field current and voltage producing 1 pu stator voltage check box in the Advanced tab. If you use the model in pu Standard or in pu Fundamental units, Vf must be entered in pu (1 pu of field voltage producing 1 pu of terminal voltage at no load).

The Simulink output of the block is a vector containing measurement signals. You can demultiplex these signals by using the Bus Selector block provided in the Simulink library. Depending on the type of mask that you use, the units are in SI or in pu.

So we have a synchronous machine model. image

you will need to define the field winding voltage and you will be able to drive the shaft speed based on my previous screen shots.

The Diesel governor or excitation system elements we do not have functional equivalents, but they can be easily made with the c code element, look up tables, or form discrete elements. You can also co-simulate with Simulink, and just pass the mechanical shaft speed and field voltage to PSIM.

This one of our wind power example circuits (in renewable energy example folder)

you can see how the PMSM shaft speed is being driven by the wind turbine model, as mentioned above, that wind turbine could be a lookup table, a controlled source driven by math expressions, a c code block, or a link back to simulink.

Can I control the output voltage and frquence of PMSM to 180V and 60HZ

Yes, but you need to define the motor parameters properly. PSIM has “realistic” models, so you need to define a back emf and pole pair combo that will give you your desired output voltage and frequency at the target shaft speed.

Additionally, the output impedance of the machine is modeled, so the output voltage will fluctuate due to load currents.