Automated Coffee Machine

Download Report

Transcript Automated Coffee Machine

Automated Coffee Machine
Group Members:
Billy Whitehouse
Matthew Bitterman
Jamie Cochran
code.google.com/p/automated-coffee-machine/
Main Purpose


This is a SpecC implementation of a fully
automated coffee machine. The main
features include: built-in grinder, automatic
water filler, auto-on clock, auto-off timer.
A creative component will investigate the use
of Ethernet controller IP to add remote
access to the coffee machine.
Project Status

Part A
–
–
–

Create Website: Completed
System Modeling: Completed
Refinement: Completed
Part B
–
–
Create SystemC Model: In-Progress
Creative Component: Completed
Top Level Diagram
Coffee Machine Components



Main Controller
Clock Controller
LCD Controller
Main Controller

The main controller contains:
–
–
–
The main state machine
The water flow control
The grinder control
Main Controller Chart
Main State Machine





Begin brewing when the “On” event is triggered in
the clock controller
Initiate the brewing process (signals the grinder
controller and water flow controller)
When the water flow and grinder are complete start
the water heater
When the water heat process completes signal that
the brewing is done (will start auto-off timer
Keep the coffee pot burner on until the “Off” event is
triggered from the clock controller
Main State Machine Diagram
Water Flow and Grinder Control


The water flow controller uses the cups to brew and water level
inputs to control the water flow mechanism. Once the water
level equals the number of cups to brew the water flow
mechanism is disabled.
The grinder uses the cups to brew, brew strength, and coffee
grounds weight inputs to control the grinder. The formula to
calculate coffee ground weight (in tenths of ounces) is as
follows:
cups_to_brew * 2 * brew_strength
where brew_strength is 1-weak, 2-regular, 3-strong
For example, to brew 6 cups at regular strength the amount of
coffee grounds would be: 6*2*2 = 24 or 2.4oz (about 4.8
tablespoons)
Clock Controller

Handles all timing related functions
–
–
–

System Time (Clock)
Auto-On feature
Auto-Off safety feature
Triggers the LCD to update display
information
Updating System Time


The main dial can be set to edit_time value
to change the system time
When the update hour/minute event is
triggered, the hour/minute is incremented
with the minute being modulus 60 and hour
modulus 24
Updating Auto-On Time


The main dial can be set to edit_auto_on
value to change the auto-on time
When the update hour/minute event is
triggered, the hour/minute is incremented
with the minute being modulus 60 and hour
modulus 24
Updating Auto-Off Time



The main dial can be se to edit_auto_off
value to change the auto-off time
When the update minute event is triggered,
the minute is incremented with the minute
being modulus 60
When the update hour event is triggered the
hour is incremented with the hour modulus 7
(this makes the auto-off time a maximum of 7
hours)
Clock Control Functionality



If the edit_time/auto_on/auto_off bit is
asserted, go to the corresponding state and
wait for the update_hour/minute signals to
toggle
If the auto_on_en bit is set, go to the
corresponding state and wait until
system_time == auto_on_time
Once equivalent, notify auto_on
Clock Control Functionality (cont.)



Once in the run_state, wait until brew_done
triggers or on_off deasserts
In the auto_off state, a down counter is
loaded with the auto_off time in seconds
shuts the machine off when the counter
equals zero.
Return to the idle_state until more coffee is
needed (approx. 30 min. for engineers)
Clock Control State Machine
LCD Control





Actual hardware would require an LCD display to
present the 4 digit time. For the SpecC models we
implemented a display driver which updates the
terminal window with the user interface status.
Updates the display with the selected time (system
time, auto-on time, or auto-off time)
Displays the selected cups to brew
Displays the selected brew strength
Displays the state of the coffee machine (brewing,
on, off)
Example Displays
Time: 12:00 PM
Off
Cups: 1
Strength: Regular
Status LED: Off
Input:
Time: 12:13 PM
On
Cups: 12
Strength: Strong
Status LED: On
Brewing Status ------------- Grinder: On Water Flow: Off Water Heater: Off
Input:
Time: 12:30 PM
Set Auto On
Cups: 1
Strength: Regular
Status LED: Off
Input:hour 2
Time: 12:16 PM
On
Cups: 12
Strength: Strong
Status LED: On
Brewing done. Warming coffee pot.
Input:main 4
Coffee Machine Testbench

The testbench has been created. It
includes the models:
–
–
–
–
–
–
–


grinder mechanism (coffee ground weight
sensor)
water flow mechanism (water level
sensor)
water heating mechanism
main dial control
cups dial control
strength dial control
hour/minute buttons
The testbench is controlled by
commands in the terminal.
Outputs from the DUT control the
mechanical testbench components
which in turn report data from their
sensors.
At the input prompt the valid commands are:

main #
–
–
–
–
–
–
0: Set Clock
1: Set Auto-On
2: Set Auto-Off
3: Off
4: Auto-On Enabled
5: On

cups #

strength #
–
–
–
–

will trigger the update_hour event the given # of times
minute #
–

1: Weak
2: Regular
3: Strong
hour #
–

1-12
Will trigger the update_minute event the given # of
times
exit
–
exit the simulation
Specification Model Connectivity
Specification Model Simulation
The specification model was
simulated with stimulus that
verifies the functionality of:






Setting the system clock,
auto-on clock, and the autooff time
Running with auto-on
enabled
Waiting for auto-off time to
be reached
Setting number of cups to
brew and the brew strength
Initiating brew process with
the On dial state
Turning off the machine with
the Off dial state
Architectural Exploration
We chose to look at three processing elements for the architectural refinement:



Motorola 68HC12
Motorola DSP56600
Hardware Standard
Processing Element Allocation


Based on the computations, memory usage, and number of connections of
each block we decided to allocate the HC12 processing element to the main
controller block. The HC12 micro-controller is designed for automotive and
home appliance electronics. This device will best fit the hardware needs for the
main controller.
The clock controller and lcd controllers require much more processing power
since they perform more computations and require much more memory.
Therefore, the Motorola DSP56600 processing element will be allocated to
those blocks.
Architectural Model


The behavioral and variable
partitioning based on the
architectural exploration resulted in
the following architectural model
Waitfor statements were added to
the SpecC behaviors to add
computation timing.
Architectural Model Simulation


The architectural model was simulated with the same
stimulus as the specification model.
The architectural model processing allocation looks like and
design quality reports are shown below:
SystemC Model

A SystemC model will be created for the
Automated Coffee Machine clock controller.
Creative Component
The Creative Component will investigate the use of Ethernet IP to add remote control to the
automated coffee machine.
Requirements

Provide a web interface which gives transparent access to the machine's controls

The Ethernet IP must be able to communicate of the internet via the TCP/IP protocol with at
least 10Mbps (minimum speed since 100BASE-T is more the standard) data transfer rate

The packets will be decoded and the coffee machine commands will be extrapolated by the
packet decoder. Such information includes:
–
–


clock updating
coffee machine controls (cups to brew, strength, and main controls)
A packet encoder will generate packets to be sent across the internet to the remote user
with the following information: Current time, auto-on time, auto-off time, cups to brew value,
strength value, and current state.
Manufacturer provided MAC address
Ethernet Subcomponents




Ethernet Driver
Ethernet Controller
Packet Decoder
Packet Generator
Ethernet Driver

The Ethernet driver is responsible for taking the data
and transmitting it according to the Ethernet protocol.
The means transmitting the data at the right
frequency but also the bus voltage levels. The
protocol would be handled between the Ethernet
controller and the packet generator. The voltage
levels for the bus could be integrated into the RJ-45
jack. If the right RJ-45 jack is included in the design,
the transformers as well as transmit/receive or
activity/link LED's are integrated and won't have to
be designed into the circuit.
Ethernet Controller

The ethernet controller would be a specialized piece
of hardware, such as Microchip's ENC28J60. There
are many devices like this on the market with either
a parallel or serial interface. They typically have an
interrupt or wake-on-LAN (WOL) pin that alerts the
microcontroller that activity has occurred. They also
contain some on-chip memory for data coming or
going out across the ethernet bus.
Packet Decoder

The packet decoding would have to be a very
specialized behavior or module that would
monitor the ethernet controller. Once the
ethernet controller interrupted the packet
decoder, it would read the data out of the buffer
on the ethernet controller and decode the data
packets and make the necessary changes to the
coffee machine's setup. Since the ethernet
controller would strip off all parts of the frame
except the payload, the decoder would need to
just parse the payload from the ethernet frame
and write the new data to the variables.
Packet Generator

The packet generator is what would be running the
web interface. This would send the sensor data or
current setup to the user's web browser where they
would be able to click buttons or make their selection
to what they want the machine to do. Once the user
clicks the submit button or something of the like, the
data would get sent back to the ethernet controller
which would then alert the packet decoder via
interrupt or WOL. Since the current setup has very
minimal variables, the payload would have to utilize
data padding to meet the 46-byte minimum payload
transmission specified by 802.3.
Tasks to Complete

Simulate the SystemC clock controller model.
Questions/Resources


Please email [email protected] with any
questions
Visit the project webpage at:
http://code.google.com/p/automated-coffeemachine/
or through WebCT