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! 

Go to page 1Go to page 0123Go to page 2Go to page 3
Avatar
clarke250
Posts: 18
Hi guys,
I am trying to get servos to operate parking brakes and self returning switches. the off sets are either on or off, but I only need the servo to operate all the way in one direction when the offset indicates 1, then return back to 0 even though the offset remains at 1.
Any ideas on how to achieve this?

Kind Regards

Karl
2016-07-23 05:16
Avatar
DocMoebiuz
Moderator
From: NW of KPWK, United States
Posts: 1441
maybe you can inject a lua script with manipulates an offset based on another offset as you describe. MobiFlight would then use the offset which is written through the LUA script instead of the original offset.

The other thing you could try is:
* Read out the original offset (Offset A) in MobiFlight, so that you can use it as a precondition later.
* Configure MF so that another Offset (Offset B, e.g. 0x66C0) is used and increment it's value with Mobiflight continuosly ($+1) but only if a precondition is fulfilled. The precondition evaluates the original Offset A (Offset A > 0).
* Configure your Servo so that it uses Offset B and just say min value is 0 and max value is 1. So even if the offset B grows beyond 1 nothing happens. Your servo will just rotate 180 degrees.
* Configure another Offset (Offset C) which sets Offset A back to zero (0) and you add a precondition (Offset B = 100). So after 100 loops of mobiflight the original Offset A would be set back. Play around with the value (100) it might take to long for you (then make it smaller, e.g. 10) or too quick (then make it bigger, e.g. 200).

Hope that helps.
Have a great day!
Sebastian

MobiFlight - Simply build your own home cockpit for your favorite flight sim - FSX, Prepar3D (FSUIPC), X-Plane (XPUIPC)
2016-08-22 05:28
Avatar
bennnozgurum
Posts: 39
Sir I also want my engines tarter switch to return off position. I use servo but just like clarke250 I want servo behave 180 degree and return back to its 0 position. You write sth but I couldn't understand. For example you said "Read out the original offset (Offset A) in MobiFlight, so that you can use it as a precondition later." What I understand is create a new offset from output section of mf but which offset should it be? Engine starter offset which shows "0-1-2-3"? And you said:"Configure MF so that another Offset (Offset B, e.g. 0x66C0) is used and increment it's value with Mobiflight continuosly ($+1) but only if a precondition is fulfilled. The precondition evaluates the original Offset A (Offset A > 0)" I actually didn't understand which offset should I use as offset B. What is 0x66c0 offset? How to increment its value ($+1) ? Is it input or output? Can you help me please?
2016-12-10 11:03
Avatar
bennnozgurum
Posts: 39
"Configure another Offset (Offset C) which sets Offset A back to zero (0) and you add a precondition (Offset B = 100). So after 100 loops of mobiflight the original Offset A would be set back. Play around with the value (100) it might take to long for you (then make it smaller, e.g. 10) or too quick (then make it bigger, e.g. 200)." And I didn't understand here :( What should I write to Offset C (Offset number?), how will it make A back to zero?
2016-12-10 12:12
Avatar
pizman82
From: ETSI, Germany
Posts: 3322
Supporter
@ bennnozgurum
I think there are different situations....
The entry Post request a function that works when the Offset not change.... If i understand right he says the servo should work without a change of the original offset. so Sebastian creats a software "timer".
In youre case there will be a offset input i think. For example when the Starter switch in simulator comes back from GRD to OFF the offset will be change from maby 0-1 so you can tell youre servo to work when offset is bigger then 0 for example....

BUT the tectic from Sebastian is interesting for my personal Problem i try to solve last days....
He Said....
iconQuote:

Configure another Offset (Offset C) which sets Offset A back to zero (0) and you add a precondition (Offset B = 100). So after 100 loops of mobiflight the original Offset A would be set back.



How this work ?
I Try last time to WRITE an Offset in case of a precondition.... Like in youre Example i want to Set Offset A to "0" even when value from Config Entry "OffsetB" = 100 ..... .
BUT I just can say this Config should work when precondition is ok.... I cant´t find a way to get a Impulse automaticly.... I already need to config a Button, encoder and thats need to pushed by myself to start the writing process.

