+ All Categories
Home > Documents > Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level...

Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level...

Date post: 26-Jun-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
24
A Smart Burn and Spill Proof “SAFE” Microwave that spares the Salad: Novel Application of Levenberg-Marquardt Algorithms in Bayesian Analysis for Real- Time Numerical Thermodynamic Modeling By Muhammad Shahir Rahman
Transcript
Page 1: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

A Smart Burn and Spill Proof “SAFE” Microwave that spares the Salad: Novel

Application of Levenberg-Marquardt Algorithms in Bayesian Analysis for Real-

Time Numerical Thermodynamic Modeling

By Muhammad Shahir Rahman

Page 2: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

Problem Statements

• The use of heat is essential in household applications

• Many cooking apparatus, such as a microwave and oven are not intelligent and can often cause fires

• In fact, 42% of household fires are caused by cooking devices

• The goal is to create an intelligent microwave that can cook food to the correct adaptable target temperature profile with minimal user input.

Page 3: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

Intelligent Microwave

The internet connected computer sends data to the user wirelessly

IOT solutions provide remote control and full telemetry. The user is able to set the target temperature to his/her own preferences

A thermopile sensor array at the top of the microwave will detect food temperatures

User places food of any kind inside the microwave

Page 4: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

Cooking Apparatus

Cooking Device Body

Food Platter

Infrared Sensor Array

Page 5: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

1. Start by compiling the sensor data into an array 2. Rotate & Smooth the

data

5. And then calculate the target temperature

4. Iterate through each cell and calculate the viscosity

Food Pixel Concept & Algorithm

3. Take the food temperature data & compare it to the virtual graph

Extensive programming (with Python) work for computation has brought this idea to reality!

Page 6: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

DataLiquid Data

60

50

40

30

20

10

Time (Sec)

Tem

pe

ratu

re (

C)

1801601408040 60200 120100

Each line represents a pixel in the sensor array.

Platter data

Data from liquid food

0

70

60

50

40

30

20

10

050 100 150 200

Semisolid Data

Each line represents a pixel in the sensor array.

Platter data

Data from solid food

Time (Sec)

Tem

pe

ratu

re (

C)

Solid Data70

60

50

40

30

20

10

00 20 40 60 80 100 120

Each line represents a pixel in the sensor array.

Platter data

Data from solid food

Time (Sec)

Tem

pe

ratu

re (

C)

Page 7: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

Solve for Viscosity and Amount by optimizing Total

Squared Residual𝑅2 =

𝑡=0∞ (𝑇𝑑𝑎𝑡𝑎−𝑇𝑣𝑖𝑟𝑡𝑢𝑎𝑙)

2

Target Time Reached

Calculate Target Time using the Viscosity and

Amount from the virtual graph

Start warming and record initial temperature

Stop MicrowaveYes

No

Intelligent CookingProgramming Strategy:

• Create a virtual thermal profile in the microwave

• Optimize the total squared residual between the virtual profile and the thermopile data to minimum

• By Changing the viscosity, amount, initial temperature and/or other properties in the virtual food profile

Page 8: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

0 5 10 15 20 25 30 35 40

Po

we

r o

n/o

ff

Time (s) Sensor and Magnetron Duty Cycle

Sensor

Magentron

The electromagnetic waves generated by the magnetron severely interferes with the sensor’s data acquisition and the sensor cannot even survive for a second. At the same time, recovery of the sensor while it is ON takes too long. This difficult problem was solved by using a mutually exclusive duty cycle. In

addition to safeguard the sensor from a high voltage drop (𝑉𝐿 = 𝐿𝜕𝐼

𝜕𝑡) from

magnetron inductance the duty cycle was carefully controlled as shown below.

3 secSensor ON

6.6 secMagnetron ON

0.2 sec gap for sensor hysteresis recovery

Sensor Hysteresis & Radiation Management

Page 9: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

Internet of Things Microwave

Temperature Profiling Database

Algorithm

Machine Learning

Cloud Computer

Heat MapUser

Detection

Android Device

Target Temperature

Device Signature

Sensor

Socket Programming

Microwave

Magnetron

