Bug Hunting a Power System Stabiliser (PSS) in PSCAD
AI Blended Bug Hunting
As a power engineer I jump between DIgSILENT and PSCAD regularly - they are both great tools and do different jobs.
This is a real world problem I was having a little while ago when a Power System Stabiliser (PSS) was not ‘behaving’ despite having all the correct settings in the model.
1. The Problem
During a series of power system studies for a large rotating machine, it was noticed that the PSS was operating continuously and working in a bang-bang (i.e. driving from one limit to another limit and back again) control oscillation. All the settings were checked, rechecked and checked again between the PSS test data and the PSCAD model. There was nothing obviously wrong and it was turning into a real puzzle.
The PSS model i was using was a standard PSS2B model from the PSCAD library, with a configuration as shown below

2. The Solution and Investigation
Being a bit older and having seen lots of different problems over the years, I started to wonder if the problem was actually in the library model rather than in the model I had created. So with this small flash of insight, I isolated off the PSS2B model, created a simple test rig for it and got Claude to interrogate the model and look for the signals in and out.

After some digging, Claude found the bug was related to one of the parameters related to Tw4, which had been set to 0. The problem was subtle - IEEE 421.5 has a key concept that if a washout stage is set with a zero-time constant, it should be bypassed. Instead, the PSS2B module was resolving this to a value of 0, which was effectively removing the whole power branch damping function.
After identifying the bug inside the PSS2B model, the solution was to set the Tw4 value to a very high number of 9999, this reduces the transfer block to a value of 1, which is almost the same as a bypass. The adjusted model and the work around were both viable solutions and let the simulation studies be completed.
Just to make sure I had not gone down a rabbit hole, I followed up and confirmed with PSCAD technical support, who confirmed there is indeed a bug in the PSS2B model.
3. Summary
It is applications like this where AI and the interface and application to power systems is just incredible. Sure I could have done all this manually, but it would have been slow and tedious.
What was surprising about this, was the speed and ability of the AI to actually get into the root of the problem and correctly identify what was causing the issue. I have been carrying out simulation studies long enough to know not to trust anything, but this would easily have been a major problem for a younger (or more trusting) engineer.
Download Technical Note 002 - PSS Bug Hunting in PSCAD (PDF)