Looks like in youre example that works automatic. How to do ?
Good Luck !
2016-12-10 16:45
Avatar
bennnozgurum
Posts: 39
@pizman82

Thank you for your interest and your reply my friend.

"For example when the Starter switch in simulator comes back from GRD to OFF the offset will be change from maby 0-1 so you can tell youre servo to work when offset is bigger then 0 for example...." I can do it actually, it is not a problem to bring it from GRD to OFF with my mini servo. For example when the offset "64FC" or "64FD" for PMDG 737 comes from 0 to 1 my servo starts its 180 degree movement and it pushes the rotary switch from GRD "0" to OFF "1" with the design that I make.

However the problem is servo stays 180 degree it should turn back to 0 degree for the second engine and when the offset is 1 again it again should push the another one actually there are videos and they say that they do it with sioc but I want to use mobiflight if it is possible. Actually if we make servo move 180 degree and return to 0 via mobiflight, we can use it for this purpose :)
2016-12-10 17:10
Avatar
pizman82
From: ETSI, Germany
Posts: 3322
Supporter
OK,
Now i look some videos and think i understand youre mechanics.....
Maby it´s like this.... https://www.youtube.com/watch?v=4nKvzAyJ01Y

So you need a repositioning from the servo after he reach the maximum Point back to zero....

The softwaresulution is a "sleep" command. So If Offset is 1 ... Servo turn from 0-180 SLEEP maby 2 Secconds....Then turn Servo back to 0.

I think MF not support that at the moment as an option BUT maby Sebastians tricky technic will work here but i can´t rebuilt that config.
As i wrote in last posting i don´t know how to let Mobiflight set a Offset without human input like a button push. Additional i can´t get a config working, that counts from 0-100. $+1 is only done One time but not continuosly. ..... Maby he will tell us how this get to work.

By the Way.... If you like a inprovised solution think about a mechanical input from a button. When you take a small momentary Button to the Point where youre Servo is at 180° Position and already hat controlled the switch to Off Position. When youre mechanic now PUSH this Button you can create a Mobiflight Config that this Button Push set the Controlloffset of youre Servo to 0 and let the servo go back.
Maby this work !
Good Luck !
2016-12-11 04:01
Avatar
bennnozgurum
Posts: 39
Thanks for your idea pizman82 :)

However there will be a problem again because when you put push button mechanism, you should write another offset for this button and this offset should go from 1 to 0 but still original offset (that we use with starter rotary switch and servo connected) should be 1 (OFF) and the servo will be in conflict whether to stay in 180 degre or to go 0 degree. Actually I tried it but servo wants to move another offset doesn't let so it stays still :)

For now, I found a solution :) And This is...

I connected 2 servos to offset 64FC (Left eng starter) and 64FD (Right eng starter). I added comparison like this "if it is = 1, set it to=1, else set it to=0" and also pre-condition (Pre condition is offset 64FE "ignition"). When you start your flight with pmdg, eng start switch comes with OFF position but we told our servo if it is OFF, move 180 degree. Here precondition helps us :) I added pre condition and if ignition is in right position (that means 2), servo can move. If it is not, servo doesn't move. Thus, you know ign comes in 0 position (which is left) so when you start mobi flight servo doesn't move (even if it has to according to offset 64FC or 64FD) because pre-condition isn't OK. However, I have to put pre condition offset before the original offsets that servo use in mobiflight mapping, if not it actually goes to 180 degree when you first start and run mobiflight, although you have precondition.