Lamp and Motor for Turntable

Internet Cloud

User Customization

Profile Settings

Target Temperature

User Preferences

Temperature Data

Sever Calculations

Calculations

Page 10: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

Targeted Pixel Based Heating (TPBH)

Targeted Pixel Based Heating or TBPH is one of the new innovations. Each temperature cell in the sensor array is interpreted as an individual food particle with its own separate properties. By targeting only specific pixels that need warming, we can all the food in the platter to the perfect temperate, warming the chicken and sparing the salad.

Page 11: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

State of Art ComparisonFeature Current State of Art My Innovation

# of User Input Parameters 1-4 0 required

Fire Safety

Unattended Cooking

Cooking Accuracy 60-90% (human error) 99%

Power Consumption Time is guessed, magnetron: usually stays on longer than needed

Magnetron only on as required (saves lot of power)

Temperature Preference Personalization

Food Auto Detection

Integration in to Cloud

Remotely Controller through Smartphone

Cost $50-400 Less than 17% increase for a high end microwave

Page 12: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

Intelligent Microwave

The internet connected computer sends data to the user wirelessly

IOT solutions provide remote control and full telemetry. The user is able to set the target temperature to his/her own preferences

A thermopile sensor array at the top of the microwave will detect food temperatures

User places food of any kind inside the microwave

Page 13: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

References1. Ahrens, M. (2015, November). Home fires involving cooking equipment. Retrieved February 5, 2016, from National Fire Protection Association

website: http://www.nfpa.org/research/reports-and-statistics/fire-causes/appliances-and-equipment/cooking-equipment

2. Ahrens, M. (2015, November). Home Fires Involving Cooking Equipment. Retrieved from National Fire Protection Association website: www.nfpa.org/~/media/files/research/nfpa-reports/major-causes/oscooking.pdf?la=en

3. Boyd, S. (2007). Regularized least-squares and Gauss-Newton method. Retrieved from Stanford University website: https://see.stanford.edu/materials/lsoeldsee263/07-ls-reg.pdf

4. Cowles, K., Cass R., & O'Hagan T. (n.d.). What is Bayesian Analysis? Retrieved from International Society for Bayesian Analysis website: https://bayesian.org/Bayes-Explained

5. Croeze, A., Pittman, L., & Reynolds, W. (2012, July 6). Nonlinear Least-Squares Problems with the Gauss-Newton and Levenberg-Marquardt Methods. Retrieved from https://www.math.lsu.edu/system/files/MunozGroup1%20-%20Presentation.pdf

6. Freund, M. R. (2004, February). The Steepest Descent Algorithm for Unconstrained Optimization and a Bisection Line-search Method. Retrieved from Massachusetts Institute of Techology website: http://ocw.mit.edu/courses/sloan-school-of-management/15-084j-nonlinear-programming-spring-2004/lecture-notes/lec5_steep_desce.pdf

7. Gavin, P. H. (2015, September 29). The Levenberg-Marquardt method for nonlinear least squares curve-fitting problems. Retrieved from Duke University website: http://people.duke.edu/~hpgavin/ce281/lm.pdf

8. Gratton, S., Lawless, A. S., & Nichols, N. K. (2007). Approximate Gauss-Newton methods for nonlinear least squares problems. Retrieved from University of Reading website: http://www.henley.ac.uk/web/FILES/maths/09-04.pdf

9. Ranganathan, A. (2004, June 8). The Levenberg-Marquardt Algorithm. Retrieved from http://ananth.in/docs/lmtut.pdf

10. Rao, M. A., Rizvi, S., Datta, A. K., & Ahmed, J. (2014). Engineering Properties of Foods (4th ed.). Retrieved from https://books.google.com/books?id=2FnOBQAAQBAJ

11. THERMAL PROPERTIES OF FOODS. (2006). In 2006 ASHRAE Handbook — Refrigeration. Retrieved from http://pcfarina.eng.unipr.it/Public/Termofluidodinamica/Utility/Tabelle%20Alimenti.pdf

12. Vandenberghe, L. (2011). Nonlinear least-squares. Retrieved from University of California, Los Angeles website: http://www.seas.ucla.edu/~vandenbe/103/lectures/nlls.pdf

