Open ericdmoore opened 8 months ago
Perhaps want a heat, cool, collar mode?
Prioritize:
The decisions seem to really center on:
Goal Stack
Rough Estimate of the meta algorithm
Some goals might be to
Seems related to:
And potentially other types of control theory.
Consider looking for python packages or js packages that implement some type of solver for this style of problem
See #2 as related inputs and outputs
Heating alone is subject to PID controller style control problems.
Constraints
Isn't this a feedback loop with inputs of:
State(T-1) + ActionSet = State(T)
Then repeat indefinitely?
Kinda - it does not incorporate loss functions or maximization efforts to move the state towards an objective.
// Assume functions for sensing, prediction, and actuation are defined elsewhere function senseCurrentState() { // Returns current system state, e.g., temperatures, power levels }
function predictFutureStates(currentState, forecasts) { // Use models to predict future states based on current state and forecasts (weather, solar) }
function determineOptimalActions(predictedStates) { // Determine the best actions to take based on predicted states to achieve objectives // This could involve solving an optimization problem }
function actuateControls(actions) { // Apply the determined actions to the system, e.g., turning relays on/off }
function mainControlLoop() { while (true) { // Main loop const currentState = senseCurrentState(); // Get current system state const forecasts = getForecasts(); // Assume this function gets weather and solar forecasts const predictedStates = predictFutureStates(currentState, forecasts); // Predict future states const optimalActions = determineOptimalActions(predictedStates); // Determine optimal actions actuateControls(optimalActions); // Actuate controls based on optimal actions
// Wait for a specified interval before next loop iteration
// This wait time depends on the specifics of your system and control requirements
sleep(timeInterval);
} }
// Start the main control loop mainControlLoop();
Determine optimal actions
is the same as saying minimize error or maximize objective.
Perhaps the objective function includes terms like:
maximize the inside air degree-minutes below outside-ambient temperature.
But in actuality if it gave up on cooling during the hottest part of the day, and sand-bagged during the cooler parts - this would be an unsatisfactory outcome.
So potentially it's more like minimize the accumulated degree-minutes. Or Maximize the difference in projected vs actual accumulated degree minutes.
Predict future states - requires some model of what various actions will do to the state.
And model updating can happen after the sleep timer.
Where updatemodel(currentState, actionsToStart, actuallyHappenedState)
can all happen after the sleep and by sensing the state before the loop starts again.
Perhaps the sensor can be proxied through a memoize function to save time and battery.
Expected Schedule
Thermostat
Heating
Cooling
Water Cleaning
Lights
Interior + Exterior
Constraint Based Planning
Todays Work -vs- Todays Energy Forecast
Tomorrows Work -vs- Energy Forecast Some work is a function of ambient air temp. So might wish to pull that in too.
Tomo^2 Work -vs- Energy Forecast
...possibly looks out further
Base Cases
Today: Clear Sky, next 5 days - cloudy
Today: Cloudy; next 5: clear
Today: Clear; next 5: alternating cloudy/clear