Another issue is with the new firmware update 1.6.1 servo moves slowly from 0 to 180 degree and this is not good for this use of servo, because of this I have to use 1.4.1 old firmware :(...
2016-12-11 11:21
Avatar
DocMoebiuz
Moderator
From: NW of KPWK, United States
Posts: 1441
Hmm, i added the servo smoothing to prevent stuttering, for example when you use it as flaps indicator.
In your case you want that it moves quickly from 0 to 180... I see... maybe I can make this behavior optional.
Have a great day!
Sebastian

MobiFlight - Simply build your own home cockpit for your favorite flight sim - FSX, Prepar3D (FSUIPC), X-Plane (XPUIPC)
2016-12-11 17:52
Avatar
pizman82
From: ETSI, Germany
Posts: 3322
Supporter
Hi Sebastian and benno.....

I´m back from working and got lots of time while do my job to think about this problem......
My solution with the button is not relay need, i think.... We already got a "Button" in the mechanic too. When the Servo workes and push back the switch to OFF position then we can Use the "Push" contition of the "Off" pin to let the Servo go back.....
BUT like you suscribe i came to the same problem.... When we change the Original Offset there is maby a problem cause the Sim says "Switch offset =1" and the Servo means "Stay at 180" Our Push function says the oposit and will get the value to 0 und turn back the servo.....
So we need TWO different Offsets, to controll Switch and Servo simultary.

Now we need Sebastians knowhow to clear this conflict....
With a duplicate Config Entry for the "OFF" Position of Rotary switch we can do the "turn Back" of the Servo. Entry One sets a Position of the Switch (1) thats needed too, when we turn later the switch from CONT back to OFF while TakeOff. the Second Entry set parallel a Custom Offset to 0 Zero always the Button is moved to Off.

But HOW do we set our Custom Offset when the Original offset change from 0-1 automaticly by the Simulator without a manual button Push from us ??

Again my qestion to Sebastian....
You tell 4 months ago about the improvised "Sleep Counter solution".... If i understand it right you use exactly what we need here....
Maby you not see my quote some posts ago (Post 3129) . I don´t want to re-quote it agai. Pls tell us how to do....

If i´m be able to Set a Offset only with a precondtion (Without button push) like "other offset =1) then i think i can build a system with Preconditions and Compares that workes perfekt and alredy can manage other "Automatic Off" Buttons like AT or JawDamper.

PS.
The solution with two Servos is easyer. But i thought you got a finished mechanic and not like to change this technics.
Good Luck !
2016-12-11 23:29
Avatar
DocMoebiuz
Moderator
From: NW of KPWK, United States
Posts: 1441
iconQuote:

* Configure MF so that another Offset (Offset B, e.g. 0x66C0) is used and increment it's value with Mobiflight continuosly ($+1) but only if a precondition is fulfilled. The precondition evaluates the original Offset A (Offset A > 0).



I think that I came up with an idea which is actually not yet possible. Sorry for the confusion - there is no way to manipulate an offset without a switch event. And continuously increasing a value would require a on repeat event.
Have a great day!
Sebastian

MobiFlight - Simply build your own home cockpit for your favorite flight sim - FSX, Prepar3D (FSUIPC), X-Plane (XPUIPC)
2016-12-12 01:08
Avatar
bennnozgurum
Posts: 39
@pizman82

"The solution with two Servos is easyer. But i thought you got a finished mechanic and not like to change this technics." My friend instead of waiting, I tried to find a solution using what we have :) Perhaps it is not practical but functional :)

I think the only practical solution for this...

After 1.6.1 firmware update servo moves from 0-180 slowly. If we can change this behaviour, we can also add a behaviour 0 to 180 and then 180 to 0. We can add this optional like not 100% but 200% or add line: after 100 percent go back to 0 tick or untick :) Thus I hope Sebastian may add this function in the future.

@mobiflight team
Thank you very much for this great software again...
You help us to make our dreams come true... Thanks to all ...
2016-12-12 09:34
Avatar
pizman82
From: ETSI, Germany
Posts: 3322
Supporter
Nice !
Maby there is another way we can handle this without any Softwareproblem .....

After a google research i found some Information that a servo can move by hand without damage on the motor. (some say the motor must be out of power)

Without a servo i can´t test this but maby you like to do....

1. Question is.... Does the Servo is on Power all the time OR only when it "online" by a Config of Mobiflight. So If the Servo is in 180 Position (After a switching Process) AND we say by precondition that the Servo Config should not work at this moment.... Can we move the Servo by handimput on the shaft or does he then start the motor again and turn back to 180° (it´s last known position before the Config is get off by predonitioning) ?

If we can turn the Servo by hand the solution is totaly simple.....

