Help Creating load flow simulation for 3 phase powered commercial building

Hello, I need assistance in creating a PLECS simulation for a hardware-in-the-loop system using the PLECS RT box using TI C2000 (F28P55X) with the LaunchPad Nucleo interface. I am new to the software and trying to get my feet wet in power electronics. I am trying to model a building with 3-phase power as a load, using a controlled current source with a controlled current reading from a time series CSV file. Now, the rectifier that is going towards the battery load is being controlled by a PWM signal that the controller outputs based on fixed PID parameters. The PWM signal duty cycle will show when the battery of the building is being charged or discharging when it toggles on and off throughout the day, which I was given real-time data on for my time series CSV file. I need help on trying to build the model as well as trying to verify it. I got decent work on building it for a single phase, but I’m tripping up on trying to upgrade it to 3-phase.

battery_charger_example.plecs (155.2 KB)

I was also alerted by a colleague of mine that PLECS could generate C code for the microcontroller. Based on your model build

Hello, unfortunately there are a lot of variables that you would need to decide in your project that only you can answer. Few that I can think off at the top of my head are:

  • what topology are you going to use
  • what control strategy are you going to use
  • what MCU are you going to use

Unfortunately these aren’t really things that anyone else can answer. If you are looking for inspiration then checkout the demo model “Three-Phase Grid-Connected PV Inverter“ that uses an NPC for the inverter topology.

PLECS can generate C code for MCUs. Currently the MCUs supported are numerous TI, ST and XMC micro-controllers.

Sorry for the confusion, I am just new to the software, and I am trying to use it for my Senior Design.

Topology:

  • Grid-tied bidirectional full-bridge LCL filter 3-phase 230 Vrms with a Battery sized to 400V.
  • A bidirectional DC-AC converter between the battery and the utility grid is being monitored by the control system with a PWM signal for the charge and discharge. (I am trying to make the older model that I have scaled to a 3 phase system).

Control:

  • Objective: Keep the building net draw from the grid below the 70th percentile current, which is the setpoint was 151.5A.

  • Use a PID algorithm to get a PWM signal similar to this control scheme I found here (This is where I keep getting stuck on with my system.)

MCU

  • I am using the F28P55x for my HIL integreation sorry if this is alot I am really just looking for a starting point for my system because I was stuck all summer trying to build it myself.

The plant model I decided to use was the NPC inverter plant with TI C2000 control to try to make the A Battery source for the DC output based on the PWM signals. As for the control system, I am stuck on trying to make A PI closed-loop system for this to regulate the charge and discharge of the battery source to the utility.

Hello, these are design decisions unfortunately. I’m not aware of a ready made model that you can use but here is a model that might provide you the starting point you are looking for.

3ph_gridtied_bidirectional_converter.plecs (188.6 KB)

I basically took the demo model “Three-Phase Grid-Connected PV Inverter” and:

  • removed the DC/DC stage + controller
  • replaced DC bus link capacitor with an ideal DC source
  • removed the outer voltage loop of the AC/DC converter (since the DC source will make this a stiff voltage source)

now with all these modifications you can simply set the d-axis current reference to either be in power generation or sink mode for the grid.

To output this on the TI controller, I am getting an error of not matching inputs. How would I go about fixing this error?

battery_charger_with_PID.plecs (130.6 KB)

The error message you are getting specifies that you are trying to specifying a one duty cycle for a vector of PWM modules (ePWM1 and ePWM2 on the 28P55 mcu). Is that what you are trying to do? If so, then you simply need to vectorize the PWM duty cycle (the Signal Selector block with input width set to 1 and output indices set to [1 1]).

The goal I have been trying to achieve is to create a control system with a reference pulse signal for my inverters to regulate off of exactly like this, with a PID system instead of a PI system, so I can try to tune the parameters.

I am trying to get an input like the PWM capture for these signals s1, s2,s3,s4 to regulate the charge and discharge for the battery

(attachments)

battery_charger_with_PID.plecs (132 KB)

That sounds like a good approach. Using PWM capture for s1-s4 can help you monitor and control the charge and discharge more accurately.