Unit 5
Unit 5
2. What is a motor driver? A motor driver is a little current amplifier. The function of motor
drivers is to take a low current control signal and then turn it into a higher current signal that
can drive a motor.
3. Define RTC : A real time clock is a computer clock that keeps track of the current time even
when the computer is turned off. Real Time Clock (RTC) runs on a special battery that is not
connected to the normal power supply.
4. Write in brief about the PIC microcontroller: PIC (Peripheral Interface Controller) is a
family of Harvard Architecture microcontrollers made by Microchip Technology. It has an
in-built PWM generator, which is very useful to control the motors.
5. What is Smart Card? : Smart Card stores and processes information through electronic
circuits embedded in the silicon in a plastic substrate body. It is a portable and tamper-
resistant computer. It carries both processing power and information.
6. Define class and objects. Class: A class is a user-defined type or data structure declared
with keyword class that has data and functions as its members whose access is governed by
the three accesses specifies private, protected or public. Class is a collection of data member
and member function Object: Object is a class type variable, objects are also called instance
of the class. Each object contains all members declared in the class.
2. Case study:
1. Washing Machine
Start
Water
Switch
Value
Water
Selector Heater
Dial
Water
Pump
Water
level
Drum
Washing Motor
Temperature
Machine
sensor Detergent LED or LCD
Controller
Hatch
indicators
Hardware Design:
PIC18F452 is a heart of the system. Most of the peripheral features have been
utilized to implement the design. Controlling the motor is very crucial part of the design.
The PWM feature of the microcontroller controls motor speed. PWM output is feed to
driver circuit and then to motor.
To rotate the motor in two different directions forward and reverse direction,
control blocks are used. Motor speed sensor is interfaced to microcontroller.
Microcontroller reads the speed of the motor and approximately controls the speed of the
motor in different phases of washing using PWM output. Door sensor, pressure sensor,
keypad are also interfaced to microcontroller. EEPROM and RTC are interfaced to MSSP
module of controller. In-circuit serial programming facility is provided for quick and easy
programming and debugging.
.
Washing machine parameters are stored in external EEPROM and internal EEPROM of
the PIC.
RTC (Real Time Clock) is interfaced to SPI (Serial Peripheral Interface) port of the
microcontroller. It is used as a timing reference for all timing calculation of machine.
Door sensor is connected to external interrupt 0. High priority is assigned to this
interrupt. Thus opening of the door causes triggering of INT0 and INT0 ISR immediately
to stop the machine and informs the user
Keypad is connected to port D. when any of the keys is pressed; output becomes high
and INT1 triggers. Int1 ISR does a keypad scan and approximately performs the
operation.
Motor speed sensor is given to T1, CLK which is an external clock input to timer 1 / timer
3. Timer is configured in counter mode for calculating the speed. Speed is calculated by
counting pulse output from the sensor for one second. Motor driver circuit determines
the direction of the motor corresponding to the output obtaining from the
microcontroller.
Speed of the motor is controlled by the PWM generation from the microcontroller. The
duty cycle of PWM pulses are changed according to the output obtained from the speed
sensor to maintain the desired response during wash cycles. Dedicated LCD with 3 wire
interface is used, which consist of data line, clock and chip select. Backlight control is
also provided.
Software Design:
Software Design: A provisional list of functions that could be used to develop a washing
machine are:
Read_Select_Dial ( )
Read_Start_Switch ( )
Read_Water_Level ( )
Read_Water_Temperature ( )
Control_Detergent_Hatch ( )
Control_Door_Lock ( )
Control_Motor ( )
Control_Pump ( )
Control_Water_Heater ( )
Control_Water_Valve ( )
Frame Work:
1. System states – Initialization, start, fill drum, heat water, Wash 1, Wash 2,
Error.
2. User defined data – a) Maximum Fill duration – 1000 seconds. b) Maximum
water heat duration – 1000 seconds. c) Maximum wash 1 duration – 3000 seconds.
Functions involved in each state or function call
Initialization:
Control_Motor (OFF)
Control_Pump (OFF)
Control_Water_Heater (OFF)
Control_Water_Valve (OFF)
Read_Select_Dial (ON)
Now switch on to start state.
Start:
Control_Door_Lock (ON)
Control_Water_Valve (ON)(ON)
Control_Detergent_Hatch
Now switch on to fill drum state.
Fill Drum:
Read_Water_Level (ON)
Control_Water_Heater (ON)
Now switch on to either heat water state or Wash 1 state depending upon the
condition.
Heat Water:
Read_Water_Temperature (ON)
ACC system measurements of front end car range, distance and error estimations and adaptive
control can be modeled by two class diagrams of abstract classes, Task_ACC and Task_Control
1.Task_ACC is an abstract class from which extended classes like
Task_Align,Task_Signal,Task_ReadRange, Task_RangeRate and Task_Algorithm are derived to
measure range and errors.
Display panel
Port devices-Five port devices are
Port_Align,Port_Speed,Port_ReadRange,Port_Throttle and Port_Brake
ACC Software Architecture
For the ACC systems Basic Conformance Class I (BCCI) is used.The following table
lists the BCCI tasks,functions and IPCs
Synchronization Model
1. The task,task_Align sends the signal to a stepper motor port Port_Align and
6.task_Algorithm runs the main adaptive algorithm.It gets inputs from task_RangeRate and
outputs are events to Port_Throttle and
actuator stepper motor.
3.Discuss the Case study of smart card system. Smart card stores and process
information through electronic circuits embedded in the silicon in a plastic substrate body.
It is portable and tamper resistant computer. It carries both processing power and
information.
Smart card has an embossed area on one face and magnetic stripe on other, it defines
by ISO7816 standard. To communicate with the outside world, Smart card is placed inside
a card Acceptance device.
Requirements:
Assume a contact less smart card for bank transactions. Let it not be
magnetic. Requirements of Smart card communication system with a host are .
1.Purpose: Enabling authentication and verification of card and card holder by a host and
enabling GUI at host machine to interact with the card holder / user for the required
transactions: for example, financial transactions with a bank or credit card transaction.
2. System Functioning:
1. The cards inserts at host machine. The radiations from the host activate a charge
pump at card.
2. On power up, system reset signals reset task to start. The reset task sends the
messages - request Header and request start for waiting task. task_ReadPort.
3. task_Read Port sends requests for host identification and reads through the
port_IO the host - identification and reads the request start from host for card
identification.
4. The task_PW sends through Port_IO the requested card identification after
Receives header and messages at IO Port_IO from host through the antenna.
3. Host authentication request start message to task_Read Port from reset Task to enable
request for Port_IO
4. User PW verification message (notification) through Port_IO from host.
5. Card application close request Applcase message to Port_IO
5. Outputs:
6. Control Panel:
No control panel is at the card. The control panel and GUIs activate at the host
machine.
7. Design Metrics:
1. Power source and dissipation: Radiation powered contact - less operation.
2. Code Size: Code size generated should be optimum. The card system memory
needs should not exceed 64 KB Memory.
3. File System(s): Three layered file system for the data. One file for the master file
to store all file headers. A header has strings for file status, access conditions and
file-lock. The second file is a dedicated file to hold a file grouping and heads. The third file
is the elementary file to hold the file header and file data.
4. File Management: There is either a fixed length file management or variable file
length management with each file with a predefined offset.
5. Micro controller hardware: Generates distinct coded physical addresses for the
program and data logical addresses. Protected once writable memory space.
6. Validity: System is embedded with expiry date, after which the card authorizations
through the hosts disable.
7. Extendibility: The system expiry date is extendable by transactions and
authorization of master control unit.
8. Performance: Less than 1s for transferring control from the card to host machine
9. Process Deadlines: None.
10. User Interfaces: At host machine, graphic at LCD or touch screen display on LCD and
commands for card holder (card user) transactions.
11. Engineering Cost: US $ 50,000 (assumed)
12. Manufacturing Cost: US $ 1 (assumed)
Tested on different host Machine versions for fail proof card-host communication.
Class Diagram:
An abstract class is Task Communication. The figure shows the class diagram of
Task_Card communication. A cycle of actions and card - host synchronization in the card
leads us to the model Task_Card communication for system tasks. Card system
communication to host for identifying host and authentication itself to the host.
ISR1_Port_IO, ISR2_Port_IO and ISR3_Port_IO are interfaces to the tasks. The
task_Appl, taskPW, taskRead port and reset_Task are the objects of Task_appl,
Task_PW, Task_Read Port and Task_Reset, respectively. These classes are extended
classes of abstract class Task_Card communication.
Java mix is a new technology in which the native applications of the card run in C or C++ and
downloadable applications run in Java Card. The system OS and JVM both. Smart OS in an assumed
hypothetical OS in this example, as RTOS in the card.
Remember that a similar OS function name is used for understanding purpose identical
to MUCOS but actual smart OS has to be different from MUCOS. Its files structure in
different. It has two function as follows.
Following are the actions on the card places near the host machine antenna in a machine
slot.
Step 1: Receive from the host, on card installation, the radiation of carrier frequency or
clock signals in case of contact with the card. Extract charge for the system power supply
for the modem, processor, memories and port IO device.
Step 2: Execute codes for a boot up task on reset resetTask. Let us code in a similar way
as the codes for First task. The codes begin to execute from the main and the main