Skip to content

PID does not work properly on my environment. #29

@zekageri

Description

@zekageri

First of all, thank you for this library. It is really a piece of art.
Probably Iam just stupid and can't use it properly.

My setup

  • ESP32-Wrover-E ( 16mb flash, 8mb psram )
  • Arduino environment
  • Quick PID
  • sTune
  • Modbus

The esp32 hosts a webpage where a user can create it's own zones ( rooms ) and can put heating controller inside it.
The user can pick which thermostat to use for which room and can select separate pins for the boiler start, valve open and pump circulation. He can also set how much time it takes for the valve to be opened fully, so the heating can begin and the pumps can circulate the water across the tubes.

This system is represented as separate classes in code.

  • A class for the thermostat which gets the measured temperature via modbus from the physical modul and contains the set temperature which a user can controll
  • A class for the boiler which will controll the boiler on/off state
  • A class for the pump(s) which will controll the pump start/stop and watches for the post circulation time expiration
  • A class for the valve(s) which will controll the valve open/close state and watches for the open time expiration
  • A heating which will controll the flow of the heating on a particular room

So it goes like this:

Heating loop will periodically checks if we can start to heat or not. For this it will ask the thermostat class which will decide based on the measured and set temperature. If it says we can heat, the heating system will start the process.

  • Starts to open the valves
  • After the valves are opened ( not known time, can take from 0 to 600sec ) gives a signal to the boiler to start to heat and starts the pumps

Meanwhile the heating system will periodically checks if the temp is on the set temp. If it is, ( +- hysteresis ) it will start the stop process

  • Takes away the boiler start signal
  • Wait for the defined amount of time to do a post circulation
  • After the post circulation done, it will stop the pump(s) and closes the valve(s)

It is working good, but now i want to give the user the option to be able to controll it with PID
For this i have created a wokwi project which tries to simulate my environmnet and for the life of me i can't figure out why it does not work.

Here is the wokwi simulation: https://wokwi.com/projects/357187661998047233

Do you have any suggestions? ( sorry for the long issue )

( meanwhile I will try to create a more representative simulation at wokwi )

Here is a more detailed simulation of my system.
https://wokwi.com/projects/357256912224692225
If you let the usePID variable false it will do a normal heating controll and controlls the temperature fine.
If you set it to true it will use the PID for temp controll.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions