# Thermostat Kirdy incorporates a single channel thermostat circuitry like Sinara-hw [Thermostat](https://github.com/sinara-hw/Thermostat) with improved noise. It can deliver more than 9W of cooling/heating power with better than +-1mK temperature stability. ## Power Input If you use Kirdy with a PoE (IEEE 802.3af Class 3) PSE, Kirdy may experience power failure due to power limit. If you need more power on Thermostat, you can plug in additional Power supply on the 12V power Jack(Recommend: 12V 2A). Although the TEC Driver has a very high 165 degree thermal shutdown threshold, it is highly recommended to provide active cooling to the TEC Driving Circuitry. ## Control Mode Like Sinara-hw [Thermostat](https://github.com/sinara-hw/Thermostat), they both share the same control mode and algorithm, namely constant Current Control Mode ### Constant Current Control Mode You can drive a constant current to the load. The end user to connect an external control loop. If end user wants to use it with an external control loop, it is recommended to retrieve reports via the ActiveReportMode instead of polling status report for better consistency and higher maximum update rate. ### PID Control Mode Thermostat uses the [PID algorithm](https://hackmd.io/IACbwcOTSt6Adj3_F9bKuw) derived by Quartiq. The included Pid Autotune Algorithm can already achieve the specified +-1mK stability. During autotuning, Theremstat drives a user-specified step current into the load to calculate the pid parameters. Improper usage can damage the connected device. #### Important Notes 1. Configure all the protection mechanisms correctly before running the pid autotune algorithm. 2. Supervise the PID autotune process. 3. PID Autotune algorithm sometimes can produce unstable PID parameters. Do evaluate the PID performance after autotune is completed 4. For best performance, you should do the autotune with Kirdy installed in the environment that it is gonna be used. 5. If you are using the GUI, you need to set a high enough polling rate for PID autotune to function correctly. #### Usage Guide You can run pid autotune via the standalone auto 1. Target Temperature - Set it to the intended operating temperature for the connected device to operate in. You can still change temperature setpoint afterwards. 2. Test Current - Set it to the maximum recommended operating current specified on the TEC/Resistive load. 3. Update Rate - This can be set by configuring the filter settings in the Temperature ADC. High Update Rate can yield faster loop response with temperature regulation noise as the trade-off. Higher update rate can be useful if the load is actively cooled. 4. Temperature Swing - Lower value can damp the control loop response. 5. Lookback Period - Larger value can damp the control loop response. Do note that the larger lookback period also increases the autotune completion time. You can give your system a try with the following parameters. 1. Target Temperature: (User-Specified) 2. Test Current: (User-Specified) 3. Update Rate: 16.67Hz (Sinc5Sinc1 Filter with 50Hz and 60Hz Rejection) 4. Temperature Swing: 0 Degree 5. Lookback Period: 5s Once autotune is successful, you can improve its stability by increasing the lookback period. #### Troubleshooting If you obtain unstable PID parameters, 1. Check if the polling rate is close to the PID update rate. If not, increase the polling rate 2. Increase the lookback period and try again. If the autotune does not finish running or faikls, you should 1. Check if the thermostat has a hard time heating or cooling the connected device to the targe temperature. If yes, you should consider adjust the target temperature accordingly. 2. Check if the polling rate is close to the PID update rate. If not, increase the polling rate.