Challenge

Project 2 - Implement the Code for controlling the retraction and extension of Airplane’s landing gear

Ms. Abinaya Inbamani Mam Batch

Project 2 - Implementing the code for controlling the retraction and extension of Airplane's Landing Gear using Finite State Machine (FSM)

Overview of the Project:

In this project, controlling the retraction and extension of Airplane’s landing gear can be implemented using Finite State Machine (FSM). FSM is the most efficient algorithm which is mathematical model of computation.

Code Logic:

0. Initial State

Current State = Gear Down

Light Status = Green

 

1. Gear Down

If (Pilot lever == Rising && Squat Switch == Open)

then

Current state = Checking before take-off

Light status = Green

 

Else

Gear Down

 

2. Checking Before Takeoff

If (Pilot Lever == Falling OR Squat Switch == Close)

then

Gear Down

 

else If (Pilot Lever == Up AND Squat Switch == Open AND Hydraulic mechanism == Working)

then

Current state = Rising gear

Light status = Red

Direction Valve Status = Up

 

else if (Pilot Lever == Up AND Squat Switch = Open AND Hydraulic mechanism = Malfunctioning)

then

Current state = Rising gear

Light status = Red

Direction Valve Status = Up

Gas pressurized spring status = Enabled

 

 

3. Rising Gear

If (Pilot Lever == Falling && Limit Switch == Open)

then 

Current State = Check before landing

Light Status = Red

Hydraulic pump control status = Down

 

If (Pilot Lever == Up && Limit Switch == Close)

then

Current State = Gear up

Light Status = Off

Hydraulic Pump Control Status = Disabled

 

else

Rising Gear

 

4. Gear up

If (Pilot Lever == Falling)

then

Current State = Check before landing

Light Status = Red

Hydraulic pump control status = Enabled

 

Else 

Gear up

 

5. Checking Before Landing

If (pilot_lever == (UP OR Rising OR Falling)

then

Check before landing

 

else if (Pilot Lever == DOWN AND Hydraulic Mechanism == Working)

then

Current State = Lowering gear

Light Status = Green

Direction valve = Down

 

else if (Pilot Lever == DOWN AND Hydraulic Mechanism == Malfunctioning)

then

Current State = Lowering gear

Light Status = Green

Direction valve = Down

Gas pressurized spring status = Enabled

 

 

6. Lowering Gear

If (Pilot Lever == Rising AND Limit Switch == Close)

then

Current State = Checking before take-off

Light Status = Green

Hydraulic Pump Control Status = Enabled

 

If (Pilot Lever == Down AND Limit Switch == Open)

then

Current State = Gear Down

Light Status = Green

Hydraulic Pump Control Status = Enabled

 

Else

Lowering Gear

Code:

Output:

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.