• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FS2004 Ground Speed Limiter

Milton_Shupe

Resource contributor
Messages
331
Country
us-newmexico
Maybe similar to a taxi speed limiter?

I want to limit speed of my ship to 15 knots on the water. The reason is it displaces 250 to 400 tons and requires a lot of power to get it moving. Since it is also a "tall square rigger" sailing ship, with the wind coming from behind, she wants to scoot. So, the simplest way to manage speed is with a gauge.

Here are the key variables involved but I do not have the expertise to code the xml to make it work.

The gist of this is if ground speed is greater than 15 knots, decrement the throttle a little and repeat this process until ground speed is less than or equal to 15 knots. The retest needs to be delayed long enough for the ship to slow after each adjustment.

I appreciate any assistance you can provide.

Code:
<!-- Ground Speed 15 Knot Limit Management -->

<!-- using GPS GROUND SPEED and Throttle_Decr_Small -->

   <Element>

(A:GPS GROUND SPEED, knots) 15 &gt; if{ (&gt;K:THROTTLE_DECR_SMALL) } els{ 0 }

   </Element
 
Hi Milton, here's one thing you can try: use an autopilot section in your cfg, and in the gauge string show values %((A:AUTOPILOT AIRSPEED HOLD, bool))%!d! and %((A:AUTOPILOT AIRSPEED HOLD VAR, Knots))%!d!

and in the <Mouse> section put in something like this:

Code:
<!-- AP Speed hold ON/OFF -->
<Area  Left="309"  Top="96"  Width="30"  Height="8"> <!-- edit this line -->
  <Cursor Type="Hand"/>
  <Tooltip>Speed Hold Toggle</Tooltip>
  <Click Event="AP_AIRSPEED_HOLD"/>
</Area>

<!-- AP Speed Set -->
<Area  Left="429"  Top="96"  Width="24"  Height="8">  <!-- edit this line -->
  <Cursor Type="Hand"/>
  <Tooltip>Speed Set (Mid=current, L=decrease, R=increase)</Tooltip>
  <Click Repeat="Yes" Kind="LeftSingle+WheelUp+WheelDown+MiddleSingle+RightSingle">
    (M:Event) 'MiddleSingle' scmp 0 ==
    if{ (A:AIRSPEED INDICATED, knots) (&gt;K:AP_SPD_VAR_SET) (&gt;K:AP_AIRSPEED_ON) } els{ (M:Event) 'LeftSingle' scmp 0 == (M:Event) 'WheelDown' scmp 0 == ||
    if{ (&gt;K:AP_SPD_VAR_DEC) } els{ (&gt;K:AP_SPD_VAR_INC) } }
  </Click>
</Area>

Use mid-click first to set this in motion, then (if desired) click L to decrease, R to increase the target speed. The AP will auto-adjust throttle accordingly.
 
Last edited by a moderator:
Milton,
There is some sample code in this thread:
http://www.fsdeveloper.com/forum/threads/ground-speed-control.69176/
If you could get a PID controller working in xml, you could likely build it into the model and thus avoid having a separate gauge.

Alternatively, if you don't mind a blunt force approach, it is possible to use FSUIPC to limit speed. Current speed could be checked against the absolute maximum of 15 knots, as well as a current maximum based on acceptable acceleration, and a calculated value then written to the airspeed variable.

Doug
 
Manfred, thanks for that input. I will give that a try.

Up to now, I had tried to use AP with confusing results. Maybe because the ship in on "ground"/water, or the speed is so slow. That is why I am looking for a simple speed limiting solution.

But the (A:AUTOPILOT AIRSPEED HOLD VAR, Knots) may yield some clue.
 
Milton,
There is some sample code in this thread:
http://www.fsdeveloper.com/forum/threads/ground-speed-control.69176/
If you could get a PID controller working in xml, you could likely build it into the model and thus avoid having a separate gauge.

Alternatively, if you don't mind a blunt force approach, it is possible to use FSUIPC to limit speed. Current speed could be checked against the absolute maximum of 15 knots, as well as a current maximum based on acceptable acceleration, and a calculated value then written to the airspeed variable.

Doug

Hi Doug; great to see you around :-)

Thanks for that heads-up. Looks like a workable solution for a water-speed AP :-) That would be handy while negotiating rivers as wind direction changes influence my speeds a lot. The PID should smooth the effects of change and be perfect in this application. Thank you Doug.
 
