Coursework Assignment
Design of a Washing Machine Controller (WMC)
Module Name: Further Electronic Design
Module Code: 6406ELE
Level: 6
Credit Rating: 20
Weighting: 100%
Introduction
The objective is to design the finite state machine for a washing machine. In this assignment, students are required to
- Understand the hardware elements of a typical FPGA;
- Analyze a hardware design problem and produce suitable design solution using state machine design, and practice with hardware description language;
- Simulate the behavior of the circuit;
- Synthesize and verify the design for FPGA hardware.
- Design the system with signal from sensors and actuators.
- Analyze a hardware design problem and produce suitable design solution using microcontroller and human/physical interfaces.
- Write program using assembly language for the microcontroller.
Learning Outcomes Assessed
LO1 Evaluate digital system design and integration including ALUs and FSMs.
LO2 Design, simulate, test and implement programmable logic based systems using VHDL.
LO3 Design and implement microprocessor based analogue and digital systems.
LO4 Design peripheral components for digital and analogue systems power supplies, bus structures, memories and interfacing/signal processing circuits.
This assignment will assess elements of the above learning outcomes.
Coursework Specification
This coursework contains parts.
Part A: (30%)
In this part, you are required to design a washing machine controller (WMC) using a Finite State Machine (FSM). The machine follows the sequences through the following 4 stages:
Soak → Wash → Rinse → Spin
To simplify your design, you can assume the transition between two stages is achieved by pressing one push button. You can also use some of the LEDs as the indicator for the current stage. Finally, your design should be simulated in Xilinx VIVADO software using VHDL.
Part B: (50 %)
You are required to re-design your washing machine controller (WMC) using a Finite State Machine to achieve a more complex system. As a minimum requirement, the machine follows the sequences through the following 4 stages:
Soak → Wash → Rinse → Spin
There is a “double wash” switch, which, if turned on, leads to a second wash and rinse cycle to occur. In other words, the “double wash” switch causes the following 6-stage sequence:
Soak → Wash → Rinse → Wash → Rinse → Spin The amount of time for each stage is as below:
Soak: 1sec; Wash: 3sec; Rinse: 5sec.
You should use the 100 MHz clock signal as the clock signal of your state machine to control the timing of cycling, and to display the time on the 7-segment display units.
You should implement the design in Xilinx VIVADO and simulate and verify the functionalities. Use some of the 8 LEDs as the indicator of the current stage. Also you can use push buttons to simulate laundry token deposition and the “double wash” switch.
You are encouraged to improve your design to build a more realistic washing machine controller. For example, in practice, for safety consideration, if the lid of the machine is raised during the spin stage, the machine needs to stop spinning immediately until the lid is closed. The on-board switch needs to be selected and used as the input to start/stop the Washing machine. Add more functions to your design such as temperature sensor and control, level sensor and control, washing load selection, different washing programs, etc. You are encouraged to research the technical details of different sensors, actuators, motor signals, and their control and interfaces.
You should design the washing machine controller in VHDL.
Part C (20%):
You are required to re-design your washing machine controller (WMC) using an embedded PicoBlaze microcontroller together with the signal from sensors and actuators. You are required to implement your design by writing program for the microcontroller with the Assembly language. Your design should be simulated in the Xilinx VIVADO software.
The washing machine controller should include the following functions:
- The machine follows the sequences through the following 4 stages. 4 LEDs should be used to indicate the current stage of the washing machine.
Soak → Wash → Rinse → Spin
- Actuator: the actuator is a single-phase motor, which will be used to drive the turbo drum in the washing machine in practice. The microcontroller outputs the driving signal and feeds to driver circuit and then to the motor. The motor should be controlled as below:
- Soak stage: the motor stops for 5 seconds.
- Wash stage: the motor keep rotating for 10 sec with a spin in one direction and a speed of 800 rpm. Afterwards, it stops for 3 seconds and then resumes rotation in opposite direction. This loops for 3 minutes in total.
- Rinse stage: the motor keep rotating for 30 seconds with a spin in one direction and a speed of 1000 rpm.
- Spin stage: the motor keep rotating for 1minute with a spin in one direction and a speed of 2000 rpm.
- Sensor and display: In this project, you should include the speed sensor interfaced to the microcontroller. Microcontroller reads the speed of the motor and display on the 7-seg display.
- When the lid is open, the system should not work. If door is accidentally opened in between washing operations, then the system should stop working in minimum possible time (<3s).
- Suitable type of switch needs to be selected and used as the input to start/stop the Washing machine.
You are encouraged to improve your design to build a more realistic washing machine controller.
Part A
Top
--Part_A.vhd
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY Part_A IS
PORT(
CLK:IN STD_LOGIC;
START:IN STD_LOGIC;
STOP:IN STD_LOGIC;
BUTTON:IN STD_LOGIC;
LED:OUT STD_LOGIC_VECTOR(3 DOWNTO 0)
);
END Part_A;
ARCHITECTURE Part_A_ARCH OF Part_A IS
TYPE STATETYPE IS(SSTOP,SOAK,WASH,RINSE,SPIN);
SIGNAL STATE:STATETYPE;
BEGIN
PROCESS(CLK)
BEGIN
IF CLK'EVENT AND CLK = '1' THEN
IF STOP = '1' THEN
STATE<=SSTOP;
LED<="0000";
ELSIF STOP='0' THEN
CASE STATE IS
WHEN SSTOP=>
IF START='1' THEN
STATE<=SOAK;
LED<="0001";
END IF;
WHEN SOAK=>
IF BUTTON='1' THEN
STATE<=WASH;
LED<="0010";
END IF;
WHEN WASH=>
IF BUTTON='1' THEN
STATE<=RINSE;
LED<="0100";
END IF;
WHEN RINSE=>
IF BUTTON='1' THEN
STATE<=SPIN;
LED<="1000";
END IF;
WHEN SPIN=>
IF BUTTON='1' THEN
STATE<=SSTOP;
LED<="0000";
END IF;
END CASE;
END IF;
END IF;
END PROCESS;
END Part_A_ARCH;
Testbench
--Part_A_test.vhd
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY Part_A_test IS
END Part_A_test;
ARCHITECTURE Part_A_test_arch OF Part_A_test IS
COMPONENT Part_A
PORT(
CLK:IN STD_LOGIC;
START:IN STD_LOGIC;
STOP:IN STD_LOGIC;
BUTTON:IN STD_LOGIC;
LED:OUT STD_LOGIC_VECTOR(3 DOWNTO 0)
);
END COMPONENT;
SIGNAL CLK:STD_LOGIC := '0';
SIGNAL START:STD_LOGIC := '0';
SIGNAL STOP:STD_LOGIC := '0';
SIGNAL BUTTON:STD_LOGIC := '0';
SIGNAL LED:STD_LOGIC_VECTOR;
CONSTANT CLK_PERIOD : TIME := 1 ms;
BEGIN
UUT: Part_A PORT MAP(
CLK => CLK,
START => START,
STOP => STOP,
BUTTON => BUTTON,
LED => LED
);
CLK_PROCESS :PROCESS
BEGIN
CLK <= '0';
WAIT FOR CLK_PERIOD/2;
CLK <= '1';
WAIT FOR CLK_PERIOD/2;
END PROCESS;
STIMULUS: PROCESS
BEGIN
WAIT FOR 1 ms;
START <= '1';
WAIT FOR 1 ms;
START <= '0';
BUTTON <= '1';
WAIT;
END PROCESS;
END Part_A_test_arch;
Schematic
Simulation
Encouraging simulation based on your own needs, so I won't show any pictures here.
To be continued
The follow-up code is currently being coded. Please subscribe so that you can get the latest code in time.
I will publish Part B after the deadline.Part C will be provided with partial code,because it's the main code for me to get pay.
。