Autopilot... complicated but explainable.
Lemme explain the basics in a p̶a̶r̶a̶g̶r̶a̶p̶h̶ short essay. I will be using the SWL-10's autopilot (wait, you can use that!) for this example. For the SWL-120 the basics will be the same.
The first thing we want to do is make a system which allows us to select a target heading, altitude, and vertical speed. You have done this. Now, we want to incorporate our current heading, vertical speed, and altitude. Then we want to find the difference between the two and then clamp that difference, so we get a number which smoothly goes to 0 as we approach all of our targets. Something important to note is Unity works in metric (meters, meters per second) instead of imperial (knots, feet).
Another good thing - A while ago, I made several YouTube videos about the development of the SWL-10, specifically focusing on the funky trees, and I think one or two were almost exclusively about the autopilot. I'm not sure if they include all the information, but I'll make a video or two when I make the SWL-120's autopilot. Here is the video about the autopilot. I'm pretty sure some info is missing, but let me know and I'll help you.
Oh, and here's the SWL-10. The autopilot is in the bottom few variables (the video will help), and some numbers might need tuning. I'd also recommend looking at the code in the four "physics wings" around the aircraft.
I'd also like to have a look at the funkyness in the cockpit of this regional airliner you're building.
One last thing - if you're really stuck, then I'd recommend waiting a month or two, until I can make a video on the SWL-120's autopilot, because in that video I'll try and make sure the entire video is dedicated to completely explaining how the autopilot works, and then coding and testing it.
If you have a couple, then upload and download them. You can delete them off the site after. If you have, say, a few thousand (like I did when I wanted to remove SP from my old iPad), then I used some third party software which could read my iPad.
@topfuel300 Just checked, instead of putting floor(A9) in the setter, put 0. I also noticed the rotator didn't work, simply put 1 (or -1) in the "max" section. Another important note is the priority. Set the priority of the variable setter (not the button) to -1, to ensure the button takes priority.
A doughnut or donut (/ˈdoʊnət/) is a type of food made from leavened fried dough.[1]: 275 It is popular in many countries and is prepared in various forms as a sweet snack that can be homemade or purchased in bakeries, supermarkets, food stalls, and franchised specialty vendors. Doughnut is the traditional spelling, while donut is the simplified version; the terms are often used interchangeably.
Doughnuts are usually deep fried from a flour dough, but other types of batters can also be used. Various toppings and flavorings are used for different types, such as sugar, chocolate or maple glazing. Doughnuts may also include water, leavening, eggs, milk, sugar, oil, shortening, and natural or artificial flavors.[1]: 232 [2][3][4][5]
The two most common types are the ring doughnut and the filled doughnut, which is injected with fruit preserves (the jelly doughnut), cream, custard, or other sweet fillings. Small pieces of dough are sometimes cooked as doughnut holes. Once fried, doughnuts may be glazed with a sugar icing, spread with icing or chocolate, or topped with powdered sugar, cinnamon, sprinkles or fruit. Other shapes include balls, flattened spheres, twists, and other forms.[4][5][6] Doughnut varieties are also divided into cake (including the old-fashioned) and yeast-risen type doughnuts.[6][7][8] Doughnuts are often accompanied by coffee or milk. They are sold at doughnut shops, convenience stores, petrol/gas stations, cafes or fast food restaurants.
@zwen This is very cool, and I will certainly be interested in using it for the SWL-120.
By rest, I mean the other buttons, like the numpad and vnav and rnav.
@zwen Nice! I'd love to have this system (all of it) in the SWL-120. Would it need fine tuning?
I'm also wondering, how do the rest of the buttons work? I got the altitude, heading, and speed AP working, but I'm not sure how to use the rest.
@pilotman10 What I mean is for players who can't run the main version, I will remove the fuselage and wings (leaving just the basic parts to make it fly the same as the main version) and then the cockpit will still be there.
I've added the code to the landing gear, which can be found here. Please note only the right gear has the codes, and the support braces need the inputs changed or something.
The landing gear coding is relatively easy. If I have time over the next few days I'll add the landing gear codes for you (it's pretty easy for me, plus the codes are already written).
This looks pretty good! I have a few recommendations which could make it even better. The slats could go with the flaps, as is on a real plane. Adding some funky trees code to the landing gear would also make it function a little better, especially on extension.
If you're not sure about how to make the slats extend with VTOL down, then click the button next to the "invert" label on the settings for the flap rotators, to make both the flaps and slats work with VTOL up.
It's possible, go into controls, select the joystick, and click calibrate. Then adjust the zero until the positive axis turns into the whole input. I had the same problem with mine. (Different setup, but same problem).
Hi, so I'm getting closer to the point where I'm going to work on the autopilot, and I have a question. I never really clarified this.
The SWL-120 will have a dedicated speed setting, just like the heading adjuster on the -10, but specifically for speed. My question is : is this autothrust code the same for each plane, or does it have to be refined for each different plane?
I know @klm747klm747 has a lot of info on this.
+2@SpiritusRaptor It means they want you to tag them on the creation when you post it.
+1@Cereal It's for my SWL-120.
+2It looks so good!
@BeastHunter Higher damper reduces bounce. No damper has more bounce.
+2Reduces the bounce. Spring strength increases the overall strength, and damper slows down the movement.
+2First unwritten rule: If you ask, then you don't.
+2Now make it work
+1meh if you have yes free time it's possible. Possible, not easy.
T
Autopilot... complicated but explainable.
+2Lemme explain the basics in a p̶a̶r̶a̶g̶r̶a̶p̶h̶ short essay. I will be using the SWL-10's autopilot (wait, you can use that!) for this example. For the SWL-120 the basics will be the same.
The first thing we want to do is make a system which allows us to select a target heading, altitude, and vertical speed. You have done this. Now, we want to incorporate our current heading, vertical speed, and altitude. Then we want to find the difference between the two and then clamp that difference, so we get a number which smoothly goes to 0 as we approach all of our targets. Something important to note is Unity works in metric (meters, meters per second) instead of imperial (knots, feet).
Another good thing - A while ago, I made several YouTube videos about the development of the SWL-10, specifically focusing on the funky trees, and I think one or two were almost exclusively about the autopilot. I'm not sure if they include all the information, but I'll make a video or two when I make the SWL-120's autopilot.
Here is the video about the autopilot. I'm pretty sure some info is missing, but let me know and I'll help you.
Oh, and here's the SWL-10. The autopilot is in the bottom few variables (the video will help), and some numbers might need tuning. I'd also recommend looking at the code in the four "physics wings" around the aircraft.
I'd also like to have a look at the funkyness in the cockpit of this regional airliner you're building.
One last thing - if you're really stuck, then I'd recommend waiting a month or two, until I can make a video on the SWL-120's autopilot, because in that video I'll try and make sure the entire video is dedicated to completely explaining how the autopilot works, and then coding and testing it.
@Mekomara Neither did I, until I asked myself the question and started experimenting.
+3Forum Here
The devs should put it back up, or at least make it available to download somehow.
@JayAr not at all.
+1What you do is scale the wing down, not resize it. Change the scale to like 0.1,0.1,0.1. @Phoebe @JayAr
+1hmmm
@zwen Cool. The SWL-120 is mostly based off the 787 and 777, with the autopilot panel based off the 777.
If you have a couple, then upload and download them. You can delete them off the site after. If you have, say, a few thousand (like I did when I wanted to remove SP from my old iPad), then I used some third party software which could read my iPad.
@topfuel300 Just checked, instead of putting floor(A9) in the setter, put 0. I also noticed the rotator didn't work, simply put 1 (or -1) in the "max" section. Another important note is the priority. Set the priority of the variable setter (not the button) to -1, to ensure the button takes priority.
@topfuel300 Maybe send me the file so I can see for myself what is happening.
+1Have a button with the interactionType of Continuous, and then have a variable setter (in the global list) setting the variable to 0.
A doughnut or donut (/ˈdoʊnət/) is a type of food made from leavened fried dough.[1]: 275 It is popular in many countries and is prepared in various forms as a sweet snack that can be homemade or purchased in bakeries, supermarkets, food stalls, and franchised specialty vendors. Doughnut is the traditional spelling, while donut is the simplified version; the terms are often used interchangeably.
Doughnuts are usually deep fried from a flour dough, but other types of batters can also be used. Various toppings and flavorings are used for different types, such as sugar, chocolate or maple glazing. Doughnuts may also include water, leavening, eggs, milk, sugar, oil, shortening, and natural or artificial flavors.[1]: 232 [2][3][4][5]
The two most common types are the ring doughnut and the filled doughnut, which is injected with fruit preserves (the jelly doughnut), cream, custard, or other sweet fillings. Small pieces of dough are sometimes cooked as doughnut holes. Once fried, doughnuts may be glazed with a sugar icing, spread with icing or chocolate, or topped with powdered sugar, cinnamon, sprinkles or fruit. Other shapes include balls, flattened spheres, twists, and other forms.[4][5][6] Doughnut varieties are also divided into cake (including the old-fashioned) and yeast-risen type doughnuts.[6][7][8] Doughnuts are often accompanied by coffee or milk. They are sold at doughnut shops, convenience stores, petrol/gas stations, cafes or fast food restaurants.
@zwen This is very cool, and I will certainly be interested in using it for the SWL-120.
By rest, I mean the other buttons, like the numpad and vnav and rnav.
@zwen Nice! I'd love to have this system (all of it) in the SWL-120. Would it need fine tuning?
I'm also wondering, how do the rest of the buttons work? I got the altitude, heading, and speed AP working, but I'm not sure how to use the rest.
@pilotman10 What I mean is for players who can't run the main version, I will remove the fuselage and wings (leaving just the basic parts to make it fly the same as the main version) and then the cockpit will still be there.
I've added the code to the landing gear, which can be found here. Please note only the right gear has the codes, and the support braces need the inputs changed or something.
+1You have to get past the blockade of my destroyers first.
+3@pilotman10 There will be a flying cockpit version of the SWL-120.
hullage
+8The landing gear coding is relatively easy. If I have time over the next few days I'll add the landing gear codes for you (it's pretty easy for me, plus the codes are already written).
+1This looks pretty good! I have a few recommendations which could make it even better. The slats could go with the flaps, as is on a real plane. Adding some funky trees code to the landing gear would also make it function a little better, especially on extension.
+1If you're not sure about how to make the slats extend with VTOL down, then click the button next to the "invert" label on the settings for the flap rotators, to make both the flaps and slats work with VTOL up.
A
@pilotman10 Oh, I'm not doing an autopilot for this plane.
@pilotman10 It takes a while because I have a lot to do. I think a year is a little too long, I'm hoping to have this out by Christmas (maybe on Christmas). I have to finish the wings, work on the fuselage, make the passenger cabin, and then the cockpit has so many parts. For example, take a look at this cockpit and then spread that level of detail to the entire cockpit. In addition, these wings still need a lot of work, like rivets.
@pilotman10 I'm going to use this ils with my own autopilot (and your autothrust), so probably in a year.
@pilotman10 um.. I'm not sure about the yt shoutout, but I will certainly credit you.
Please remember to use the reply function, I didn't realise you wrote a message.
+1I'm glad it works!
It's possible, go into controls, select the joystick, and click calibrate. Then adjust the zero until the positive axis turns into the whole input. I had the same problem with mine. (Different setup, but same problem).
+2@Croissant My video explains how to do that.
Maybe watch this?
This looks good! I'll spotlight it when it releases.
@pilotman10 Thank you, I've saved this code for when I need it.
Budget BogdanX
+3hmmm
hmmmmmmmmmmmmmmm
hmmmmmmmmmmmmmmmmmmmmmmmmmm
ayo point 1 is now a thing
+2Use mods, or use this thing I made a while ago.
+1You have a stack of upvotes.
+3Hi, so I'm getting closer to the point where I'm going to work on the autopilot, and I have a question. I never really clarified this.
The SWL-120 will have a dedicated speed setting, just like the heading adjuster on the -10, but specifically for speed. My question is : is this autothrust code the same for each plane, or does it have to be refined for each different plane?
I have 6 planes in my list (the rest are archived).
+1And 800GB of free storage.
That second one could be really useful, say, while landing my ultra detailed plane in the cockpit, while recording that perfect wing view landing.
+3