Board index FlightGear Support Interfacing

Cannot set throttle through telnet in Cessna

Connecting two computers, using generic protocol, connecting with Matlab?

Cannot set throttle through telnet in Cessna

Postby JFM » Fri Mar 25, 2016 1:57 pm

Hello,

I have installed the latest FG version (2016.1) in Windows. I have been testing the telnet interface to change parameters, as a first step to interface FG with an external controller. I have found that for the included model (Cessna 172p Skyhawk) I cannot change the throttle setting. If I select the option "start with engine on" the engine starts up and the throttle is automatically set to 0.2. If I use the mouse or the keyboard I can change it without any problem. However, if I start the telnet interface the throttle does not change. To be more precise, it seems to change for an instant, but immediately afterwards something internal resets it to its previous value. It is weird, because if I do the same to the elevator it changes without any problem. If I use another model (Dassault/Dornier Alphajet) the throttle does change. I am using the property "controls/engiens/engine/throttle".

Is there a bug in this specific plane? Is there some kind of workaround?

Regards,


JFM
JFM
 
Posts: 7
Joined: Fri Mar 25, 2016 1:41 pm

Re: Cannot set throttle through telnet in Cessna

Postby AndersG » Fri Mar 25, 2016 2:39 pm

The new c172p probably uses a non-standard throttle input property as it's FDM configuration contains more than one engine (to support the various runtime selectable variants). You'll need to look inside the c172p files to find out how it is done.
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2524
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: Cannot set throttle through telnet in Cessna

Postby JFM » Fri Mar 25, 2016 3:06 pm

Hello,

I looked inside the files, with little hope, because I do not have much knowledge about them. However, I found something in one of them about "current-engine". I started again FG & Telnet, and it seems that I can set the throttle by selecting "current-engine" instead of "engine". However, the "current-engine" should be "engine" as well, if I understand it right, because there is only an engine. Besides, in other planes I can set throttle at "engine/throttle". Weird thing....

Regards,


JFM
JFM
 
Posts: 7
Joined: Fri Mar 25, 2016 1:41 pm

Re: Cannot set throttle through telnet in Cessna

Postby AndersG » Fri Mar 25, 2016 3:21 pm

JFM wrote in Fri Mar 25, 2016 3:06 pm:Besides, in other planes I can set throttle at "engine/throttle". Weird thing....


Yes, that (engine[0]/throttle) is the standard input property for the first engine. However, as the c172p aircraft supports several variants the aircraft with different engine models it actually has several engines defined of which one at the time is used. To do that they have had to resort to a new set of input properties that are then rerouted to the engine currently in use (which is why your own input directly to engine/throttle is overwritten overwritten).
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2524
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: Cannot set throttle through telnet in Cessna

Postby JFM » Fri Mar 25, 2016 4:11 pm

Hello,

ok, now I can understand it to some extent. They include all possible engines in the same model, and then let you select the right one... which is the one that goes to "current".

Thanks,


JFM
JFM
 
Posts: 7
Joined: Fri Mar 25, 2016 1:41 pm

Re: Cannot set throttle through telnet in Cessna

Postby Johan G » Sun Mar 27, 2016 7:02 pm

AndersG wrote in Fri Mar 25, 2016 2:39 pm:The new c172p probably uses a non-standard throttle input property as it's FDM configuration contains more than one engine (to support the various runtime selectable variants).

While not knowing the technical details and the reasons for that, that seems a bit... inelegant.

Unfortunately I do not really see how for example conditions could be used to make sure that the engines/engine[0] settings should be used. Perhaps several fcs_function functions (if it is using JSBSim) that would use some condition to map engine[0] settings to a particular engine. I am not sure it would work though. :?
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: Cannot set throttle through telnet in Cessna

Postby wkitty42 » Sun Mar 27, 2016 7:25 pm

the c172p is definitely using JSBSim...the reason the team put all of the available engines in the one -set file was to make selection from in the sim easier... consider that you are flying around and have landed at KRDU... now you want to fly over to Jordan Lake just west of Raleigh to do some fishing... so you use the craft's options menu in the sim and select pontoons or amphibious... since you are on tarmac at KRDU, you'd select amphibious so you can take off... when you change the gear like this, you get an engine change as well because many of the water capable c172p craft have been upgraded to a larger engine... the pontoons and amphibious use the 180HP engine by default instead of the normal 160HP engine... once the mechanics have made the changes to the engine and gear, you can select the other engine if you like... anyway, now that you have wheeled amphibious gear on, you can take off from KRDU, fly west, land on the lake and go fishing... don't forget to raise your wheels after taking off at KRDU... you do NOT want them extended when you try to land on water... you'll find yourself taking a swim really quickly if you forget them :mrgreen:

so TL;DR; it is easier to change things in the sim rather than to have to exit the sim and then reload it with the new changes... it is harder work on the programmers enabling this capability but once it is done, it is nice :)
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 5 guests