We set a Custom Offset (e.g.66c0) in a Output without LED only for Precondition and create TWO duplicate Input Configs....
- Starterswitch Position 0 (GRD) Config 1: On Push ... Switch Offset // Change the Value so the simulator knows we turn the switch to GRD.
- Starterswitch Position 0 (GRD) Config 2: On Push.... Custom Offset Value 1 // Duplicate Entry for our Precondition
- Starterswitch Position 1 (OFF) Config 1: On Push .... Switch Offset // Change the Value so the simulator knows we turn the switch to OFF.
- Starterswitch Position 1 (OFF) Config 2: On Push .... Custom Offset Value 0 // Duplicate Entry for our Precondition

Now we set the Servo as normal on the Regulary switch Offset . 0° at value 0 180° at value 1.
As Precondition we say " Only Work when Config of Customoffset Read = 1

If my technic workes the follow will happend.....
If the Switch is on Off Position the Servo is maby on Zero (System Start) or he stays in 180° Position when we do a engine start before. But in Both situations it´s not working cause the config is off because of Pre Condition is false.
If we turn the switch to GRD and the Servo is on 180 it should be posible to "override" the Servo und turn it manualy into zero direction by movith the mechanik with the switchturn.
After the GRD Position is reached the Button Push set our Custom Offset to 1 and let the Servo Start.
As Long the Original Offset is 0 the servo did nothing. when value goes to 1 (By simulator) the servo turn to 180....
After the switch reach Off Position again the Push Input set our custom offset back to 0 and the servo is "offline" again.
He Stays now in 180 Position and the procedure can restart with second Engineswitch.

What do you think about ???
If the Servo is still on power when the config is offline (Precondition) maby we can help us with a trick and put a electrical relay in the 5v Power of the Servo and set this with a output Pin (controlled by the custom Offset : 1= Power on Servo ; 0 is No Power).
The discription i found by google says if no power is on servo there is no damage when we turn it manualy. I Hope thats right !

Good Look. and pls post experience.

EDIT: And Thank you to Sebastian for information about that function.
[Last edited by pizman82, 2016-12-12 14:23]
Good Luck !
2016-12-12 14:17
Avatar
bennnozgurum
Posts: 39
@pizman82

I am now at work pizman82 and I read your post: "if no power is on servo there is no damage when we turn it manualy. I Hope thats right !" However, it is not fully true because when I tried to make it 0 with my hand, I broke one of its gear :).

But don't worry my friend I use mini servo and they are really cheap. I use two servo now and I added preconditions. I use 3 position ignition switch (Left - Both - Right) to make servo "0". I wrote preconditions and now it is very practical because even if it is not simulated perfectly in pmdg, I use ignition switches for example when I start right engine, I make it Right and Left for left engine :) It took my all sunday to make combinations about preconditions with to servos.

If you want, I can share my codes and preconditions :)
2016-12-12 17:00
Avatar
pizman82
From: ETSI, Germany
Posts: 3322
Supporter
Sorry for youre servo.... Do you test with "off power" ?? BUT pls do not test again and broke a second one :-)

If you find time you can share youre config for other users who interested too.....

But with a personal Imput ( Ignition switch) there are lots of different ways now they will worked all.
Like i say to Sebastian...... We need Mobiflight to set a Offset automaticly..... When we use the ignition switch for this, there is the same imput ...Now not by the system but rather from ourself. Different way... Same result !

Last thing in this Topic....
I´m not sure but the Ignition switch will not be used normaly while starting. Engine 1 and 2 will always be startet with the same ignition. The Change of ignition L/R normaly be done one time per Day or maby after every Turnaround. .

If the use of Ignition switch is a little to unrealistic for you, then you can think about a PushButton with a smal Spring Shaft System..... In Real 737 you have to Push Down the Ignition switch (like shown here https://www.youtube.com/watch?v=rhUOqzFdgbg ) before you turn it.
Additional interessting but not can be done with oure amateur equipment... The real Switches do not stay in GRD Position if there is no Pressure in the Air-System.

So if you want more realistic and got another free sunday afternoon.. get a pushbutton and a spring out of a biro ....
This Button will be pushed before Turning the switch an can so "reset" the servo like the ignition switch.
Happy Cockpit-Handycrafting.
[Last edited by pizman82, 2016-12-13 01:57]
Good Luck !
2016-12-13 01:35
Go to page 1Go to page 0123Go to page 2Go to page 3