POWERCAL and BULK_SEQUENCE adapters: Filtering PMUs based on framerate

Hello !

With the addition of 100 fps PMUs in my pool, I’m trying to configure POWERCALC and BULK_SEQUENCE adapters in openHistorian. Up to now, I’ve been using them with their default settings and a framerate of 50 fps, successfully (“FramesPerSecond=50; LagTime=20.0; LeadTime=3.0; AdjustmentStrategy=None” and “ForceCalcSignalType=True; FramesPerSecond=50; UseBadQualityData=True; LagTime=20”). With the addition of 100 fps PMUs alongside the existing 50 fps ones, I’d like to have two separate adapters for each type: one POWERCALC at 50 fps and one at 100 fps; same for BULK_SEQUENCE.

I’m attempting to filter which PMUs should be considered by each adapter using the InputMeasurementKeys parameter, where I’m trying to apply dynamic filtering (rather than manually specifying each measurement ID one by one), but without success.

As an example, here’s what I tried for BULK_SEQUENCE, aiming to include only 50 fps PMUs (so that ‘PMU-100’ is excluded):

InputMeasurementKeys={FILTER ActiveMeasurements WHERE SignalType IN ('VPHA', 'IPHA', 'VPHM', 'IPHM') AND Phase = 'A' AND PointTag NOT LIKE '%PMU_100%'}

Unfortunately, the adapter fails to initialize properly, and I get the following warning:

[PHASOR!BULK_SEQUENCE] WARNING: 14 of the source 'A', 'B', 'C' phase sets were incomplete and were excluded as input.
[PHASOR!BULK_SEQUENCE] WARNING: No valid inputs were defined. Cannot initialize adapter.

Could you please provide, or help me determine, the correct filtering parameter I should use so that I can configure POWERCALC and BULK_SEQUENCE to process only 50 fps PMUs?
I’ll then apply the corresponding filter logic for the adapters dedicated to 100 fps PMUs.

Thanks for any help that you could provide,

Best Regards,

Stephane

Perhaps something like this:

InputMeasurementKeys={FILTER ActiveMeasurements WHERE SignalType LIKE '%PH%' AND PointTag NOT LIKE '%PMU_100%'}

Hello Ritchie,

Unfortunately, it results in multiple messages in the console :
[PHASOR!BULK_SEQUENCE_50] WARNING: Unexpected phase type ‘+’ in input “PPA:31983” [fd092a13-e95e-11ef-9d90-60f18ac70df7] for BulkSequenceCalculator. Expected one of ‘A’, ‘B’, or ‘C’, input excluded.

[PHASOR!BULK_SEQUENCE_50] WARNING: Unexpected phase type '+' in input "PPA:31984" [fd09c34d-e95e-11ef-9d90-60f18ac70df7] for BulkSequenceCalculator. Expected one of 'A', 'B', or 'C', input excluded.
[PHASOR!BULK_SEQUENCE_50] Starting measurement route calculation...
Starting measurement route calculation...
[PHASOR!BULK_SEQUENCE_50] Calculated 168 routes for 28 destinations in 0 seconds.
[PHASOR!BULK_SEQUENCE_50] Starting measurement route calculation...
[PHASOR!BULK_SEQUENCE_50] Calculated 168 routes for 28 destinations in less than 1 millisecond.

But no values are shown anymore in Grafana after the adapter is initialized with this filter.

Oh, bulk sequence adapter - yes, sorry, something like this:

InputMeasurementKeys={FILTER ActiveMeasurements WHERE SignalType LIKE '%PH%' AND Phase IN ('A', 'B', 'C') AND PointTag NOT LIKE '%PMU_100%' ORDER BY PhasorID}

OK, it’s working well, and I was also able to configure the Bulk_sequence adapter for the 100 fps PMU.
I ran into an issue with duplicate entries for all the Bulk_sequence-related measurements, so I had to delete them directly from the database to start from scratch — but now it’s working.

Can I use the same filter for POWERCALC (which uses the PowerMultiCalculatorAdapter) to apply the same 50/100 fps separation strategy?
I mean :
FramesPerSecond=50; LagTime=20.0; LeadTime=3.0; AdjustmentStrategy=None; InputMeasurementKeys={FILTER ActiveMeasurements WHERE SignalType LIKE '%PH%' AND PointTag NOT LIKE '%PMU_100%' ORDER BY PhasorID}
and
FramesPerSecond=100; LagTime=20.0; LeadTime=3.0; AdjustmentStrategy=None; InputMeasurementKeys={FILTER ActiveMeasurements WHERE SignalType LIKE '%PH%' AND PointTag LIKE '%PMU_100%' ORDER BY PhasorID}

The new measurements for PMU_100 related to P/Q/S are not automatically created …
Edit : I just remember I have to create them manually using the dedicated GUI :confused:

It seems to be working, although I did get some error messages in the console when initializing the adapter:

IdentifierElement: Could not find a field/property/variable with the name 'P'
IdentifierElement: Could not find a field/property/variable with the name 'b'

However, I get the impression that the filtering isn’t being applied properly:
If I disable the POWERCALC_50 adapter and keep only POWERCALC_100 enabled, power calculations are still performed for both PMU_50 and PMU_100.
Similarly, if I enable POWERCALC_50 and disable POWERCALC_100, all power values (for both PMU_50 and PMU_100) are still being calculated.
I have to disable both adapters for the calculations to stop entirely.

I believe I now have an answer to my question regarding power calculations:
By setting the framerate to 100 fps, the adapter correctly calculates power values for each available data point — meaning I get 100 calculated values per second for each PMU_100, and 50 calculated values per second for each PMU_50.
My initial concern — that I would get 100 calculated values per second even for the PMU_50 devices (which would increase storage usage without improving data accuracy) — doesn’t appear to be valid.

So, does that mean I can simply keep a single POWERCALC adapter configured at 100 fps?

Since the power calculations adapter is configured from a database table, I would suggest creating two “views” in the database, both from the same source table PowerCalculation, perhaps like PowerCalculation50 and PowerCalculation100 where each view filters the power calculation definitions for the target set of PMU’s, 50 or 100.

Then for the power calculator adapter for the 50Hz PMUs, add to the connection string ; TableName=PowerCalculation50 and for the power calculator adapter for the 100Hz PMUs, add to the connection string ; TableName=PowerCalculation100

I think something like this would “separate” the calculations, and allow the frame rate of the power calculator adapter for the 100Hz PMUs to be set to 100.

If you are using SQL Server, it may be possible to set the TableName parameter to a full query instead of the table view name:

; TableName=(SELECT * FROM PowerCalculation WHERE CircuitDescription LIKE '%PMU_50%')

And thus, avoid creating custom views in the database… Your mileage with other databases with such an operation may vary.

FYI - this all hinges on the CircuitDescription including needed PMU identification information, but I expect it should.