Starting the Boat
Step-by-step process for how to set up all the electronics and software to run the boat.
Connecting the Peripherals
Before plugging in the batteries ensure the following are plugged in:
IMPORTANT: Do not hot plug anything on the PCB, if you want to plug something in you MUST cut power
- Connect the two
Motor Encoder Wires
(labeled M1 and M0) to the corresponding pin headers on the Odrive. The black wire should line up with the GND pin. The 3.3V pin for each encoder is unused. - Connect the two sets of 3-wire
Sail & Rudder Motor Wires
from each corresponding motor to theSail Motor
andRudder Motor
female bullet connectors on the PCB.
- Plug the USB-C cable from the mast. This plug should have a silver
T
facing up (the top side of the PCB is where the Odrive is). - Plug the other end of the USB-C cable into the crows nest at the top of the mast. the USB-C cable also has a
T
marked on it here, this time theT
should face the 3D print, you should be able to see the black side of the USB-C but not the side with the silverT
. - Plug in the Wi-Fi router to the USB port on the PCB directly next to the USB-C port where the mast is plugged in. Do not plug it into the USB port on either of the Pis, and do not plug it into the USB port the Pi is plugged into.
- Connect the Pi and Teensy with a USB - USB-C cable.
- Connect the Odrive and Pi with a USB - USB cable.
Powering the Boat
- Make sure the power switch is in the
Off
position, try and move both switches together, they are taped together to make this easier. - Plug the batteries into the BMS, match the etape colors.
- If there is nothing else to plug in you can plug the BMS output into the PCB (the lil "| -" plug), if you later realize there is something else you forgot to plug in you must unplug the batteries.
- Flip the PCB switch and Odrive switch. This wll power the rest of the board, including the raspberry pi.
- You should see the 3 Blue LEDs in the top right of the PCB, as well as the green and red LEDs on the Rasp Pi come on. If not look at this guide.
- Power on the Wi-Fi router
Starting the Boat
- Connect you laptop to the
Pitt Sailbot
Wi-Fi access point.- Password is
sailbot
, admin issailboot
- (Optional) Make sure everything is working up to this point by following the first 3 steps in Wifi Connectivity
- Password is
- On your laptop open a terminal.
- SSH into the Pi using the powershell window. The command looks like this:
ssh <user>@<Ip address>
- The following are subject to change:
- Pi5:
ssh pi@192.168.8.11
- Pi5:
ssh sailbot@192.168.8.12
- The passwords for both are
sailbot
- If the Pi isn't connected a phone hotspot or our router then you'll need to connect a monitor and keyboard to the pi.
- Configure the Odrive (on the Pi connected to the Odrive). Make sure the motors are both able to spin a few complete rotations in each direction. With either option you should see a print out of the results with any errors generated. If there are any errors look here
- Option 1:
odriveCalibration.py
. Using0
or1
as an argument will only calibrate the corresponding motor.
- Option 1:
cd ~/Sailbot
python3 ./utils/odriveCalibration.py
- Option 2:
odrivetool
odrivetool
# run the following commands in the odrivetool cli
odrv0.clear_errors()
odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
odrv0.axis1.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
dump_errors(odrv0)
# type quit() to leave the cli
- Start the boat core using the following commands. This will launch the minimum necessary ROS nodes to run RC.
- Whenever the code is changed, make sure to run
. compile.sh
again - Available ROS2 nodes can be found in
setup.py:entry_points
and launch files can be found in/launch
- Whenever the code is changed, make sure to run
cd ~/Sailbot
python3 ./Utils/docker.py run
# you should now be in a docker terminal and see /workspace# to the left of your cursor, if not look for error messages
# you can type "exit" to leave the docker terminal and return to your normal terminal if you need to.
# The following commands should be in the docker terminal
. compileDocker.sh
ros2 launch sailbot boat_all.launch.py
- Turn on the RC controller. You should now be able to control the rudder and sail using the controller.
- Adjust the offsets of the sail/rudder by flipping the sail/rudder offset switch. Then, adjust the potentiometer to adjust the zero point.
Connecting to the Site
- Connect to Pi5 (
192.168.8.11
or192.168.8.12
)
cd Sailbot
python3 ./Utils/docker.py run
. compileDocker.sh
ros2 run sailbot website
- Connect to https://192.168.8.11:5001
Rewiring Devices
Not necessary for startup. Only if swapping components.
Compass
- Look for this and connect the SCL, SDA, GND, and 3V3 pins to the pi.
- To confirm its connected, run
i2cdetect -y 1
and look for a device on 0x1e
- To confirm its connected, run
Windvane
- Thread the 6-pin header cable through the mast
- At the top of the mast, connect the 6-pin header to the windvane
- Connect the header to the rotary encoder on the PCB, matching the direction
Charging Batteries
- Turn on the variable power supply and set to 12.6 volts
- Turn off the power supply, then connect alligator clips between the power supply and the batteries (check polarity)
- Charge until current starts to drop