MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
ardaanil61
Posts: 4
Hello, I have a project, PMDG 737 Thrust Lever. Lots of code done and works. But the best hard one was not complete. This is spoiler Servo.

I want to pull spoiler handle with the spoiler servo (like number 1 in the picture). And that Servo should go back after the pull spoiler handle (like number 2 in the picture) because of I can to the back spoiler handle with my hand.

My porject paint at attachment. At the same time, I have a arm switch. But it is not neccesary. I can revome it.

How can I code this servo?

I think, to work this servo we have to a few condition.
1-The aircraft on the ground.
2-AutoBrake>0
3-Spoiler is arm.
Maybe, flaps>10

https://drive.google.com/file/d/1pZUI6DnwJzfhLesST3_Sj_W0iThO39HJ/view?usp=sharing
2023-02-11 11:04
Avatar
ardaanil61
Posts: 4
Is there anyone who can help?
2023-02-17 16:52
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

Sorry. I overread this.

For this system we have a lot of possible ways.... Specially with different mechanics. E.g. some people build it with a spring or expander system.... So there is no Motor that move the handle.... Its more like a trigger that release a hold mechanic and "shoot" the handle by the spring power to the other side.

Another factor is the "automatic move back" function.
As i know the B737 Ng not have this.... But newer ones ( i think B747-8 if i remember right) have a motor that also move Spoilers back to Zero after decrease speed below e.g. 30knts.

Whatever.... Lets have a look to your System.
What we need:
1. A logic that not block us from using the Spoilers by hand in flight
We must indicate the system to be working by say "Arm Position = Servo On and waiting to act" BUT If we move Handle above the Arm Position by hand ( We like to use spoilers in the air for descent e.g.) then it must understand this and disable the mechanic for that time.
2. A Logic that remove the mechanic back to "Zero Position" after it have act by the servo. So we be able to move the handle again !

Solution:
My idea here would be to use physical indicators instead of a lot of config and condition logics.....
I would work here with 2 Micro Buttons or switches like you have on the picture.

Switch 1 is handle the ARM Position. It must be Pressed (and hold) when Handle is moved to arm position and stay there. It must be released if Handle is moved away (whatever back to Off, Over ARM downwards and also whatever we do it by hand or by the Motor.

Switch 2 is located on the maximum Spoiler Position... So it get pressed when the spoiler touch the maximum Point of the moving range

Logic:
We build a Variable that is controlled by these to Switches to 1 or 0 .... If its "0" we tell the Spoiler to Move and Stay in the "Neutral" Position (1 in your Picture).
If its 1 we tell the Motor to check the Virtual Spoiler Handle.... If it move to Full ( By the Automatic in Sim) then we tell Motor to also move 180° and push the handle.

How to do....
Config Button 1 Say On Press Set Variable to 1
Config Button 2 Say On Press Set Variable to 0

Config A for Motor say Read Position of Virtual Handle ($) E.g. if Value goes from 0-255 then We also say in Motor Settings or by transform your mechanic should move to Full Position . I would say in transform if($>200,1,0) So in the example of 0-255 i say if greater 200 means if Handle is moved near to the end
So we protect the problem that still "arm" is greater then 0 here.

Additional we need a Precondition and say "Only work if MF Variable is "1"

Config B for Motor say in Transform simply 0 (Zero) . And get Precondition Only work if Variable = 0


On this point we have a system that is Armed when Handle is in Arm Position .... It then detect virtual Handle move and "fire" your mechanic when virtual spoilers are moved.
And by the second Button it get "disabled" again after spoiler was moved.... So Handle remains in Full Position but Servo move mechanic back directly ofter reach the Full.

***
Last Problem: Logic not include the Situation when we use Spoilers in Air by hand ( Also here the move above Arm would trigger our variable to 1)

We can solve this mechanical.... So e.g. by a Nodge. Means your "Arm" Button only get pressed when you by intent set it ( E.g. a Spring Nodge or so). If you will "pull" the Switch from OFF to the Moving range (Above Arm Position) WITHOUT press the Arm Switch here then we have no problem..... Cause we then would not trigger the Variable.
If this is not possible and your Logic occur in a press all time (While cross the Arm Position) we would need a additional logic to avoid this.

Here i would read the Radar Altitude.... And Duplicate the Config for Button 1 (Arm)
This Config should only work if we are in the Air ( E.g. Altitude >500ft AGL)
And On Release we say "Set Variable to 0"

Result: If we release Handle from ARM Position in the Air ( Whatever by set to OFF after Takeoff or by use Spoilers in the air) we now set Variable to "0" again.
Means the Servo will not act here.
By say "Only work above 500 ft" this Config not act at Touchdown or rejected Takeoff .... Here the automatic Servo Move will also "release" The Arm Switch but it NOT write the Variable here to "0" and Servo can do its work !

*****

Sorry for the Long text.
Those problems can be solved much more easy with Voice and shared screen on Our Discord.
Also note.... This is just my first idea. Maybe there is a much more easy methode, too.
Reply if you need more help, or better call me on Discord !
Good Luck !
2023-02-18 14:10
Avatar
ardaanil61
Posts: 4
Thank you for replying.
-I will add a second switch for is press maximum position.
-And I will fix switch 1 for only pressing and holding ARM position.
After these maybe we can meet on discord for code if you are available...
2023-02-19 09:05
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
For Sure.
Simply PM me there ! https://discord.gg/99vHbK7
Good Luck !
2023-02-19 20:21
icon