Stormworks: Build and Rescue

Stormworks: Build and Rescue

Not enough ratings
Boat Pitch Advanced PID w Speed (3 pitch settings)
   
Award
Favorite
Favorited
Unfavorite
Vehicles: Sea
Microcontrollers: Navigation, Microcontroller
Tags: v1.1.6
File Size
Posted
26.525 KB
12 Mar, 2021 @ 12:51am
1 Change Note ( view )

Subscribe to download
Boat Pitch Advanced PID w Speed (3 pitch settings)

In 2 collections by Brygun
Brygun light mod set 1
38 items
BBW Microcontrollers
45 items
Description
This is for boats to give pitch control. It actually has three pitch settings: High speed forward, low speed forward and when reversing.

Typically high speed is 5-10 degrees for a hydro planing boat or 0 for a big ship. Low speed forward and reverse are typically zero. These are set up as properties making it easy to edit them with the select tool. There is also property for speed (m/s) that defines high speed forward.

Parts required:
= This MC
= Linear motion sensor facing forward, that must be set to "directional" mode using the select tool. *that is important*
= A tilt sensor pointing forward
= One or more pitch control devices such as horizontal rudders. For stern intalls positive should be pointing up and then to the bow.
= Optional: Dial or other to see the value of the tilt pointing forward to see how your boat is doing


Note 1: I have found that when slowing down from high speed there is a bit of lurch as it goes from the high pitch to the low pitch. I experimented with trying to smooth that but it wasn't well sorted out and there was still some lurching anyway.

Note 2: Reverse effectiveness will vary greatly by your boat and likely be bad. One challenge is whether the pitch stabilizers are even still in the water.

The P-I-D numbers are set up as properties for likewise easy editing.

This youtube helped me understand PID settings
https://www.youtube.com/watch?v=VVOi2dbtxC0&ab_channel=EEVblog

For your own install I suggest doing 3 tests with P at 180, 360 and 720. Since this MC thinks in degrees those are 1/2, 1 and 2 scales of a circle. During these first tests have I and D at zero (0). You want to find a P number where the boat is osciallating near or around your target pitch.

Then do this:
Take the P found as K(u) and times it by 0.6 which for 720 is 432.

Then run the test to watch how it osciallates. It probably wont get to the desired pitch. This comes shortly. Try to time how many seconds or fractions of a second it takes for the oscillations. For my boat my guess was 2 per second or 0.5 seconds per ossicilation. That is the T(u).

Starting I is T(u)/2 which for my run was 0.25.
Starting D is T(u)/8 which was .0625

Now comes running a series of tests increasing I until you get to a little over the target pitch. Probably the boat is oscillating. Oscillating means the vibration or bounce you see. We lessen the oscillating by increasing the D.

Several tests will need to be run to find good I and D values. You might be able to leave P with the number first calculated but can change it too, followed by a new set of adjusting I and D.

Patience to do several trial runs is important when tweaking a PID.

My tests were done at high speed, cruising speed and then a test for going slowly in reverse. Again, fast reverse for almost all boats will get messy anyway.

I hope this helps you in your game and I am happy to have done my first PID programming in Stormworks.










4 Comments
Brygun  [author] 27 Jan, 2023 @ 4:32pm 
your welcome.
can you post a link to your design?
But Hull 27 Jan, 2023 @ 2:48pm 
Used it on my boat and gave you credit. Thanks for the mic
But Hull 25 Jan, 2023 @ 12:42pm 
Nice