Close
0%
0%

Micro-PID Temperature Module

This is a small PID Temperature controller, designed to be a drop-in module on a parent board.

Public Chat
Similar projects worth following
This is a small PID Temperature controller, designed to be a drop-in module on a parent board. It utilizes a NTC Thermistor Probe, and outputs a 0-5 VDC control variable. Control is accomplished using an ATTiny 1614, using its internal ADC and DAC, with a buffered output. The intention of this device is to easily add PID control to a project. I will likely include accessory boards in the future for driving bigger loads, PWM control, interface, etc.

To Do

 [Hardware]

- Change from JST to pin headers for power.

- ICSP Pins changed to pin headers from IDC.

- Change footprint to consolidate headers.

- Add PWM / Analog selection switch.

- Add I2C and/or SPI connections for digital input.

[Software]

- Write PID loop software.

- Add mode selection for PID, PI, P controller types.

- Write interface library for display, buttons, encoders etc.

-----------------------------------------------------------------------------------------------------------------------------------

Useful Links

http://ww1.microchip.com/downloads/en/DeviceDoc/ATtiny1614-DataSheet-DS40001995B.pdf

http://ww1.microchip.com/downloads/en/Appnotes/TB3210-Getting-Started-with-DAC-90003210A.pdf

http://ww1.microchip.com/downloads/en/Appnotes/TB3209-Getting-Started-with-ADC-90003209A.pdf

-----------------------------------------------------------------------------------------------------------------------------------

Source Code:

[GitHub]

https://github.com/ZTStrohm/micro-pid/blob/master/

  • 1 × ATtiny 1614 SS Microprocessors, Microcontrollers, DSPs / ARM, RISC-Based Microcontrollers, SOIC
  • 1 × TLV 2372 Rail to Rail Opamp, SOIC
  • 1 × I/O Connector 1x8 2.54mm Header
  • 1 × uA7805 Power Management ICs / Linear Voltage Regulators and LDOs, SOT 223
  • 1 × NTC Thermistor Temperature Sensor, Value TBD

View all 11 components

  • Project Log # 3

    Zach Strohm10/01/2019 at 22:55 0 comments

    Hey everyone. After a frustrating day, I have finally been able to get the ATtiny 817 Xplained to program, however, I am having problems getting the DAC to work. In the mean time, while I try to get the DAC figured out, I implemented a PID algorithim in Arduino. I am taking measurements from a GY-521 IMU/Temperature Sensor, and outputting to PWM. At the moment, I do not really have a system to control, so I have just been changing the temperature with my finger, to warm the sensor up, and blasting it with an upside-down can of electronics duster to cool it down. 

    I should have an actual system to control soon, and will hopefully be able to use the Xplained board.

    In this image, the blue line is the measured variable (PV), and the red is the PWM value (CV). As always, if anyone has any questions, suggestions or critique, please feel free to comment.

  • Quick Update #1

    Zach Strohm09/30/2019 at 23:57 0 comments

    Hey everyone, I finally have some hardware to start testing things on. I am using the ATtiny817 Xplained Mini evaluation board from Microchip. The ATtiny 817 has the same architecture and assembly language as the ATtiny 1617, just with 24 pins, instead of 14. This board has included programming, debugging, and a serial com port over micro USB.

    I am hoping that this evaluation board will allow me to implement the system on it, before being uploaded to the Micro PID controller. You can check out the board here. As soon as I can get Atmel Studio to behave, I will try implementing a PID loop on the board.

  • Project Log #2

    Zach Strohm09/28/2019 at 15:43 0 comments

    In my previous project log, we discussed what a PID controller is, and the basics of how the project works. In this post, we will look at how to implement a PID controller in a microcontroller. In order to use the PID equation in a digital environment, we first must make a discrete-time model.

    We will first look at the integral operator.

    This is saying that the integral is equal to the sum of all previous error with respect to a sampling time.

    Next, we will look at the derivative operator.

    Using an approximation method known as backwards finite differences, the derivative can be approximated as the current error minus the previous error divided by the sampling time.

    But how do we implement this in code? This algorithm is surprisingly simple, as can be seen below:

    previous_error = 0
    integral = 0
    loop:
        error = setpoint – measured_value
        integral = current_error + cumulative_error*dt
        derivative = (current_error-previous_error)/dt
        output = Kp + Ki*integral + Kd*derivative
        previous_error = error
        delay(dt)
        return to loop
    

    There will be more updates in the future. I should be getting some hardware to work on soon. As always, feel free to ask questions, and make suggestions.

  • Project Log #1

    Zach Strohm09/28/2019 at 04:07 0 comments

    Hey everyone, I have decided to give a more detailed rundown of my project, and some underlying theory.

    The goal of this project is to create a PID temperature controller module for use in other projects. This board contains a sensor interface, control processor, and output interface. There are no physical user interfaces on this board, however control via serial, as well as options to interface with displays and buttons for programming will be available.

    So, what exactly is a PID controller?

    From Wikipedia:

    A PID controller is control loop mechanism employing feedback that is widely used in industrial control systems and a variety of other applications requiring continuously modulated control.

    It attempts to rectify the difference between the user's desired value (the setpoint) and a measured value (the process variable) by applying a correlation based on Proportional, Integral, and Derivative values (this is where the term, PID comes from). The PID controller can be modeled by the following equation:

    Read more »

View all 4 project logs

Enjoy this project?

Share

Discussions

Dan Maloney wrote 09/24/2019 at 15:43 point

I like the idea of plug-and-play PID. How will you provide for loop tuning? Directly on this board, or through whatever host you wire it into?

  Are you sure? yes | no

Zach Strohm wrote 09/25/2019 at 02:47 point

Tuning is intended to be provided primarily through the host. However, I plan on including tools for setting controller modes, parameter adjustment, and for tuning on the board itself via a serial connection to a PC.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates