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
franciscoignacio
Posts: 34
Hi again and thanks for reading!

I need some help in my 737 project.

I'm trying to move my elevator trim wheel, and I need to set 2 outputs for the trim wheel of 737 TQ. For example, when the wheel move fwd put one output to 1, and another output -1 when the wheel moves back. Later using a relay module I will move the electric motor fwd or back.

I found in FSUIPC this offset 0BC2 ELEVATOR TRIM OUTPUT.

The value of the trim possition is correct, and it increase or decrease with the virtual cockpit 737 wheel, but I´dont know how to convert this parameter with MF in a simple status. Only 1, -1 and 0

I mean, I only want to get only a value when the wheel is moving in each direction.

Does MF have any way to program a variable code or interpolation to get a possitive value when the offset number is increasing or decreasing?

Thanks!

Kind regards. Francisco.
2017-05-23 17:53
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

I Think youre basic technic is NOT posible direct via Mobiflight.
As you already find out... Mobiflight is not be able to use a direct Variable compare, and it´s not posible to write a Offset only in condition of anouther offset ( writes only posible with a Input by the user at the moment.

This basicly would be posible when you write a own script. You need to Read Out the Offset twice with a little breake and then subtract one of the other variable. If result is ZERO then there was no moving.... If there is a positive or negative result then there was a moving clock or counterclockwise ( even if its positiv or negativ).
THIS Result of the script can exported via a Offset, too and can be readout from Mobiflight,

But remeber.... With this technic you not get a 1:1 Result in Position of the wheel. You only can say for example " When Value increase, then turn the wheel for 1 Second" But it tuns 1 second even the trim was increase by 0,1 or 0,3 .... both give the same Signal. So Indication of trim direct on the wheel is not exact. For EXACT 1:1 Moving i think you need a STEPPER ! ( But MABY you not realy need exact positions and you like simply a moving for realistic Optic.... THEN youre idea is a good way, too)
************

Solution with Mobiflight at the moment.

Mobi work with stepper Motors at the moment.... So you can do your trimwheel with a stepper, too. Only Problem.... You can´t move youre trimwheel manualy cause a stepper motor not allow a turning.

If you only use for manual trim the Buttons on the Yoke for example and NOT touching the Wheel itself then a Stepper will work. It "shows" the Value of the Offset in form of turning the Wheel..... And it logical turns the wheel if you push the Trim Button and manipulate the Offset itself.
Good Luck !
2017-05-24 13:20
Avatar
franciscoignacio
Posts: 34
Many thanks pizman82!

The reason of use the method I told, is because I have an old TQ from poldragonet that comes with a electric motor to turn the wheel in a simulated form. The original card of the TQ was removed many years ago, and I bought it from second hand market without controller. With leo bodnar card and arduino with MF my TQ returned to life in very saticfactory way.

I'm using a stepper motor for my wet compass and the behaviour is fantastic and very accurate with MF. I think that your idea is perfect for my objective, but unmount the elec motor from the TQ to install a stepper seems not to be easy for the moment.

Thanks for your reply.

I will post again if I found any solution.
2017-05-24 14:08
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Additional Note:

If you like you can use a provisionally solution for the moment !

As you know now a Readout of Increasing decreasing of the trim is not Posible without own script....

BUT:

A Manual Trim is a Input with a Button ( If you trim via the buttons on Yoke)
You can without problems use THIS Buttons for a duplicate Motor Controlling.

So If you push the Trim+ or Trim- Button you set the Value of the Offset AND Same Time you can Power up the Motor in the liked direction !
Simply duplicate the Input Configs.... The First Write the Offset for the Simulator Trim.... the Second write a Custom Offset.
Then Readout the Custom Offset with your Relais and power so the Motor.
EDIT: OR Directly cable the two switches to the Releais.... Then you not need a Config in Mobiflight for this.... Then a Button Push controls the Offset Via Mobiflight AND Power the Motor via Hardware Connection ( Without Mobiflight)

RESULT: You Motor turn the Trimwheel always when you trim Manualy by the Buttons.... BUT It stand still if the Autopilot controll the Trim !
Not Perfect.... But a Cool thing without much work !
Good Luck !
2017-05-24 15:02
Avatar
franciscoignacio
Posts: 34
Hi pizman82!

This method of duplicate the input config and custom offsets to assign push button sound very good.

As you told, the trim wheel only will move when I push the trim from the yoke manualy, but by the moment is a easy sollution to make the wheel turn.

Thanks, thanks, thanks!
2017-05-25 09:49
Avatar
Gemu
Posts: 101
Or You connect your trim switches direct to the motor, not to any controller and then apply an encoder to the motor axis. The encoder You can connect to the flightsim via Bodnar or Mobiflight. This way you can use trim switch and wheel.

Greetings
Gert
2017-05-25 19:13
Avatar
franciscoignacio
Posts: 34
Thanks for your coments. I will try different options.

Thanks again!
2017-05-26 13:58
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
iconGemu:

Or You connect your trim switches direct to the motor, not to any controller and then apply an encoder to the motor axis. The encoder You can connect to the flightsim via Bodnar or Mobiflight. This way you can use trim switch and wheel.

Greetings
Gert



Just a question...
We talk about this some time ago here.

Is it posible to move the Wheel by hand ?? If a Motor is set ( we test this with a stepper Motor) then it is not posible to turn the wheel.... the Motor is BLOCK the Shaft.
Maby this was only a problem with a STEPPER Motor.....

So question: Is it posible to move the Wheel manualy or destroy this the connected Motor ??
I always thought to move this by hand you need a "grinding clutch" so the moving not turn the motor itself !

.
[Last edited by pizman82, 2017-05-27 15:42]
Good Luck !
2017-05-27 00:34
Avatar
StephanHo
From: EDDG, Germany
Posts: 1867
Supporter
Hi,

I know it from another Project. It should be possible to adjust the "Duty Cycle" of the Stepper. Duty Cicle is the adjusted current to hold the stepper on his position while a power is working on his rotation.
The value is in %. 100% duty cycle requires a high current to hold the stepper in his position. This value is depending of the force which operates on his shaft. With a duty cycle of 0% the shaft should be free movable.

I think that Sebastian adjusted the duty cycle value in the according library unless it is required.

Currentless the stepper is blocked by itself, but please don't ask me how this works exactly. Wheeling the shaft manually may damage the stepper.
Otherwise the stepper lost his Zero-point-reference, adjusted in MF after moving the shaft manually. So you have to readjust in our case with MF because there is no memory to save the positions. The driver knows the position only while he is switched on and has triggered the actual position.

So I think Pizman is, how so often ;) , absolutly right!
Grüße,
Stephan (Time: UTC+2)
2017-05-27 10:04
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Ok.

