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

Common values for an experimental smart home (lab) project. More...

#include "sweetHome.h"
#include <stdio.h>

Functions

float pwmToVolt (uint8_t const pwm)
 Output voltage of battery load module by PWM signal. More...
 

Variables

cmdLookUp_t cmdLookUp []
 The common command look up table. More...
 
volatile float fLine
 last valid power line frequency More...
 
float const loadModUlookup [256]
 Output voltage of electronic battery load module. More...
 
float const phPckSwPow [101]
 First (or only) phase packet switching device power look up.
 
phPckSwSet_t const phPckSwSets [101]
 The packet switch control values. More...
 
smdX30modbus_t smdX30modbus [ANZmodSLAVES]
 Descriptive and state array for smart meters on Modbus. More...
 
volatile int tempTankWater
 Last value of tank water temperature. More...
 
volatile uint8_t tempWaterBadCnt
 Tank water temperature bad read count. More...
 
valFilVal_t valFilVal
 All process values relevant for log files and HMI.
 

Detailed Description

Common values for an experimental smart home (lab) project.

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

Revision history

Rev. 268 15.10.2024
Rev. 99 29.01.2018 : load module voltage handling added
Rev. 217 05.09.2019 : phase packet switch ballast three 100% values
Rev. 229 23.07.2020 : valFil (CSV) removed
Rev. 245 27.02.2023 : pps 100% power raised to 1983 W due panel reorg.
Rev. 268 15.10.2024 : float lookup Uload(pwm) range 0..141

Function Documentation

◆ pwmToVolt()

float pwmToVolt ( uint8_t const  pwm)

Output voltage of battery load module by PWM signal.

Note: Currently, this function is used for the user interface - not for process control.

Parameters
pwmPWM signal 0 (lowest) .. 255 (highest output voltage)
Returns
output voltage 10.8 .. 15.2V

Variable Documentation

◆ cmdLookUp

cmdLookUp_t cmdLookUp[]

The common command look up table.

It must end with an entry {"", 0}.

The current (CGI) program uses linear search for the command mnemonic. Hence, and cause of structure, alphabetic sorting is of no avail.

◆ loadModUlookup

float const loadModUlookup[256]

Output voltage of electronic battery load module.

Depending on the (400Hz) PMW signal width 0..255 (/255 * 100% width) the battery load module will deliver about 11 to 15V. If the battery voltage is higher than the output voltage no current will flow (i.e. nothing happens). If the battery voltage is lower, up to 15A will be delivered. This current limit is implemented / fixed by the power module used. Hence, getting less current respectively power requires a fine control of the PWM signal (see POWH).

This array gives the module output voltage as function of the PWM width (=index) in the usable range 0..141.

◆ fLine

volatile float fLine

last valid power line frequency

Last valid power line frequency.

◆ phPckSwSets

phPckSwSet_t const phPckSwSets[101]

The packet switch control values.

The array holds the number of on and off phases (i.e. 20 ms periods at 50 Hz line frequency) for each percentage of full power. The array length is 101; the index [0..100] is, hence, directly the percentage wanted.

To avoid too visible flicker, for no set (phPckSwSets[i].onPhases, phPckSwSets[i].offPhases) the smaller of the two values would be greater than 4 (80 ms); in most cases it is 1 or 2 (40 ms).

◆ smdX30modbus

Descriptive and state array for smart meters on Modbus.

The number of meters is ANZmodSLAVES.

◆ tempTankWater

volatile int tempTankWater

Last value of tank water temperature.

This value will be the last good .tempTankTop (see valFilVal_t) or the last good .tempPipe. If neither is good for 251 measurements BAD_TEMP_READ (an incredibly high value) will be set.
This last tank water temperature will be checked against a safety limit to allow electric heating as ballast.
The value is in units of 1/1000 grdC.

◆ tempWaterBadCnt

volatile uint8_t tempWaterBadCnt

Tank water temperature bad read count.

This last tank water temperature will be checked against a safety limit to allow electric heating as ballast.

In case of too many bad reads the value must be fixed at 253