project2 team5 - CourseReps/ECEN489-Fall2015 GitHub Wiki

Project 2 - Team 5

PCB, SolidWorks, PID, Qt/Bluetooth

Members and Responsibilities

  • Cooper Rehn - PCB
  • Keaton Brown - Solidworks
  • Henry Xiangdong Yu - Qt/Bluetooth
  • Udaya Bhaskar Kothapalli - PID, Qt/Bluetooth

##PCB The PCB was created entirely in KiCad, from schematic through layout. The schematic was organized graphically into modular components using net names with local labels to easily see the function of each component, and how it connects to the Teensy. The Teensy and screw terminal blocks were both found in public libraries online here and here respectively. All other devices and footprints were found in the default libraries. There were enough connections added for up to two flow rate sensors as well as an RGB LED if the project gets to that point. Three status LEDs were added to the board to indicate power good, solenoid state, as well as a low water level warning. The power good LED turns on from a digital write on the Teensy, which means that the whole power chain is functioning correctly. The LED gets 3.3V from a Teensy DIO, indicating that its internal regulator is functioning because the Teensy is being powered from the 5V regulator, and the regulator takes its input from the 12V power in.

Schematic

Layout was done with an attempt to minimize board space. The 17 port screw terminal block was by far the longest component, making the board naturally oriented along it. The power traces were 40 mils, and all other traces were 20 mils, everything has a 20 mil clearance. The board was also laid out with an attempt to minimize the length of the +12V and +5V power traces, but the +5V trace stretched the length of the board to accomodate the Teensy and Bluetooth module. The status LEDs were set far from other components on one side of the board to make them easy to locate. 3 mounting holes were placed in order to accomadate standoffs from the 3D printed reservoir cap. A ground pour was made on both layers with proper thermal relief from pads for soldering. Gerber and drill files were generated and sent to the EIC for fabrication. Once fabricated, the components were soldered on, and the board was plugged in and tested for functionality.

Layout

The Kicad project files can be found on this GitHub at Students/Cooper95/Project2.

##SolidWorks In order to create a working reservoir we were given three different pieces of acrylic tubing 3.5in, 1.25in, and .375in in diameter. The 3.5in piece is to be used as the reservoir, the 1.25in piece is to be the support, and the .375in was used as a return tube for the liquid. The tubing alone cannot be use as a reservoir so I needed to make a top and bottom to the cylinder so that we could fill the apparatus with liquid. This was 3-d modeled in solidworks which we sent in to get 3d printed. The bottom piece I created is essentially a funnel. Besides being a cone shape a bracket was created in order to hold the support tubing. Funnel On the top of the cylinder I created a cap with another piece to hold the support tube. The cap has holes for the PCB standoffs as well as a slot for the infrared sensor and a hole for the return tube. The overall thickness of the material was 1.5mm. Funnel ##PID

A PID based water level controller was implemented. A PID controller calculates an 'error' value as the difference between a measured Input [IR sensor reading] and a desired setpoint [desired water level]. The controller attempts to minimize the error by adjusting an Output [PWM voltage to pump]. This adjusting of the output to drive the input towards a setpoint is achieved by 3 tuning parameters. They are:

  •  Proportionate gain - Kp 
    
  •  Intergral gain - Ki
    
  •  Differential gain - Kd
    

The rate at which the PID drives the input towards the setpoint depends upon the tuning parameters defined. Each application has its own optimal parameter values. For this project the PID gives optimal solution when the Kp, Ki and Kd are set to 2, 3 and 1 respectively. A setpoint of 6.5cm is initialized as a default and can be changed through the QT plot. In this project, the IR reading scale is used for both the input and setpoint and the output of the PID is the PWM value to control the motor speed.
The PID controller sketch project files can be found on this GitHub at Students/ubkthapalli/Project2/PID_code.

The three gain values were tuned using Ziegler–Nichols method and the updated gain values are:

  • Kp = 4.8
    
  • Ki = 1.5
    
  • Kd = 0
    

Qt/Bluetooth

The water level detected by using the IR sensor and the readings are transmitted to the Qt controller via Bluetooth. The Qt controller plots the readings and also saves them into a local SQLite database. The below is the GUI created using Qt.
QT Control Plot
We set a slider bar on Qt to change the setpoint in the PID contoller, which is the distance between the IR sensor and water level. To enhance the detection of the IR sensor, we put a EPS piece on the water. The overlook are as below: Simulation1
SImulation2