Measuring Grid Variables (Voltage, Current, PQ, Frequency, Phase Angle) of a Bus in an IEEE-9 Bus System in Simulink

19 views (last 30 days)
Good day! As the title suggests, I am currently figuring out how to properly measure needed variables in an IEEE-9 Bus System (https://www.mathworks.com/help/sps/ug/ieee-9-bus.html).
I would like to measure the grid voltage, current, active and reactive power, frequency, and phase angle of a specific bus in the network. I would be applying this later on for voltage and frequency support of BESS in a transmission network.
At the moment, I am concerned with two things:
1) Is my measurement setup correct?
2) I tried setting up three-phase PLL with default values (https://www.mathworks.com/help/sps/ref/sinusoidalmeasurementpllthreephase.html) for frequency measurement. However, I keep getting frequency that is around -7000 Hz (it should be around 60 Hz at steady-state). I am unsure how to setup the loop filter proportional and integral gain. Is the PLL block in Simulink sufficient to use for my desired application, or should I construct my own PLL for such purpose?
(I am using fixed-step solver ode1)
I have tried understanding and solving it on my own, but the concepts still overwhelm me. I would appreciate any help to further understand the concepts. If further context or information is needed, I will gladly provide more.
Thank you!

Answers (1)

Spoorthy Kannur
Spoorthy Kannur ungefär 22 timmar ago
Hi Timothy,
The behaviour you describe (PLL output ≈ −7000 Hz) is almost always caused by either one of these:
  • An incorrect feed/wiring or unit scaling into the PLL
  • Numerical instability from the solver/fixed step size
  • Loop-filter gains that make the PLL unstable.
You may try the following steps:
  1. Verify the three phase voltages you connect to the PLL are phase-to-neutral (or whatever the block expects), properly grounded, and in volts/consistent
  2. Switch to a variable-step solver (ode15s) while tuning or reduce your fixed step to something small (e.g. 1e-4 s)
  3. Set the PLL initial frequency to 60 Hz and start with conservative loop gains (divide defaults by 10) or choose a narrow bandwidth (2–5 Hz) then slowly increase gains until the PLL locks
  4. Watch the raw voltages, phase error and frequency on scopes, if the phase error diverges or frequency jumps, reduce gains / reduce step size. The Simulink PLL block is suitable for grid synchronization if connected and tuned correctly.
If these steps don’t fix it, do reach out to MathWorks Technical Support for more help (https://www.mathworks.com/support/contact_us.html).
Make sure you attach a minimal model and the PLL/simulation so they can reproduce and debug further.

Products


Release

R2025a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!