Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Recall the synchronous design of a cruise controller system from section 2.4.2 in Alurs book and Problem 3 in Homework Assignment 1. Consider the following

Recall the synchronous design of a cruise controller system from section 2.4.2 in Alurs book and Problem 3 in Homework Assignment 1. Consider the following requirement: when the cruise-controller is on, assuming the driver does not issue any further input events, eventually the speed becomes equal to the desired cruising speed and stays equal. Express this requirement in LTL using the variables on, speed, cruiseSpeed, cruise, inc, and dec.

prob 3 from assignment 1:

Problem 3 (40 points): In this problem, we will design a synchronous reactive component to set the cruising speed of a vehicle. This component corresponds to the SetSpeed component in the cruise-control system CruiseController.

The SetSpeed component takes the following inputs:

event(bool) cruise: This event models the user turning the cruise control on or off.

nat speed: This input models the speed input from the vehicle (corresponds to the current speed of the vehicle).

event inc: This input models the user requesting an increase in the cruising speed.

event dec: This input models the user requesting a decrease in the cruising speed. It has one output:

event(nat) cruiseSpeed: this output, if presents, contains the current cruising speed.

The component maintains two state variables: an enumerated type variable called mode = {on, off} that keeps track of whether the controller is turned on or off. a current desired (nat) speed s.

There are two constants called minSpeed and maxSpeed that we will use within the component. The operation of the component is as follows. The component updates the state variable on according to the following rule: every time the event cruise occurs, the variable mode is set to on. Then the component outputs the cruising speed using the cruiseSpeed output variable. If the current speed s is within the legal range minSpeed and maxSpeed, then the cruiseSpeed variable is set to s; if not, it is set to the closest legal value (i.e. minSpeed or maxSpeed). Also, when mode is on, if a dec event is received, then the cruising speed is decremented (restricting the lowest speed to minSpeed), and when the inc event is received, the cruising speed is incremented (restricting the highest speed to maxSpeed). If the mode variable is set to off, all input events except cruise are ignored, and there is no output.

a. Show the synchronous reactive component that implements this functionality.

b. Suppose we want to add another input control for the driver, pause, with the following desired behavior. When the cruise controller is on, if the driver presses pause, then the controller is temporarily turned off. In the resulting paused state, the output cruiseSpeed should be absent, and the events inc and dec should be ignored. Pressing pause again in this paused state should resume the operation of the cruise controller, restoring the desired speed on pausing. Pressing cruise in the paused state should switch the system off, and when the controller is off, pressing pause should have no effect. Redesign the component SetSpeed with this additional input event pause to capture the above specification. Hint: the component SetSpeed now maintains a state variable mode that can be either on, paused, or off, i.e., mode = {on, paused, off}.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

6th International Edition

061921323X, 978-0619213237

More Books

Students also viewed these Databases questions

Question

Create hy being extemfllly open: How can I [aim find change?

Answered: 1 week ago

Question

What is order of reaction? Explain with example?

Answered: 1 week ago

Question

Derive expressions for the rates of forward and reverse reactions?

Answered: 1 week ago

Question

Write an expression for half-life and explain it with a diagram.

Answered: 1 week ago