13. Vandenberghe, L. (2015). Nonlinear least-squares. Retrieved from University of California, Los Angeles website: http://www.seas.ucla.edu/~vandenbe/133A/lectures/nlls.pdf

14. Weisstein, E. W. (n.d.). Bayesian Analysis. Retrieved from Wolfram MathWorld website: http://mathworld.wolfram.com/BayesianAnalysis.html

15. Weisstein, E. W. (n.d.). Method of Steepest Descent. Retrieved from Wolfram MathWorld website: http://mathworld.wolfram.com/MethodofSteepestDescent.html

Page 14: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

Scan this QR code for more Information!

Thank You

Page 15: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

FULL STEPTwo phases

at a timeStrongest

Torque

2 3 4 5 6 7 81

Stepper motor allows optimum control of rotation at high heat points for denser food sections

Stepper motor can step through its rotation at any given multiple of step (3.75 degrees) and turn in any direction.

3.75 Step angel for extra precision rotation

Asymmetric high heat areas

in cabin

High viscosity

Low viscosity

Asymmetric density of

Food sections

How to skip the Salad!

Page 16: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

Bayesian Food Characteristics Algorithm

Data from a single pixel of sensor

Real-time Heat Map from Sensor

Profile from the data (blue) is compared to that of the algorithm (red)

Using a specific viscosity and amount from the algorithm, the matching temperature profile is generated by interpolation of the profiles in the database as in a machine learning technique

Algorithms

Studied

Timing Results

Nelder-

Mead

10 loops, best of 3:

37.8 ms per loop

Powell 10 loops, best of 3:

26.5 ms per loop

CG 10 loops, best of 3:

404 ms per loop

BFGS 10 loops, best of 3:

48.6 ms per loop

L-BFGS-B 10 loops, best of 3:

46.1 ms per loop

TNC 10 loops, best of 3:

28.3 ms per loop

SLSQP 10 loops, best of 3:

23.2 ms per loop

COBYLA 100 loops, best of

3: 16.1 ms per loop

Differential

Evolution

10 loops, best of 3:

275 ms per loop

LM-LSQ 100 loops, best of

3: 7.82 ms per loop

Algorithm ProfileLM-LSQ is Levenberg

Marquardt Least Squares Method

Page 17: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

The Cheese Experiment

Normal standing heat pattern

Oven inverted heat pattern

Page 18: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

Functions Management and Thread Synchonization

Data collection involves four main components: Sensor, Edison, Network socket, & Algorithm with Python code

Bayesian Predictive Model

Generate Heat Map Image

EdisonThread 1

Threaded/Pipeline Mgmt.

LM-LSQ Optimization

Relay Calculations back to Edison

Target Determination

Broadcast data for Smartphone app

Data Acquisition

Bidirectional Socket Data Send

Server ACK

Dynamic Filtering

Cloud Server Task Delegation

EdisonThread 2

ServerThread 1

Asynchronous Data Recv.

ServerThread 2

ServerThread 3

Receive Phone Signature

Deviate Results using User Settings

Loop

Loop

Loop

Loop

Loop

Recv. Calculations from Server

Stop Microwave if Needed

Receive User Target Settings

Pipeline Mgmt. for Algorithm

Asynchronous Data Buffering

Page 19: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

Journey to the Current Platform• Started with Galileo

– Inadequate and non-native display

– computation speed

• Minnow board was suggested for better computation– Same problems as Galileo

• At NDG the Edison was a better choice, however challenges remain:– PySerial

– HID device and PyUSB

– Yocto linux

– I2C voltage level shifting

– New linux command line

– Limited documentation

• With all of these platforms I had to:– Start from scratch

– Port code base

– Deal with device specific driver issues

Page 20: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

Sensor Installation

First prototype was built with Melexis 16x4 sensor array EVB . However the aspect ratio was not optimal and communication was difficult and its radiation tolerance was very poor.

Eventually the Panasonic Grid-EYE, an 8 by 8 thermopile array with high accuracy and low cost was found. Communication with was also simple (both I2C & USB) and this is the current solution in the microwave as demonstrated.

