project3 team3 - CourseReps/ECEN489-Fall2015 GitHub Wiki
#Project 3- Team 3 ##Members:
- Kaimen Walters
- Steven Jinpeng You
- Hai Li
- Pranay Eedara
Overview
The purpose of project3 is to calculate the volume of an object dropped in a single tank water-level management system and to build a water level controller for the coupled tank system. This project is built upon project2. Both cases involve the following tasks 1. Fabrication of the custom designed PCB 2. Mathematical modelling and simulation of the systems to test the feasibility of the algorithm and to get the desired PID coefficients (in this case, slow rising time and less damping ratio). 3. Building test rig and calibration of the sensors 4. Qt interface for visualizing water level, flow rate and state of the system
1. PCB Design
This PCB was not used for the final design.
###2. Mathematical Models of the Systems
Single Tank System:
FlowChart:
Pseudo Code:
####Coupled Tank System:
Model Equations
#####Basic formula:
K is a constant. V1 is the voltage of the pump1. C1, C2 are constants. A1 and A2 are areas of the
leaky hole1 and leaky hole2 respectively. H1, H2 are heights of the reservoirs.
#####Flowchart:
#####Pseudo code:
###3. Simulation Results
a) Volume Measurement
b) Coupled Tank
###4. Test Rig
###5. Calibration of the Sensors
IR sensor calibration
IR sensor is calibrated by measuring the range of IR sensor values at different water levels. IR sensor value at a particular water level is obtained by averaging out the 10 IR sensor values taken at 10 ms delay.
Flow sensor calibration
Flow sensor coefficient (i.e.,ml/rising edge) is obtained by counting the rising edges received from flow sensor to pump 500 ml of water at different voltages. Flow rate from hall sensor is calculated by multiplying the total number of rising edges received in one second with millilitres per rising edge.
The flow sensor is calibrated by measuring the flow rate at different voltages. A linear first degree polynomial that fits the data points has slope 4.51 and intercept of 3.
Outflow calibration
Flow rate through the leaky hole is measured at different water levels and an increase of about 2 ml/sec is observed as the height increases by 1 cm.
##6. Qt interface for Volume Measurement
The values and status of the water level system is displayed on the Qt display:
The water level and setpoint is shown to indicate if steady state is reached, by calculating the difference between current height and setpoint height, and when the system is ready for the object to be dropped.
When the object is dropped the height of the water level is observed and the pump is then triggered to stop to wait for the water level to fall back to setpoint height. When the water reaches the setpoint threshold once again, the calculation for the volume is then executed.
The height of the water level at any given time is measured as the blue plot while the setpoint is the green plot. Steady state is reached when the difference between the 2 heights are within 10 points, millimeter precision, and retains that height over a period of 10 readings.
The flowrate is measured at all times below the height chart which will help visually display the measured flowrate before, during, and after the object is dropped.
Setpoint is determined by adjusting the bar in the middle to the desired height. The height is measured from the bottom of the tub, 1 being 1 cm from the bottom, 2 is 2 cm from the bottom and so on. The values of the object's volume will be displayed on the lower right corner along with the other calculated values needed to determine the volume, providing as much data and info as possible.
Lastly the start and stop buttons are programmed to stop and start the system whenever the user desires.
###7. Volume Measurement of Object Dropped Volume measurement of the object dropped involves using the flowrate sensor paired with the IR sensor to create an add-on to the current system to compute the volume of any given object after placing inside the water rig. The calculations involve measuring the flowrate at steady state and then subtracting the steady flowrate with the measured flowrate after the object is dropped and multiplying it with the time taken to reach set point again. The difference of flowrates multiplied with the time taken represents the integral of flowrate * time. The accuracy of our imposed system was within 5-10% of the given volume.
Test Results
Given Volume | Measured Volume | Error |
---|---|---|
275ml | 246 ml | 10% |
130-140ml | 134 ml | 4-6% |
200ml | 194 ml | 3% |
The readings seemed to deviate slightly as the volume increases, however after adjusting the milliliter per tick value after recalibrating the flowrate, the numbers were much closer.