RealTimeControl
Contents
System Overview
What is BOSL RTC? The BOSL Real-Time Control (RTC) system is an intelligent water management platform designed to automatically control pond actuators based on real-time sensor data. The system prevents flooding while optimizing water levels through sophisticated control algorithms. Key features include:
- Automated Decision Making: 3-level priority control system
- Real-time Monitoring: 10-minute scanning intervals
- Safety Protocols: Multiple failsafe mechanisms
- Web Interface: Easy configuration and monitoring
- Data Smoothing: Moving average filtering to prevent false triggers
System Components
- Web Interface (rtc.php): Configuration and monitoring dashboard
- Control Engine (rtc_scan.php): Automated decision-making script
- Data Processing (rtc_scripts.php): Core calculation functions
- Configuration Storage (rtc.dat): System parameters
- Data Sources: Sensor files (Pond_1_Depth.csv, Pond_1.csv)
Getting Started
URL: https://www.bosl.com.au/IoT/UTK/?page=control
Initial Setup Requirements. The Admin Password is Required for configuration changes. You may change whether the strategy is active or not via the strategy activation section. You can then configure parameters for the RTC strategy.
Overview of operation. The BOSL RTC system is presently set up to manage water levels in one pond (user defines which one) through an automated actuator control strategy. The system continuously monitors the distance between a sensor and the water surface (called AFDIST -- user can define this) using data stored in the Pond_1_Depth.csv file (user can define this). To ensure reliable decision-making and prevent false triggers from sensor noise or temporary fluctuations, the system calculates a 5-point (user can specify how many points are used) moving average of the most recent depth readings. The control strategy operates with two critical thresholds: an emergency flood prevention threshold set at 2400mm (user defines) that immediately opens the actuator regardless of other conditions, and a normal operational threshold at 50mm (user defines) that triggers closure only when combined with proper timing conditions (the actuator must have been open for at least 6 days - user defines). The actuator itself can be positioned anywhere from 0% (fully closed - user defines) to 100% (fully open - user defines), with the failsafe default being 100% open (user defines) to prioritize flood prevention over water conservation. Additional measures include a maximum closure period of 2 days (user defines). Password-protected configuration changes to maintain system integrity.
Configuration
Basic Strategy Settings
| Parameter | Description | Current Value |
|---|---|---|
| Strategy Name | Identifier for this control strategy | Pond_1 |
| Strategy Enabled | Master on/off switch for automation | ✓ Enabled |
Actuator Configuration
| Parameter | Description | Current Value | Purpose |
|---|---|---|---|
| Site File Name | CSV file containing actuator data | Pond_1.csv | Data logging and status |
| Operator Command URL | API endpoint for sending commands | Internal URL | System communication |
| Open Value | Actuator position when fully open | 100 | Maximum flow rate |
| Close Value | Actuator position when fully closed | 0 | Minimum flow rate |
| Failsafe Value | Emergency fallback position | 100 | Safety default (open) |
| Read Last Item Command URL | API for retrieving last command | Internal URL | Status verification |
| Max Days Actuator Can Be Closed | Safety limit for closed duration | 2 days | Prevent system stagnation |
| Min Days Open Before Closing | Required open time before closure | 6 days | Ensure proper drainage |
Controlling Input Configuration
| Parameter | Description | Current Value | Purpose |
|---|---|---|---|
| Variable Name | Sensor measurement to monitor | AFDIST | Distance measurement |
| Site File Name | CSV file with sensor data | adjusted_databases/Pond_1_Depth.csv | Data source |
| Moving Average Timesteps | Number of readings to average | 5 | Noise reduction |
| Max Allowed Value | Upper limit for valid readings | 2400 | Data validation |
| Min Allowed Value | Lower limit for valid readings | 0 | Data validation |
| Replace With If Outside Range | Value substitution for invalid data | (blank) | Error handling |
| Open Threshold | Emergency opening trigger | 2400 | Flood prevention |
| Close Threshold | Normal closing trigger | 50 | Water conservation |
Control Algorithm Logic
The RTC system employs a 3-level priority control system that processes decisions every 10 minutes:
Level 3: Emergency Control (Highest Priority)
- Trigger: Water level > Open Threshold (2400mm)
- Action: OPEN
- Purpose: Flood prevention - overrides all other conditions
Level 2: Duration of closure has been reached (Middle Priority)
- Trigger: Actuator closed > Max Days (2 days)
- Action: OPEN
- Purpose: Prevent system stagnation and equipment damage
Level 1: Normal Operation Control (Lowest Priority)
Triggers:
- Average depth > Close Threshold (50mm) AND
- Actuator currently open (position = 100) AND
- Been open > Min Days (6 days)
Action: CLOSE
Purpose: to actively control water entering the pond and improve downstream ecosystems
Data Processing
- Raw Sensor Data: AFDIST readings from Pond_1_Depth.csv
- Validation: Remove readings outside 0-2400mm range
- Smoothing: Calculate 5-point moving average
- Decision Making: Apply 3-level control logic
- Command Execution: Send actuator commands via API
Status Monitoring
Strategy Updates Section
Displays real-time system status:
| Field | Description | Example Value |
|---|---|---|
| Average Depth | Current 5-point moving average | 624mm |
| Latest Percent Opening | Last command sent to actuator | 100 (fully open) |
| Days Since Last Command | Time elapsed since last action | 70.6 days |
Control Updates Section
Shows current decision-making status:
| Field | Description | Example |
|---|---|---|
| All Text | Detailed explanation of current logic | "LEVEL 1 CONTROL: We are suggesting to close..." |
| Should we Open | Binary decision flag | 0 (No) or 1 (Yes) |
| Should we Close | Binary decision flag | 1 (Yes) or 0 (No) |
Step-by-Step Procedures
Initial System Setup
- Access the System
- Navigate to: https://www.bosl.com.au/IoT/UTK/?page=control
- Enable the Strategy
- Check the "Enable Strategy" checkbox
- Click "Save Configuration"
- Enter admin password:
- Verify Configuration
- Review all parameter values in tables
- Check that thresholds are appropriate for your pond
- Confirm file paths are correct
- Monitor Initial Status
- Check "Average Depth" reading
- Verify "Days Since Last Command" is reasonable
- Review "All Text" for logic explanation
Regular Monitoring Routine
Daily Checks:
- Review average depth trends
- Check actuator response status
- Verify no error messages in control updates
Weekly Checks:
- Analyze timing patterns
- Review configuration appropriateness
- Check sensor data quality
Monthly Checks:
- Evaluate threshold effectiveness
- Review safety trigger history
- Update parameters if needed
Configuration Changes
- Access Configuration Mode
- Scroll to configuration tables
- Identify parameter to modify
- Make Changes
- Update desired values
- Enter admin password
- Click "Save Configuration"
- Verify Changes
- Confirm "Saved to RTC data file" message
- Check updated values in status section
- Monitor system response
Emergency Procedures
System Disable
- Uncheck "Strategy Enabled"
- Save configuration
- System returns to failsafe (open position)
Technical Implementation
File Structure
/RTC_System/
├── rtc.php # Web interface
├── rtc_scan.php # Main control engine
├── rtc_scripts.php # Helper functions
├── rtc.dat # Configuration storage
├── PWD/PWD.dat # Password file
└── adjusted_databases/
└── Pond_1_Depth.csv # Sensor data
Data Flow Architecture
Sensor → CSV File → Data Validation → Moving Average → Control Logic → Decision → API Command → Actuator
Scanning Schedule
- Frequency: Every 10 minutes
- Process: rtc_scan.php called via cron job
- Actions: Read data, calculate averages, make decisions, execute commands
This manual covers the BOSL RTC system as configured for Pond_1 operations. For additional configurations or advanced features, consult the technical documentation or contact system support.