But then we realy can think about this system with the new aspects.....

Shure... If we move the Stepper ( When it´s posible via Duty cicle) then it lost the Zero Point.... BUT:
If we use a Normal Motor that only have 2 Power lines for the Directions AND Combi that with a Encoder in the Shaft then we have a indcator for Position again.....

Whatever the Wheel is turend by Motor or by hand.... The Encoder is working and sending data to the System.

Now a simple Math Calculation can help us.... We define the Encoder Input to a range that is 1:1 to the Range of Trim Offset. For example 16383 for Both.
Now we write a script that say READ Trim Offset, READ Encoder INPUT Offset ..... Then Trim Offset subtract - Encoder Offset.
If Result = 0 then they ar synchron.... If Result is positiv It Need to turn the Motor in One direction... If it is negativ we have to turn the Motor in other Direction.

That would be posible with a 2 line script, 2 Custom Offests and some Mobiflight Configs.....

Only Problem now is the Priority.... When we turn by hand.

If we use this system then a hand turning will result in a different Value of Encoder and Offset .... But we say the motor should turn the Wheel so the Encoder is again synchron with the Trim Offset..... So System will turn the Wheel back to the position before we start to turn it manualy.

BUT: We can additional use a Precondition now and can Say.... The Motor- Encoder Logic should only work when Autopilot is on..... If Autopilot is OFF we need then a different logic so the Encoder now WRITE His Data to the Real Trim Offset.

Summary... A Two Way System with Autopilot Master ( Or maby VNAV) as indicator.... With Autopilot OFF the Wheel is a Input via the Encoder and WRITE The Trim Offset..... With Autopilot ON The Wheel change to a output controlled by the Motors and READ/ Show the Trim Offset ( But not set it )

What do you think about..... I´m not shure what happend in a Real B737 if AP is on ( and controll the Trim) and the Pilot turn the Wheel manualy.... Is it Blocked ? Does it ignore the Input ?? or is it simmular that i explaned and the wheel will turned back to the Position the Autopilot want at the moment ??
Good Luck !
2017-05-27 16:03
Avatar
Gemu
Posts: 101
iconpizman82:

Ok.
..... I´m not shure what happend in a Real B737 if AP is on



In a real aircraft using the wheel by hand with activated autopilot, the electrical trim system will be override and disconnect the Autopilot. The use of the stabilizer trim switches will also disconnect the autopilot. So there is never a situation you have to fight against the trim wheel. In flight simulation this behavier could be very difficult to implement.
May be monitoring the current of the motor. If the motor is moving and you move it by hand, then the current will increase a little. A circuit kann measure that and give an output. But the autopilot is not triming all the time, so there must be also a timer funktion to compare the trim offset value every few frames. Something like a hardware/software solution should be possible. But may be it´s easier to disconnect the autopilot with the normal yoke button, before using the trim wheel. Not real, but better for the nerves and the purse. :D
2017-05-28 07:50
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
OK. Thats the same Problem like AT Disconnect or better AT Hold Function in Boeing.

If you controll the Throttle Manualy while the AT is ON then the AT will get into a sleep mode ( HOLD Mode) . (The Crash of the Asiana B777 in KSFO was cause of that)

Maby in Real Aircrafts there is a detect of Pressure in the Throttle (Trimmwheel) If we use phisical power that work against the Motor then the System check this and for exampel disconnect the AP/AT.

Ok. Thats maby verry Difficult to simulate.... If Yes like you said only with a cood Hardware Solution....
BUT.. I Think with the descripted technic we get a verry realistic System that looks optical nearly 100% Real....

And think about..... how often do you trim the Plane with the Wheels in your cockpit. i would say Never... Only when the Yoke Buttons are dameged.
Good Luck !
2017-05-29 16:49
icon