FORUM › Forums › Products › CLS-E Joystick › External Autopilot Trim
Tagged: external autopilot trim
- This topic has 0 replies, 1 voice, and was last updated 1 year, 5 months ago by carloselfietro.
-
AuthorPosts
-
16/07/2023 at 16:47 #3158carloselfietroParticipant
Goodday,
We are using X-Plane11 with our external autopilot written in C. In another post we’ve found the how to use the dataref “beh/autopilot_external_control”.
To which we are writing the following values:
Autopilot engaged: 5
Autopilot disengaged: 1While the autopilot is engaged we’re directly controlling the aircraft by writing to:
“sim/joystick/yoke_pitch_ratio” and “sim/joystick/yoke_heading_ratio”.But in order for the autopilot to keep the aircraft in trim, we would need someway to read the force applied to the joystick/yoke.
The trim range is set to zero in planemaker, as per the Brunner youtube video.
For the moment we are calculating the force as follows:
“the way the trim logic works is it tries to get the difference between “sim/cockpit2/controls/elevator_trim” and “sim/joystick/yoke_pitch_ratio” to zero.
The first is a value between -1 and +1 expressing the relative position of the elevator induced by the trim, so if the trim is set to push the elevator up 30% of it’s maximum range, this value should be 0.3
The second is a value between -1 and +1, which is the yoke Y position so this should also be the relative position of the elevator in it’s range.”This does not work however.
Is there a way to read the force applied to the stick directly from CLS2SIM? By reading UDP packets in our C program for example, or any other means?
The screenshot attached is from CLS2SIM and shows the force I would like to read.Many thanks,
CarlosAttachments:
You must be logged in to view attached files. -
AuthorPosts
- You must be logged in to reply to this topic.