Challenge

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

Aircraft genarally has three landing gears.

Planes that have retractable gear generally retract their gear for improved performance. Not having wheels and struts hanging down streamlines the plane, improves fuel efficiency, enables them to fly faster and higher, and makes for a quieter, more comfortable ride inside the cabin.

Aircrafts have landing gear that retract into the wings and/or fuselage to decrease drag during flight. Drag slows down the aircraft, thus increasing the flying time between two places.

Through mechanical advantage, the pilot extends and retracts the landing gear by operating the lever. Use of a roller chain, sprockets, and a hand crank to decrease the required force is common. Electrically operated landing gear systems are also found on light aircraft.

They usually extend and retract into the main body and gets covered into the frame through hydraulically operated actuators. Hydraulic actuators recieve signals from the computers and the logical frame behind it is as shown in the image.

In the following truth table it is indicated that two truth table are shown Extended and retracted state.

AND Logic - If all the gears are sending same signals either logic zero or logic 1 then it means all are in same position (extended or retracted)

NOR logic : If any of the gear not in alignment -logic are not the same as the other the it sends logic 0 , indicating some fault or warning that not all gear are alligned .

Hence from the above logic we can program were all the gates needs to be same through AND logic for correct position indication

Program :

#include <stdio.h>

//declaration of parts in the landing gears

/*typedef enum {
//main landing gear have two sets right and left
}landig_gear;*/

int main()
{
int nose_lg; //lg-landing gear
int main_right_lg;
int main_left_lg;
int n;
//taking input for selecting whether to retract or extend
printf("please select extension(0) or retraction(1):");
scanf("%d",&n);

if(n==0){
nose_lg=0;
main_left_lg=0;
main_right_lg=0;
printf("\nLanding gear is extending.");
if(nose_lg==0&&main_left_lg==0&&main_right_lg==0){
printf("\nAll the gear have been succesfully extended.");
}
else
printf("\nMalfunction ,all landing didn't extend."); //redundancy
}
else if(n==1){
nose_lg=1;
main_left_lg=1;
main_right_lg=1;
printf("\nLanding gear is retracting");
if(nose_lg==1&&main_left_lg==1&&main_right_lg==1){
printf("\nAll landing gear have succesfully retracted.");
}
else
printf("\nMalfunction, all landing gear didn't retact.");
}
else
printf("ERROR"); // if inputs is wrong,everything fails

return 0;
}

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.

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.