Make your BlueBoat self-righting with a T500!

Attention all BlueBoaters!

Have you wanted to operate your BlueBoat in heavy seas or breaking waves, but been concerned that it might flip over? Have you sent a (specialized) BlueBoat named the SolarTurtle on a mission to travel from Los Angeles to Hawaii only to have it get flipped and drift to San Diego before being recovered?
Maybe you’ve launched your BlueBoat at a beach, only to have it flip when you were trying to navigate out past the breakers…

Let’s learn how to unlock “honey badger” mode for your BlueBoat, enabling it to automatically flip upright if the vehicle detects it is upside down, in less than a few seconds, with the power of a LUA script. This creates a vehicle that just keeps going - it doesn’t care what the sea state is!


(see a GIF in this presentation - inherently larger than the 4mb image limit!)
We’ve done some (limited) testing with this and been impressed enough with the results that we just had to share this (still early) design! There is still experimentation to be done, such as determining just how short the mounting arm can be before the T500 doesn’t have sufficient leverage to right the BlueBoat…

CAD Model(s) (Onshape - copy and customize!)
3D Printed parts (Printables)

What you'll need

1X T500
1X Basic ESC 500 (standard variant)
1X piece 3/4"x3/4"x3’ aluminum square tubing (I got mine from Home Depot)
1X 3D printed Thruster Mount
1X 3D printed Crossbar Mount (Get both from Printables - PETG is a good filament choice for strength)
2X M8x40 316SS SHCS Bolts
1X M8 Nylon Locknut
4X M4x25 mm SHCS bolts for securing square tubing to mounts
2X M4x30 mm SHCS bolts to secure T500 to mount
2X servo extensions - ~1.5m length of 20-28 gauge wire, terminated with Servo-style 3 position 0.1mm header on both ends (Male on one end, female on the other - easy to make or buy)
Zip ties - what project doesn’t need a few of these?

Tools
3.5 mm Drill bit and Drill
Hack saw or sawz-all / reciprocating saw
Soldering iron (to attach bullet connectors)
5mm Alan key
3mm Alan key
Hot air gun (optional)
Sharpie / marker

Parts oriented for printing (2.5 hours on a Bambu P1P, 4 perimeters, 20% infill):

Instructions

Hardware setup:

Roll up your sleeves....

Internals

  1. Solder bullet connectors onto the BasicESC 500 leads and T500 wire-ends.

  2. Install the T500 WetLink Penetrator in the port stern penetrator hole.

  3. Using the bullet connectors included with the T500 Basic ESC and thruster, connect the ESC to the flipper T500 wires inside the Port electronics tray.

  4. Zip tie the ESC500 to the frame, and connect it to power where the existing ESC500 connects with lugs - you should probably do a better job than I did here, and use spade connectors!

  5. Take your Servo PWM extension cable (20-28 gauge) and route it from the Port hull, through the cross tube, and connect the female header pin connector to the Navigator at PWM output #5. If you don’t have a coat-hanger to unfold and persuade the cable to go through, the BlueBoat flag pole can work as a tool to make this easier - just feed it through the cross tube (detached from both barbs) and tape the wires to the end so that you can then draw them through.

  6. Connect the male header pin to the ESC500 you installed, making sure that you’ve correctly connected ground and signal wires to the Navigator, and not reversed them at either end.

Externals

  1. Mount the Crossbar Mount to the center of the rear cross bar - first install a M8 nylock nut oriented to accept the M8 bolts coming through the crossbar. Push the nut into the pocket until it won’t go any farther, and the bolt coming through the crossbar can thread into it. Screw the second bolt through the crossbar at 90 degrees to this, tapping into the plastic of the part.


    It may help when going to cut these threads if you heat the bolt with a hot-air gun for 5-10 seconds before screwing it in. Don’t overtighten!

  2. Slide the Aluminum square tubing into the mount, and with 22" protruding up and behind the boat from the mount, mark the remainder of the tube at the bottom of the mount. Remove and cut along this line with a hack-saw or sawz-all.

  3. Attach the T500 to the mount, and secure it with 4x M4x30 bolts.

  4. Slide the mount onto the square tubing, orienting as shown for maximum righting force!

  5. Drill 2x 3.5mm holes through the mount, and tap the M4x25 bolts into the holes to lock the Thruster in place.

  6. Drill 2X M3.5MM holes through the crossbar mount and through the Aluminum tube. Lock this to the crossbar mount with 2x M4x bolts.

You should now have the T500 securely fastened to your BlueBoat!

It is critical that you arrange your batteries or other payloads to offset this weight on the stern. Two batteries placed as far forward in the nose as possible is enough to let the boat sit level in the water!

Software Setup

Break out your computer
  1. Open the BlueOS interface and navigate to the File Browser.

  2. Go to ardupilot_logs/firmware/scripts, and copy the t500flipper.lua script to the folder. It should look something like this:

  3. Edit the Autopilot Parameter for Servo5_Function to RCIN5

  4. With the script in place, restart the autopilot (this can be done from the BlueOS power button in the lower left > Restart Autopilot)
    image

t500flipper.lua (1.0 KB)
That’s it! The code is shared for review here as well.
information you want to fold down

Code
function is_upside_down()
    -- Check if the vehicle iss upside down
    local roll = math.deg(ahrs:get_roll())
    return math.abs(roll) > 90
end

local previously_flipped = FALSE
local MODE_HOLD = 4

local RC5 = rc:get_channel(5)
local currentmode 

