Stormworks: Build and Rescue

Stormworks: Build and Rescue

Not enough ratings
Depth Sounder
   
Award
Favorite
Favorited
Unfavorite
Vehicles: Sea
Microcontrollers: Calculation, Microcontroller
Tags: v0.10.15
File Size
Posted
Updated
23.839 KB
25 Apr, 2020 @ 4:35pm
27 Apr, 2020 @ 2:51am
4 Change Notes ( view )

Subscribe to download
Depth Sounder

Description
Wire up a distance laser with a pair of tilt sensors. Optionally, put an altimeter next to the laser (on the same height).

Module does some trig using the pitch and roll angles from the sensors, and compensates for the laser's altitude. This should give you an accurate seafloor depth, assuming the laser's angle isn't causing it to land on a portion of the seabed that's not at the same height as directly below you.
5 Comments
Neottious 14 May, 2021 @ 5:27am 
Tilt sensors don't actually measure pitch and roll, but they measure distance from the horizon. This is why you can get pitch from a tilt sensor just fine. The problem comes when you try to measure roll, though. It will not give you correct roll data.

To get accurate roll data, you need a leftward-facing and an upward-facing sensor. Use 2 input arctangent here, like "atan2(left,up)". Output will be in radian, input can be direct from tilt sensor.

Lua's math.atan function can take 2 arguments just like the atan2 function in the function blocks.
Brygun 24 Feb, 2021 @ 4:57pm 
Thanks. In trying that I was realizing your probably already accounted for the pointing question as you already had roll left/right and up/down.
Looks good on boat feeding a gauge turned vertical with a constant number to the second red line as a warning that its time to worry about touching bottom.
draeath  [author] 24 Feb, 2021 @ 3:12pm 
Actually, I'm pretty sure you can mix up pitch/roll and get the same result.
draeath  [author] 24 Feb, 2021 @ 3:11pm 
I have my sensors arranged like this [i.imgur.com], where the roll sensor is pointing to port and the pitch sensor is pointing aft.

However, it shouldn't matter if these are pointing left/right or forward/backwards for this, as a 15 degree left roll and a 15 degree right roll have the same effect. Likewise for pitch.

(for completeness, I have the altimeter next to the laser emitter)
Brygun 23 Feb, 2021 @ 7:39pm 
Which way should the sensors be pointing? I use a tilt sensor facing right other left (as well as just about everyone having one facing front)