Challenge

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

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.

1.Here controlling the retraction and extension of Airplanes landing gear:

  • State_Type
  • Switch_Status
  • Pilot_Lever_Status
  • Hydraulic_Mechanis
  1. GEAR_DOWN- pilot's lever rising && squat switch open/light=GREEN it is not satified then it will return to Squat Switch close or pilots lever falling to CHECK_BEFORE TAKE OFF
  2. CHECK_BEFORE TAKE OFF-pilots lever up/Direction valve =UP,light= RED to RAISING_GEAR.
  3. RAISING_GEAR-limt Switch closed/light OFF, control for landing gear disabled and (it will check the checking before landing also simultaneously)plots lever falling/ light =RED to GEAR_UP and CHECKING_ BEFORE _LANDING.
  4. GEAR_UP-pilots lever falling /control enabled,light =RED to GEAR_UP and CHECKING_ BEFORE _LANDING.GEAR_UP and
  5. CHECKING_ BEFORE _LANDING-pilots lever down/direction valve =DOWN to LOWERING_GEAR.
  6. LOWERING_GEAR-limt switch opened/light =GREEN after it is go again first to GEAR_ DOWN .if it not satisfied then it will go to CHECKING BEFORE TAKE OFF DELAY 3sec

Goals

  • Controlling the direction Valve.
  • Controlling the retraction and extension of Airplane’s landing gear.

Controlling Directive value:

  • pilot's lever state is lever UP then its will must be direction will be UP
  • pilot's lever state is lever DOWN then its will must be direction will be DOWN

Controlling Airplanes gear:

  • Limit Switch CLOSED then it is gear is UP
  • limit switch OPEND then it is gear is DOWN

Key highlights of the project:

A direction valve is controlled by the software to allow the hydraulic pressure to either raise or lower the landing gear.

  • Direction valve is DOWN then it will be GEAR DOWN
  • Direction vave is UP then it will be Raising gear (Takeoff)
  • Control of hydraulic pump for the landing gear part is disable then it will be Gear UP(airborne)
  • Direction valve is DOWN then it will be Lowering Gear (Landing)

we have to perfroming the many direction valve controlling:

  1. GEAR_DOWN
  2. CHECK_BEFORE TAKE OFF
  3. RAISING_GEAR
  4. GEAR_UP
  5. CHECKING_ BEFORE _LANDING
  6. LOWERING_GEAR

Deliverables of this project:

Implementing the control for the retraction and extension of Airplane’s landing gear using the Finite state machine with the knowledge of various states of switch and gear

State Machine is initialized & Program is in Gear_Down State & Light_Status : Green

Enter the Pilot's Lever Position and Squat Switch Status:0 0

Enter the Pilot's Lever Position,Squat Switch Status and Hydraulic Mechanism Status:2 0 0

Enter the Limit Switch Status, Pilot's Lever Position :1 2

Enter the Pilot's Lever Position:1

Enter the Pilot's Lever Position and Status of Hydraulic Mechanism:3 1

Enter the Limit_Switch Status,Pilot_Lever Status ::1 0

Expected outcomes:

The student will be getting the Knowledge of Finite State Machine algorithm which is used to achieve the control over the retraction and extension of Airplane’s landing gear using the switch and gear states of Airplane.

GR_DWN(0):

State Machine is initialized & Program is in Gear_Down State & Light_Status : Green

Enter the Pilot's Lever Position and Squat Switch Status:0 0

Current State:Checking Before Take Off
Light Status:Green

CHK_BFR_TKFF(1):

Enter the Pilot's Lever Position,Squat Switch Status and Hydraulic Mechanism Status:2 0 0

Wait for 2 secs

Current State: Raising Gear
Light Status:Red
Direction Value Status:Up

RSING_GR(2):

Enter the Limit Switch Status, Pilot's Lever Position :1 2

Wait for 1 sec

Current State: Gear Up
Light Status:Off
Hydraulic Control for Landing Gear Status:Disabled

GEAR_UP(3):

Enter the Pilot's Lever Position:1

Current State:Checking Before Landing
Light Status:Red
Hydraulic Control for Landing Gear Status:Enabled

CHK_BFR_LANDING(4):

Enter the Pilot's Lever Position and Status of Hydraulic Mechanism:3 1

Current State : Lowering Gear
Light Status:Green
Direction Valve Status:Down
Gas Pressurized Spring System Status:Enabled

LWRING_GR(5):

Enter the Limit_Switch Status,Pilot_Lever Status ::1 0

Current State: Checking Before Take Off
Light Status:Green

Program:

#include <stdio.h>

#include<string.h>

/* variables */

int take_f_state=0;

int lan_f_state=0;

int f_hight=250;

int f_wheel=1;

char name_1[]="take_off";

char name_2[]="landing";


/*functon prototype*/

void take__off();

void landing();


int main()

{

char pro[10];// local variable

printf("enter the process :");

scanf("%s",pro);// get input from user

if((strcmp(pro,name_1))==0)// check the condition

{

while (1)// rut until the process is end

{

take__off();

if(take_f_state==5)// check the condition

{

take_f_state=0;

break;

}

}

}

if((strcmp(pro,name_2))==0)// check the condition

{

while (1)// rut until the process is end

{

landing();

if(lan_f_state==5)// check the condition

{

lan_f_state=0;

break;

}

}

}

}


void landing()// function defination

{

switch (lan_f_state)

{

case 0:

printf("extended process start..,\n");// first state

lan_f_state=1;

break;

case 1:

if(f_hight>200)// check the hight

{

printf("proper hight is reached \n");

lan_f_state=2;

}

else// else wait for hight is reached

{

printf("waiting for proper hight to reach...");

}

break;

case 3:

printf("lever is activated\n");// activated the lever

printf("hydralic pump value is changed\n");// change the value

lan_f_state=4;

break;

case 4:

if (f_wheel==1)// check the wheel position

{

printf("wheel is properly get out\n");

printf("extended process is complete");

lan_f_state=5;

}

else// wait for wheel get in

{

printf("wait for wheel get out...");

}

break;

case 2:

printf("door open\n");// close the door

lan_f_state=3;

break;

}

}


void take__off()// function defination

{

switch (take_f_state)

{

case 0:

printf("retracted process start..,\n");// first state

take_f_state=1;

break;

case 1:

if(f_hight>200)// check the hight

{

printf("proper hight is reached \n");

take_f_state=2;

}

else// else wait for hight is reached

{

printf("waiting for proper hight to reach...");

}

break;

case 2:

printf("lever is activated\n");// activated the lever

printf("hydralic pump value is changed\n");// change the value

take_f_state=3;

break;

case 3:

if (f_wheel==1)// check the wheel position

{

printf("wheel is properly get in\n");

take_f_state=4;

}

else// wait for wheel get in

{

printf("wait for wheel get in...");

}

break;

case 4:

printf("door closed\n");// close the door

printf("retracted process is completed");// process is complete

take_f_state=5;

break;

}

}

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.