rasProject_01 / weSweetHome  R. 240
process control       /     RasPi software         by   weinert-automation
Loading...
Searching...
No Matches
weAR_N4105.h File Reference

Definitions for VDE-AR-N 4105. More...

#include "sysBasic.h"
#include "weStateM.h"

Macros

#define L1Msk
 arn4105state L1 voltage mask
 
#define L2Msk
 arn4105state L2 voltage mask
 
#define L3Msk
 arn4105state L3 voltage mask
 
#define LeMsk
 arn4105state line status error mask
 
#define LfMsk
 arn4105state line frequency mask
 
#define LwMsk
 arn4105state line status warning mask
 
#define newLineFcheck(N, C)
 Define a five band checker for line frequency. More...
 
#define newLineUcheck(N, C)
 Define a five band checker for line voltage. More...
 

Functions

void setARN4105state (uint8_t const state, uint8_t const select)
 Set AR-N 4105 frequency and voltage states. More...
 
void switchARN4105 (uint8_t const cutOff)
 AR-N 4105 implementation function. More...
 

Variables

uint8_t arn4105state
 AR-N 4105 frequency and voltage states. More...
 
state_t arn4105Timer
 AR-N 4105 control timer. More...
 
state_t checkL1_U
 The (one) five band checker for line L1 voltage. More...
 
state_t checkL2_U
 The (one) five band checker for line L2 voltage. More...
 
state_t checkL3_U
 The (one) five band checker for line L3 voltage. More...
 
state_t checkLineFrq
 The (one) five band checker for line frequency. More...
 

Detailed Description

Definitions for VDE-AR-N 4105.

Copyright (c) 2019 Albrecht Weinert
weinert-automation.de a-weinert.de
/ / /\
/ /___ / \ |
\ /____\ /____\ | _|__
\ /\ / \ / \| |
\/ \/ \__/ \__/|_

Revision history

Rev. 250 10.07.2023
Rev. 195 01.03.2019 : new
Rev. 249 26.06.2023 : No more relays assigned for ARN4105 cut off

Macro Definition Documentation

◆ newLineFcheck

#define newLineFcheck (   N,
 
)

Define a five band checker for line frequency.

A state machine of this type is to be fed with the actual line frequency (nominal 50 Hz) as an analogue (float) value sampled regularly. This value is compared to four thresholds namely
      47.7 49.5 -OK- 50.5 51.5 Hz
defined by VDE-AR-N 4105 as good / warning / bad criteria for the grid frequency separating those five bands:
      ...badLO | critLo | OK | critHi | badHi...

On badHi or badLo distributed small generators must be cut off reliably from public power lines. For being switched on to the grid at OK often at least 10 minutes out of bad ist required.

For state values and parameters see newFiveBand

This macro is the initialisation expression for a five band checker requiring the unique name and the fitting onStateChange function.

Parameters
Nname as string literal
ConStateChange function

◆ newLineUcheck

#define newLineUcheck (   N,
 
)

Define a five band checker for line voltage.

A state machine of this type is to be fed with the actual line voltage (nominal 230 V) as an analogue (float) value sampled regularly. This value is compared to four thresholds namely
      184 207 -OK- 253 264 V
defined by VDE-AR-N 4105 as good / warning / bad criteria for the grid frequency separating those five bands:
      ...badLO | critLo | OK | critHi | badHi...

On badHi or badLo distributed small generators must be cut off reliably from public power lines. For being switched on to the grid at OK often at least 10 minutes out of bad ist required.

For state values and parameters see newFiveBand

This macro is the initialisation expression for a five band checker requiring the unique name and the fitting onStateChange function.

Parameters
Nname as string literal
ConStateChange function

Function Documentation

◆ setARN4105state()

void setARN4105state ( uint8_t const  state,
uint8_t const  select 
)

Set AR-N 4105 frequency and voltage states.

This function is called internally by the respective five band checker's state_t.onStateChange function.

Parameter selection mask must be one of LfMsk, L1Msk - L3Msk.

Parameters
statestate_t.status of the five band checker in question
selectselection mask

◆ switchARN4105()

void switchARN4105 ( uint8_t const  cutOff)

AR-N 4105 implementation function.

This is the VDE-AR-N 4105 cut off function to be provided site specific by user / application software. It does the cut off respectively switch back on the generators and optionally log the event.

Parameters
cutOffnot 0: do the cut off, 0: switch generators back on

Variable Documentation

◆ checkLineFrq

state_t checkLineFrq
extern

The (one) five band checker for line frequency.

See newLineFcheck

◆ checkL1_U

state_t checkL1_U
extern

The (one) five band checker for line L1 voltage.

In a one phase system this will be the only one fed with values by fiveBandTick.

See newLineUcheck

◆ checkL2_U

state_t checkL2_U
extern

The (one) five band checker for line L2 voltage.

See newLineUcheck

◆ checkL3_U

state_t checkL3_U
extern

The (one) five band checker for line L3 voltage.

See newLineUcheck

◆ arn4105state

uint8_t arn4105state
extern

AR-N 4105 frequency and voltage states.

If all is OK this status byte is 0. The meaning of bits set is

| 7 | 6 | 5 | 4 || 3 | 2 | 1 | 0 |
| L3 | L2 | L1 | f || L3 | L2 | L1 | f |
| voltage error | error || voltage warning | warning|

If any error bit is set the respective generators has to be cut off.
Ten minutes after the last warning bit is gone the respective generators may be put back to power line.
The timer arn4105Timer will be handled accordingly.

User software should not touch this variable (except when knowing the consequences.

◆ arn4105Timer

state_t arn4105Timer
extern

AR-N 4105 control timer.

When this timer is running distributed small generators must be cut off. When this timer stops the respective generators may be put back to power line.

User software must provide a function switchARN4105 doing the cutoff and switch back plus optionally logging. It will be called by this timer and, hence, in the end by the frequency and voltage checkers.

The user/application software must check (timerTickCheck) regularly to enable switch back.