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
gmcallis
Posts: 28
Hi, great software by the way.

I'm trying to get the servo to automatically return the engine start switches for the PMDG 737 NGX.

I've read the post https://www.mobiflight.com/forum/message/2454.html, but I believe it can be done much easier.

At present I have the following setup.

Output LTS_RtnStartSw

Display: Min Value 0, Max Value 1, Max Rotation 30%

Precondition: LTS_Eng2StartValve=0 (AND) FUEL_annunENG_VALVE_CLOSED_R = 0 (AND)

Basically, before turning the Start Switch to GRD, the ENG_START_VALVE annunciator is on and therefore a Output value of 1, therfore the above condition is not met.

When switching the Engine Start Switch to GRD the ENG_START_VALVE momentarily remains off, value 0, then turns on changing the value to 1.

At 25% N2, fuel is introduced to the engine and the ENG_START_VALVE extinguishes changing the output value to 0, then at 57% N2 the ENGINE START SWITCH returns to the OFF position, (value 1), and the ENGINE_START_VALVE extinguishes also changing the output value to 0, both conditions are then met. This should, to me, cause the servo to rotate 30%.

My problem at the moment is instead of the servo rotating 30%, it gives a very slight movement, then the Arduino disconnects producing the normal USB disconnect sound. Nothing will then happen until physically disconnencting the USB cable from the Arduino, then reconnecting it. Additionally, on other occasions the Arduino loses it's Mobiflight Module settings.

I'm of the feeling I'm on the right track here and I should be able to get the servo to return to 0, using interpolation.

Any advice would be appreciated tho I suspect this is not a common issue.

Cheers

Graham
2018-01-23 23:42
Avatar
gmcallis
Posts: 28
The Mobiflight website, documentation page has functions listed as Servos (under development).

Is this still the case that Servos with Mobiflight is still in development, or should the documentation page have been updated?

Cheers

Graham
2018-01-25 15:11
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi my friend....

I read your idea some yesterday and i hoped i can figure out this theory today.... But i have no time yet....
Please give me some Days ( I need to reset my flight sim PC and PMDG to make a testing and at the moment this is not possible in case of much work in job)

Basicly....
Servo is working normaly fine ( the quoted note is a relict of the past and is not actualy now..... Servo is already implement)
Disconnecting of Arduino sounds like a electrical issue !

***
Your logical Problem on first overview ( without real testing).....
You have no 2nd config for the Servo..... If your preconditions are not TRUE then the servo is not controlled.... So it not turn back to Zero Position.

It´s like with a LED..... If you just Disable a Config with Precondition then the LED stays ON ( Whatever the Config is disabled) .... You need a Second Config that tell to the LED it should get off ! Basicly same technic !

****

So i hope i can check this next weeks..... Must see the values how they work... ( I not understand fully your text without seeing the Values and functions)
Please stay patient..... Or better please sahere your results in this topic !
Good Luck !
2018-01-25 20:38
Avatar
gmcallis
Posts: 28
Thanks Pizman, but don't worry about it now. Also I'm satisfied the problem isn't power related as I ran a seperate script using the same servo and Arduino and the servo happily ran back and forth all day. Using that script it did disconnect once in an hour or so, but then reconnected immediately and hardly missed a beat.

I've followed your logic with the post "Can you auto reset servos" and i'm close.

Initially running Mobiflight, the servo resets to what I believe is the 0 position. Observing all the output values it appears all my settings are correct, tho it only takes one unobserved error, for it not to work.

My problem now is when the "virtual" switch resets to OFF, (offset value 1), the servo rotates in a anticlockwise direction approx. 200 degrees, then the Arduino disconnects. Now bearing in mind I don't have the physical rigging set up to switch the physical switch from GRD to OFF presently so I understand the servo won't stop rotating the full 180 degrees.

So my question at the moment is how can I ensure the servo rotates in a clockwise direction?

I can send a series of screen shots with my settings if this helps me, you and others trying to achieve the same result.

Cheers

Graham
2018-01-26 04:46
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
As we talked in other topic....
The Problem finaly is, that Mobiflight not allowd us to run a "macro" or to read current switch (real) state... Also we can not say "IF Offset A=1 AND Offset B=2 Then do blabla." and we can not work with a "sleep / wait" command.

In a own written code this all would be possible !
For example there you can say.... " If condition is TRUE ( for example the Sim switch back after starting) THEN Run Servo to 100% for resetting the Real Switch.... WAIT 2 Seconds And THEN Run the Servo back to 0% STOP.
So the Servo not showing a Offset Value..... The Servo here simply run a sequence like 0-100% 2 Seconds waiting and back 100-0% .