function update()
    if not ahrs:initialised() then
        return update, 2000
    end
    if is_upside_down() then
        if not previously_upside_down then
            local mode_num = vehicle:get_mode()
            currentmode = mode_num
            gcs:send_text(0, "RC_override flip_over attempted!")
        end
        vehicle:set_mode(MODE_HOLD)
        RC5:set_override(1100)
    elseif not is_upside_down() and previously_upside_down then
        gcs:send_text(0, "RC_override flip_over cleared!")
        -- restore mode
        vehicle:set_mode(currentmode)
    else
        RC5:set_override(1500)
    end
    previously_upside_down = is_upside_down()
    return update, 1000
end

return update() -- run immediately before starting to reschedule

Note that rc:get_channel(5) defines the 5th ESC output to be connected to the T500 used for flipping - if using a different port, change this #.

Testing

Let's Goooo!!
  1. If you lift the vehicle so that it goes past 90 degrees on any axis, the T500 on the arm should kick on!

  2. Verify that the air moving from it is going in the direction that would push the nose of the BlueBoat downwards:

  3. If the direction is not correct, you can either reverse any two of the motor wires going to the T500, change the 1100 to 1900 in the t500flipper.lua file (line 24) or change SERVO5_Reversed parameter to the opposite of its current state.

When the vehicle is again upright, it will revert to the mode it was in previously - so if loitering or doing an AUTO mission, everything would just keep going!

When the vehicle starts up, after you hear the main propulsion motors beep to say they are initialized, you may hear the T500 Flipper continue to beep for a few seconds longer. This is because the AHRS system is not yet reporting that the vehicle is upright, and is expected!

Rest easy, your problem should now be solved! This post is a bit long, but tries to cover all of the nitty-gritty details. Make sure to share your results if you give it a try, or if you get stuck somewhere along the way!

If we see a lot of traffic and excitement around this solution, we could definitely consider creating a standardized, non-3D printed part reliant “kit” for purchase.

I’d love to see some videos of the BlueBoat self-righting in crazy sea states… In the meantime keep those props spinning!

6 Likes

You guys are absolutely brilliant!

1 Like

Is this working with a 4S battery, or are you using 6S?

Hi @CA_BlueBoat -
Two 4S batteries were installed for testing, as close to the nose as possible as detailed!

Looks promising, but if you have a fish-finder mounted like the Lowrance you showed in another thread, I wonder if the boat can flip back over with this extra weight? Those boats you showed in the video were modified a bit to prevent a flipover.
It seems to me watching the video that the hulls are too short in length. Why not lengthen them a foot or so and not risk a flipover?

Hi @bajaMike
Youre’ correct, adding payloads to the system may affect it flipping back over. However in the video / gif linked, both the solar panel and a box containing a planktoscope were mounted to the boat, this is nominally the same weight as the lowrance. I’ve since tested the flipover with T500s fit to the boat, and it worked just fine. I’m not sure what you’re referring to by mentioning the boats being modified to prevent a flipover - that’s the whole point of the T500 mounted behind the vehicle to the arm!

The BlueBoat is a 1.2m long vessel, we may make a longer version in the future! It is currently sized to be as portable yet useful as possible, but catamarans are inherently more at risk of flipping, and not typically self-righting when compared to monohulls. They do have great roll stability for sonar usage though!

I have never seen a Hobie or other cat flip over (actually called a front rollover), but of course they have rolled over due to side loading. Too bad the T500 are so expensive as another viewer stated. Just use a trolling motor.

Hi @bajaMike -
It’s not so simple as just using a trolling motor! Those are typically brushed DC motors, so putting aside long-term life concerns, they are controlled via a different method (H-Bridge, direct application of drive voltage), and at a lower voltage. They are also inherently much less efficient! The work of cracking open a trolling motor and reverse engineering it to be able to drive it with a control signal is no minor undertaking, and the method to do so will vary from vendor to vendor!
Some folks have had luck in that power class with Torqueedos, but those make T500s look cheap! Indeed a common trolling motor of equivalent power is comparable in price…
The T500 is more efficient, durable, and easier to control in robotics applications! While not cheap, it is an order of magnitude cheaper than subsea thrusters of similar power. Enabling affordable marine robotics is the Blue Robotics mission!

Hi @bajaMike,
I’m slightly lost in the distinction between “flipping over” and “rolling over”.
Capsizing by pitching is pretty common in a hobie / dart type cat, it’s called a “pitch poll”. But I’m sure I’m misunderstanding your post.

Either way, the blueboat is a different size, shape and loading characteristics to a dinghy sailboat, so I don’t think it’s worth comparing the flipping mechanisms.

This work by Tony is a great addition especially if you:

  • Plan on using expensive survey equipment
  • Don’t have flexibility on the days you will be deploying (rough sea)

In these cases, reducing the risk of flipping would be surely be worth the cost.

To me using a trolling motor seems like it would be very complicated as a self righting motor. If you have done this or are considering, it would be great if you could keep the community up to date.

1 Like

Sorry for the confusion. The way the T500 is set up, it will flip the BB back over from a front or rear roll-over, not a side-to-side roll-over. Because the lengths of the hulls are very short (compared to a Hobie 16 for example), a front or rear roll over is very likely and if you watch the video you see the BB rotating that direction.

I like the concept of the BB, but it’s hull length is too short for me but others may not care.

And after looking over trolling motors I would likely just get the T500 with the ESCs and make my catamaran project a bit simpler.

For sure the BB is the least expensive of many USVs now on the market. Take a look at the many USVs that appear in the July 2024 issue of

Nearly all the catamaran-type USVs are longer than the BB, and of course are much more expensive.

Hi @bajaMike -
While the BlueBoat is likely to flip over in the pitch direction, the T500 will bring it vertical in that way regardless of how it ends up there! So a side roll would still trigger the system to flip over…

1 Like