How about a set of non-visible spoilers with just a "boat-load" :yikes: of drag and no lift parameters. (&gt;K:AXIS_SPOILER_SET) could then be used .. (carefully)

throttle=wind
flaps=sheets
spoilers=nature, water drag etc..
 
How about a set of non-visible spoilers with just a "boat-load" :yikes: of drag and no lift parameters. (&gt;K:AXIS_SPOILER_SET) could then be used .. (carefully)

throttle=wind
flaps=sheets
spoilers=nature, water drag etc..

Good points ... have not yet had to use spoilers but may for the drag if I need it to help control speeds. I have now good wind support for forward motion, some side drift in crosswinds, and no possible forward movement in a head wind.

The forward motion when sails are stowed with a tailwind is handled as I use Parking brake for anchors and engine shutdown.
 
b12.jpg


The primary reason why most of these solutions will not work is airspeed is always faster than my ground speed as wind pushes the ship. In the sim, my airspeed is almost always zero as a result. My speed limiter needs to be based on GPS Ground Speed so AP-like code will not work.

Therefore I am back to my original question.
I want to limit speed of my ship to 15 knots on the water. The reason is it displaces 250 to 400 tons and requires a lot of power to get it moving. Since it is also a "tall square rigger" sailing ship, with the wind coming from behind, she wants to scoot. So, the simplest way to manage speed is with a gauge.

Here are the key variables involved but I do not have the expertise to code the xml to make it work.

The gist of this is if ground speed is greater than 15 knots, decrement the throttle a little and repeat this process until ground speed is less than or equal to 15 knots.

So, the key question is how do I code this to decrement throttle (a "K" event) when GPS Ground Speed is GT 15 knots?

Code:
<!-- Ground Speed 15 Knot Limit Management -->

<!-- using GPS GROUND SPEED and Throttle_Decr_Small -->

   <Element>

(A:GPS GROUND SPEED, knots) 15 &gt; if{ (&gt;K:THROTTLE_DECR_SMALL) } els{ 0 }

   </Element
 
Last edited:
Could you not do something in the airfile such as induced drag? ie. the faster you go the more drag there is to the point that beyond 15kts there is so much drag that 15kts becomes the max.
 
Could you not do something in the airfile such as induced drag? ie. the faster you go the more drag there is to the point that beyond 15kts there is so much drag that 15kts becomes the max.

The issue there is drag is based on airspeed of which I have none, or minus because the wind is always faster than the ship. That's why the solution must be based on ground speed.

I just need to know how to fire off a K event to adjust throttle.
 
Okay, I found the answer to my question. Now just need to sort how how best to use it. :-) Thanks all for your suggestions.

Code:
<!-- Ground Speed Limiter to 15 Knots -->
   <Element>
      <Select>
        <Value>(A:GPS GROUND SPEED, knots) 15 &gt; if{ (&gt;K:THROTTLE_10) } els{ 0 }</Value>
        </Select>
   </Element>
 
Hi Milton,

Maybe a bit late, but if you're interested in a completely different solution:
I have made many implementations for VTOL-capable aircraft (or carrier launch/traps), based on overwriting the FS-calculated airspeed or groundspeed by air/ground speed calculated in a gauge based on whatever criteria.

So it wouldn't just be a speed "limiter", but an algoritme that commands groundspeed (== speed relative to the water surface) in both longitudinal and lateral direction (and heading, if you want).
Depending on wind speed/direction, whether you're actually sailing or on an engine, etc ....

In fact, I'm sure I could implement a ship speed algoritme in an XML gauge that would be better then "tweaking" the normal FDE; like actual speed and accel-/decelleration ( based on thrust, or wind speed/direction).
If you're interrested, contact me directly via mail.

Making a good "FDE" for a sailing ship (either actually sailing in the wind, and/or propelled by an engine, or both) would be a new challenge in FS ... :)

The only problem I would have for development: I don't have FS9 anymore, but if I can load the ship's model in FSX that's not a problem.
My speed control code will work in both FS9 and FSX...

Rob Barendregt
 
Last edited:
Hi Rob,

You are very kind and generous Sir. Of course I am interested to see what we can do here. If you are interested in sailing, this will be an interesting project. I have many things completed but a few yet to do.
I run the Bounty in both FSX and FS9. The issue I had with other code was reliance on FSX's groundspeed instead of the (A:GPS GROUND SPEED, knots) as used in FS9 (and also available in FSX).

I will PM you shortly.

Thanks
Milton
 
Back
Top