There are also possible technics if you be able to "know" the Real switch position ( Thats why we use custom Offsets in the other topic to tell Mobiflight the current Real switch position)
Then you can Say " Servo should go 0-100% if Real switch is GRD but Sim Switch is already OFF ..... And you can also say Servo should Reset 100-0% if Real switch is OFF and Sim Switch is OFF same time.

*******************

About your last request....


I don´t know if it´s possible to change direction electrical ( I dont think so) . a way is to use a coggwheel 1:1 BUT you can change it in Mobiflight, too
Simply use the INTERPOLATION in that config..... And say 0=1 and in next line1=0
Then your Input Value is reversed and Servo now go to 0% if value is 1 and go to 100% if value is 0 !
Good Luck !
2018-01-26 14:19
Avatar
gmcallis
Posts: 28
Hi Pizman, and thnkyou for your help.

I tested the servo with a script which loops a count from 1 to 60, then has a delay, then counts backwards from 60 to 1, then another delay.

All works good until I reduce the delay below 7....then I get the same issue as I do with Mobiflight.

I can't see anyway I can introduce a delay into Mobiflight so I guess it's try another servo, or employ some other tactic.

Cheers

Graham
2018-01-26 22:21
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
One little question by the way....
Does the technic from other topic not work finaly ???

I try out the system at that time and it workes ! ....
So do you just think about a more easy workflow or does the explaned system not work fine for you ?
If needed i can search in my EMAIL Backup files about this old Mail contact with bennonozgurum......
I remeber i wrote with him some mails and we figure out this part until it was running fine in his homecockpit !

Just request if you need that stuff !
Good Luck !
2018-01-27 22:50
Avatar
gmcallis
Posts: 28
Hi Pizman.

The logic worked with my technique, but there was a slight flaw where the annunciator for either the Engine Start Valve or the Eng Valve Closed didn't extinguish until a couple of seconds after the virtual Engine Start Switch returned to the OFF position so the real switch didn't return to OFF immediately the virtual one does.

I've used your technique which I can report works flawlessly.

The only change I have made is the output configs for the left and right switches, 64FC & 64FD, I have in the "Display" tab, Min Value 0, Max Value 1 and Max Rotation 30%. This way the arm of the servo only swings from the 12 o'clock position to about the 2 o'clock position instead of rotating the full 180 degrees.

I've now rewired the Servo so it now rotates clockwise. I now only need to create an arm so the servo rotates both real switches back to OFF independent of each other and it works like real. Thank you so much for your assistance.

The servo rotation can be reversed by opening the servo and switching the two wires on the motor, and also the (+) and (-) wires on the potentiometer. Intermediate soldering skills are needed as the wires and terminals are quite small, but anyone practiced in soldering and with patience should be fine.

You were also correct regarding the issue of the Arduino disconnecting. I've attached a 6 x AA, 1.2 volt battery case to the Arduino and this has stopped all problems with disconnections. I will probably replace it with a smaller case holding a 9 volt battery, just for tidiness.

Shortly I'll have the entire forward overhead panel, bar the potentiometers for the interior panel lights and the temperature settings, working including all gauges, 7 segment displays for electrical readouts and pressurisation altitudes. All with Mobiflight.

I'll investigate further getting the potentiometers working thru the analog pins soon. It's going to give me some grief and frustration, but I WILL get there!!

Thank you for your help and I'd be happy to share any information with others.

Cheers

Graham
2018-01-28 03:53
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
icongmcallis:

I've now rewired the Servo so it now rotates clockwise. I now only need to create an arm so the servo rotates both real switches back to OFF independent of each other and it works like real. Thank you so much for your assistance.



As i wrote in the guide.... This can be done with two seperate Servos.... Or with a Construction that is set into both switches with ONE Servo !
(If you not only copy/paste my settings and you start to understand WHAT i do and WHY i do.... Then you simply can duplicate the Reset Logic for a second servo, too.)

At that time i not think about a independent system cause this situation "normaly" never can happen..... You will NEVER push both Starting switches same time to GRD....Always only one at a moment..... And you will not push the Second Switch "instant" after switch 1 is swapp back to off..... If you wait maby 1-2 seconds then the servo have resettet and you can use 2.nd switch without problems. In Real Plane you will check and readback the starting progress, too.... So there is a little brake between the switchings in real, too.


I Know this is not 100% Perfect.... But it´s the cheepest and easyest way i could find out at this time.

By the way....
I plan with Sebastian for a new tool.... He means that is possible and i hope we start with a BETA Build in next weeks/months. THEN All this stuff is pretty more easy and we can solve those problems directly in one Config !
Same for LED and 7Segment OFF Configs to blank it if battery is off.... With my new system all this can be done with only ONE Config ( And not like now with 2-3 configs per LED)!
Please stay patient.... If this workes i will tell you !
Good Luck !
2018-01-28 22:32
icon