Following is a safety controller with input and output
Condition given below for designing a state machine:
Here SignalOk, SignalWeak and SignalLost are measurements signal quality of steering angle. SteeringAngle signal itself contains the original steering data. In case of 3 consecutive SignalOk, system controller will output ValidSignal with the steering angle data. In other cases, signal will be considered as CorrputSignal. I am using UML 2 state charts(Harel charts). This is so far what I have done:
N.B.:Parallel states and broadcasting is not supported yet, but nested states are supported. I don't know how to model this stream of inputs in state machine, any kind of help will be appreciated.

First I would recommend renaming the states, so that they don't resemble actions. I suggest to name them
First Ok received,Second Ok receivedandOk confirmed.Since the
SteeringAngleshall be ignored the first two times, the only transition triggered by it should be an internal transition inOk confirmed. This transition will also invokeValidSignal.Nothing is specified about the order of
SteeringAngleandSignalOk. Therefore,SteeringAngleshould be deferred inSecond Ok received. This way, even it it comes first, it will stay in the event pool.Any reception of
SignalWeakorSignalLostshould return toReady. You could do this with a local transition ofOperationaltoReady.One additional recommendation: Define an Initial state in
Operationaland target theSystemOktransition toOperational. The effect is the same, but it results in a better separation of the two top level states.