Numerous low-cost, low-resolution, high accuracy thermopile sensor were investigated for to put inside the microwave

Page 21: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

Magnetron Waves Exit

Standing Waves

In a microwave oven, standing waves emitted from the magnetron are emitted horizontally which creates uneven heating. To correct this the platter is rotated for homogenous heating. However, if the rotation of the microwave was controlled intelligently, this unevenness could be utilized for selective heating as explained in the TPBH section.

Water dipole heating

Microwave Heating Characteristics

Page 22: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

Microwave Edison Setup

Yocto Poky Linux on Edison

ComputationalLibraries

Scipy

Matplotlib

Numpy

Socket

Pyserial

Libmraa

I/OLibraries

Microwave Programs

Python Interpreter

11 Digital Pins + 2 I2C Data Pins

5 Analog Pins

Sensor

MagnetronLamp and Turntable

Page 23: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

Mathematical ConceptsThe Levenberg-Marquardt algorithm at its core is a trust-region algorithm that interpolates between the gradient descent method and the Gauss-Newton method.

Gradient Descent

Gauss-Newton

The Gradient Descent Method is based on the observation that if the multi-variable function 𝑓(𝒙) is defined at differentiable in the neighborhood of a point at a certain point, then 𝑓(𝒙) decreases fastest in the direction of the negative gradient−𝛻𝑓(𝒙). Therefore, it follows that with an initial guess 𝒙0, an iterative method can be produced for the next point to minimize 𝑓(𝒙): 𝒙𝑛+1 = 𝒙𝑛 − 𝛾𝛻𝑓(𝒙𝑛)(assuming 𝛾 is a small value such that 𝛾 > 0)

The gradient (a multidimensional derivative) of the function f(x,y) = −(cos2x + cos2y)2

depicted as a projected vector field on the bottom plane.

The Gauss-Newton Method on the other hand tries to minimize the sum of squared residuals. The algorithm is given 𝑚 functions (residuals) 𝒓 = (𝑟1, 𝑟2, … 𝑟𝑚) of 𝑛 variables 𝒙 = (𝑥1, 𝑥2, … 𝑥𝑚)where 𝑚 ≥ 𝑛, and the sum of squares is minimized: 𝑟(𝒙) 2 = 𝑖=0𝑚 𝑟𝑖

2 (𝒙). Rather than calculating second-order derivatives or the Hessian matrix, the method uses 𝑟(𝒙), and its derivative, the

Jacobian (𝐽𝑟)𝑖𝑗 𝒙 =𝜕𝑟𝑖(𝒙)

𝜕𝒙𝑗. Using the

Jacobian, 𝑟(𝒙) is linearized at current iteration 𝑛 given an initial guess 𝒙0:

𝑟 𝒙 ≈ 𝑟 𝒙𝑛 + 𝐽𝑟 𝒙𝑛 𝒙 − 𝒙𝑛= 𝐴𝑛 𝒙𝑛 𝒙 − 𝑏𝑛(𝒙𝑛)𝐴𝑛 𝒙𝑛 = 𝐽𝑟 𝒙𝑛 ,𝑏𝑛 𝒙𝑛 = 𝐽𝑟 𝒙𝑛 𝒙𝑛 − 𝑟 𝒙𝑛

The next iteration is found by minimizing the sum of squares

𝑟(𝒙𝑛+1)2 ≈ 𝐴𝑛 𝒙𝑛 − 𝑏𝑛(𝒙𝑛)

𝟐

Page 24: Microwave that spares the Salad: Novel Application …...–Yocto linux –I2C voltage level shifting –New linux command line –Limited documentation • With all of these platforms

Rotation Algorithm

As the plate rotates, the location of each of the food pixels relative to the initial grid changes, and that is tracked through each data collection

Raw data as is. Spikes exist because in some positions, the sensor senses food, in other times it senses the plate

The rotational tracking is applied to help compensate. However, some errors still do occur.

Finally smoothing is applied, eliminating all of the rest of the spikes.

Time 0 Time 1 Time 2

Each line is a pixel in the sensor array


Recommended