<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.engineersofinnovation.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Aran+Dokoupil</id>
	<title>'Engineers of Innovation Wiki' - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.engineersofinnovation.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Aran+Dokoupil"/>
	<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/wiki/Special:Contributions/Aran_Dokoupil"/>
	<updated>2026-06-21T23:17:47Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Autopilot&amp;diff=308</id>
		<title>Autopilot</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Autopilot&amp;diff=308"/>
		<updated>2026-06-16T10:37:21Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* CAN Bus Format */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Platform ==&lt;br /&gt;
Ease of development dictated the choice to run the control loop on existing hard- and software, which was chosen to be Ardupilot running on a [https://docs.cubepilot.org/user-guides/autopilot/the-cube-module-overview orange cube].&lt;br /&gt;
[[File:Ardupilot.jpg|thumb|Ardupilot PCB with the orange cube mounted.]]&lt;br /&gt;
To make use for our application a PCB has been designed to integrate into the hydrofoil design.&lt;br /&gt;
&lt;br /&gt;
To connect to the ardupilot on the cube for tweaking settings and tuning control loops, [https://ardupilot.org/planner/docs/mission-planner-overview.html Mission Planner] is used. The control logic itself runs as a Lua script on the cube (see [[#Lua control script|Lua control script]]). The following sections describe the tweaked settings and the on-board script.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
The cube is a plug-and-play unit and therefore does not need setup changes in the underlying ardupilot software. Only necessary settings should be tweaked.&lt;br /&gt;
&lt;br /&gt;
Apart from the settings, tuning needs to be done in Mission Planner; this can only be done with the solar boat in the water and therefore no values are known for now.&lt;br /&gt;
&lt;br /&gt;
The ardupilot PCB supports three servo motors, two front and one back motor. It has two isolated power supplies for the servo motors. Support for CAN and the cube is powered by the 24V input from the CAN connection.&lt;br /&gt;
&lt;br /&gt;
It has its own GPS antenna and four UART serial ports, where Serial1 is used for the MAVLINK connection to Mission Planner running on a laptop. The two ultrasonic height sensors connect over the '''CAN bus''' (through an RS485-to-CAN interface PCB), not the cube's UART ports; the Lua control script reads them to keep the boat at its target ride height so it can 'surf' over waves.&lt;br /&gt;
&lt;br /&gt;
For steering on foils an extra MCU is added onto the board, namely the ATSAMD20E18A. This MCU receives the steering position from the rudder and forwards it (it is intended to be put on the CAN bus for the control system to use).&lt;br /&gt;
&lt;br /&gt;
== Height Sensors ==&lt;br /&gt;
Currently testing ultrasonic height sensors, the RS485 version of the DYP-A02YY4W-V2.0, with a CAN-interface PCB in between that places the readings on the CAN bus.&lt;br /&gt;
&lt;br /&gt;
Each sensor broadcasts a 3-byte frame at 8&amp;amp;nbsp;Hz: byte 0 is a status enum (0x02 = Operational, anything else = no valid reading), bytes 1–2 are the measured height in millimetres (uint16, little-endian). The front-left sensor uses CAN ID 0x011 and the front-right 0x012 (see [[#CAN Bus Format|CAN Bus Format]]).&lt;br /&gt;
&lt;br /&gt;
The sensors are mounted as far forward and outboard as possible to stay clear of the bow wake (CAD: 3.8&amp;amp;nbsp;m forward, 0.23&amp;amp;nbsp;m left/right, 0.175&amp;amp;nbsp;m above the IMU). The trade-off is that their reading changes strongly with roll; the Lua script presents each sensor to ArduPilot as a downward scripting rangefinder (so ArduPilot median-filters and logs them) and applies a roll/pitch + lever-arm correction before using the values for control (see [[#Lua control script|Lua control script]]).&lt;br /&gt;
&lt;br /&gt;
== Lua control script ==&lt;br /&gt;
The foil control logic runs as a Lua script on the cube (in the project git). It is a '''cascade''' that leans on ArduPilot's tested C++ attitude loop rather than re-implementing control in Lua:&lt;br /&gt;
&lt;br /&gt;
* '''Inner loop — ArduPlane FBWA (mode 5):''' stabilises pitch and roll attitude from the IMU and drives the three foils as control surfaces. The two front foils are configured as elevons and the rear foil as an elevator output.&lt;br /&gt;
* '''Outer loop — the Lua script:''' reads the two CAN height sensors, computes a roll/pitch + lever-arm-corrected ride height, and turns the height error into a gentle pitch-target bias on the pitch input channel while holding roll level. Vertical-velocity damping uses the EKF's IMU-fused velocity estimate.&lt;br /&gt;
&lt;br /&gt;
The rear foil is driven over CAN: the script reads ArduPilot's elevator output and sends it as a servo command (ID 0x010).&lt;br /&gt;
&lt;br /&gt;
'''No RC transmitter''' is fitted — throttle and rudder are handled separately. Attitude targets are supplied via RC channel overrides from the script, refreshed every loop. A hardware '''enable pin''' (FMU_CH6) switches between active stabilisation (FBWA) and neutral foils (MANUAL). It is wired active-low and fail-safe: a disconnected or open enable line disables foiling.&lt;br /&gt;
&lt;br /&gt;
On boot the script enforces the parameters it needs (see the [[#Ardupilot settings|settings table]]) and falls to neutral foils on loss of the enable signal, stale sensor data, or a script error. It also publishes attitude, both height estimates, and a status word on the CAN bus for the datalogger (see [[#CAN Bus Format|CAN Bus Format]]).&lt;br /&gt;
&lt;br /&gt;
Two height estimates run simultaneously and are both logged: the Lua roll-corrected value (currently used for control) and ArduPilot's EKF/rangefinder height. The first on-water runs will be flown with the foils disabled to collect this data and decide whether the EKF estimate is reliable enough to drive control.&lt;br /&gt;
&lt;br /&gt;
The script is checked with luacheck and has been validated in ArduPilot SITL (software-in-the-loop) with the CAN bus simulated over UDP multicast.&lt;br /&gt;
&lt;br /&gt;
== Ardupilot settings ==&lt;br /&gt;
To use the ardupilot as the foil control unit, some settings need to be changed. '''Most of the settings below are applied automatically at boot by the Lua script's parameter-enforcement routine''' — only &amp;lt;code&amp;gt;SCR_ENABLE&amp;lt;/code&amp;gt; and the physical sensor mounting offsets (&amp;lt;code&amp;gt;RNGFNDx_POS_*&amp;lt;/code&amp;gt;) must be set/measured manually. There are more ports available on the ardupilot; whenever more are used or changed the table will be updated.&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Configuration of ardupilot&lt;br /&gt;
!Setting&lt;br /&gt;
!Value&lt;br /&gt;
!Description&lt;br /&gt;
!Reason&lt;br /&gt;
|-&lt;br /&gt;
|SCR_ENABLE&lt;br /&gt;
|1&lt;br /&gt;
|Enable Lua scripting&lt;br /&gt;
|Required to run the control script; must be set manually before the script can run.&lt;br /&gt;
|-&lt;br /&gt;
|INS_GYR_CAL&lt;br /&gt;
|0&lt;br /&gt;
|Controls the automatic gyro calibration.&lt;br /&gt;
|Gyro calibration requires that the unit be held as still as possible.&lt;br /&gt;
|-&lt;br /&gt;
|INITIAL_MODE&lt;br /&gt;
|5&lt;br /&gt;
|FBWA&lt;br /&gt;
|Fly By Wire A, the attitude-stabilisation mode the inner loop uses. More [https://ardupilot.org/plane/docs/fbwa-mode.html here].&lt;br /&gt;
|-&lt;br /&gt;
|SERVO1_FUNCTION&lt;br /&gt;
|77&lt;br /&gt;
|ElevonLeft&lt;br /&gt;
|Controls the left front foil assembly (wired to IO-CH1).&lt;br /&gt;
|-&lt;br /&gt;
|SERVO2_FUNCTION&lt;br /&gt;
|78&lt;br /&gt;
|ElevonRight&lt;br /&gt;
|Controls the right front foil assembly (wired to IO-CH2).&lt;br /&gt;
|-&lt;br /&gt;
|SERVO3_FUNCTION&lt;br /&gt;
|19&lt;br /&gt;
|Elevator&lt;br /&gt;
|Rear foil pitch command; the script reads this output and forwards it to the rear foil over CAN.&lt;br /&gt;
|-&lt;br /&gt;
|SERVO14_FUNCTION&lt;br /&gt;
|-1&lt;br /&gt;
|GPIO&lt;br /&gt;
|Frees FMU_CH6 so it can be read as the foil enable input.&lt;br /&gt;
|-&lt;br /&gt;
|BTN_ENABLE&lt;br /&gt;
|1&lt;br /&gt;
|Enable button (digital pin) function&lt;br /&gt;
|Enables reading the foil enable/disable input.&lt;br /&gt;
|-&lt;br /&gt;
|BTN_PIN1&lt;br /&gt;
|55&lt;br /&gt;
|GPIO pin 55 (FMU_CH6)&lt;br /&gt;
|Maps the enable input to FMU_CH6; active-low and fail-safe.&lt;br /&gt;
|-&lt;br /&gt;
|BTN_REPORT_SEND&lt;br /&gt;
|2&lt;br /&gt;
|Report button state over MAVLink&lt;br /&gt;
|Surfaces the enable state to the GCS.&lt;br /&gt;
|-&lt;br /&gt;
|CAN_P1_DRIVER&lt;br /&gt;
|1&lt;br /&gt;
|Enable CAN port 1&lt;br /&gt;
|CAN carries the height sensors, the rear foil command and telemetry.&lt;br /&gt;
|-&lt;br /&gt;
|CAN_D1_PROTOCOL&lt;br /&gt;
|10&lt;br /&gt;
|Scripting&lt;br /&gt;
|Lets the Lua script send/receive raw CAN frames on bus 1.&lt;br /&gt;
|-&lt;br /&gt;
|RNGFND1_TYPE / RNGFND2_TYPE&lt;br /&gt;
|36&lt;br /&gt;
|Lua scripting rangefinder&lt;br /&gt;
|The two height sensors, fed by the script.&lt;br /&gt;
|-&lt;br /&gt;
|RNGFND1_ORIENT / RNGFND2_ORIENT&lt;br /&gt;
|25&lt;br /&gt;
|Pitch270 (downward)&lt;br /&gt;
|Required for ArduPilot to treat the sensor as a height source.&lt;br /&gt;
|-&lt;br /&gt;
|RNGFND1/2_MIN_CM / MAX_CM&lt;br /&gt;
|40 / 150&lt;br /&gt;
|Valid range (cm)&lt;br /&gt;
|Range gate for the ultrasonic sensors.&lt;br /&gt;
|-&lt;br /&gt;
|RNGFND1/2_POS_X / _POS_Y / _POS_Z&lt;br /&gt;
|3.8 / ∓0.23 / −0.175&lt;br /&gt;
|Sensor mounting offset from the IMU (m; X fwd, Y right, Z down)&lt;br /&gt;
|Lets the height correction compensate the roll/pitch lever arm. CAD-measured: 3.8 m forward, 0.23 m left/right, 0.175 m above the IMU. RNGFND1 = left (−Y), RNGFND2 = right (+Y).&lt;br /&gt;
|-&lt;br /&gt;
|THR_FAILSAFE&lt;br /&gt;
|0&lt;br /&gt;
|Disable throttle/RC failsafe&lt;br /&gt;
|No RC receiver is fitted, so RC failsafe must not trigger.&lt;br /&gt;
|-&lt;br /&gt;
|ARSPD_USE&lt;br /&gt;
|0&lt;br /&gt;
|Do not use airspeed&lt;br /&gt;
|No airspeed sensor.&lt;br /&gt;
|-&lt;br /&gt;
|BRD_SAFETY_DEFLT&lt;br /&gt;
|0&lt;br /&gt;
|Safety switch disabled at boot&lt;br /&gt;
|No safety switch fitted; outputs must be live at boot (the enable pin is the safety interlock).&lt;br /&gt;
|-&lt;br /&gt;
|TERRAIN_ENABLE&lt;br /&gt;
|0&lt;br /&gt;
|Disable terrain following&lt;br /&gt;
|Not applicable; avoids interference with foil height control.&lt;br /&gt;
|-&lt;br /&gt;
|GPS_TYPE2&lt;br /&gt;
|5&lt;br /&gt;
|NMEA&lt;br /&gt;
|Sets the GPS data sent onto the serial data port.&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL1_PROTOCOL&lt;br /&gt;
|2&lt;br /&gt;
|MAVLINK2&lt;br /&gt;
|Protocol on the Mission Planner serial port.&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL1_BAUD&lt;br /&gt;
|57&lt;br /&gt;
|57600&lt;br /&gt;
|Baudrate of the Mission Planner serial port.&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL4_PROTOCOL&lt;br /&gt;
|5&lt;br /&gt;
|GPS&lt;br /&gt;
|Protocol on the GPS serial port.&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL4_BAUD&lt;br /&gt;
|9&lt;br /&gt;
|9600&lt;br /&gt;
|Baudrate of the GPS serial port.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CAN Bus Format ==&lt;br /&gt;
All traffic is classic CAN, standard 11-bit IDs, 1&amp;amp;nbsp;Mbit/s, little-endian unless noted. Inputs are produced by other nodes; outputs are produced by the Lua control script.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ CAN bus messages&lt;br /&gt;
!ID&lt;br /&gt;
!Direction&lt;br /&gt;
!Length&lt;br /&gt;
!Contents&lt;br /&gt;
|-&lt;br /&gt;
|0x011&lt;br /&gt;
|in&lt;br /&gt;
|3&lt;br /&gt;
|Front-left height sensor: [0] state (0x02 = Operational), [1..2] height in mm (uint16 LE)&lt;br /&gt;
|-&lt;br /&gt;
|0x012&lt;br /&gt;
|in&lt;br /&gt;
|3&lt;br /&gt;
|Front-right height sensor (same layout as 0x011)&lt;br /&gt;
|-&lt;br /&gt;
|0x010&lt;br /&gt;
|out&lt;br /&gt;
|2&lt;br /&gt;
|Rear foil servo command: PWM as uint16, '''big-endian''' (1500 = neutral)&lt;br /&gt;
|-&lt;br /&gt;
|0x250&lt;br /&gt;
|out&lt;br /&gt;
|6&lt;br /&gt;
|Telemetry – attitude: [0..1] roll, [2..3] pitch (int16, centidegrees), [4..5] yaw (uint16, centidegrees, 0..36000)&lt;br /&gt;
|-&lt;br /&gt;
|0x251&lt;br /&gt;
|out&lt;br /&gt;
|8&lt;br /&gt;
|Telemetry – state: [0..1] Lua roll-corrected height, [2..3] EKF height (uint16 mm, 0xFFFF = invalid), [4..5] status bits, [6] vehicle mode, [7] downward-rangefinder status&lt;br /&gt;
|}&lt;br /&gt;
The 0x251 status bits are: 0 wings enabled, 1 left sensor fresh, 2 right sensor fresh, 3 both fresh, 4 control height valid, 5 control source = EKF, 6 EKF healthy, 7 EKF initialised, 8 home set, 9 EKF origin set, 10 EKF height (HAGL) available, 11 EKF velocity available.&lt;br /&gt;
&lt;br /&gt;
Byte 6 of &amp;lt;code&amp;gt;0x251&amp;lt;/code&amp;gt; is the ArduPlane flight-mode number as reported by the autopilot. In normal operation the script only commands two: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; = MANUAL (foils disabled / neutral) and &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt; = FBWA (active stabilisation). Any other value means the mode was changed elsewhere (e.g. from the GCS); see the [https://ardupilot.org/plane/docs/flight-modes.html ArduPlane flight-mode list] for the full enumeration.&lt;br /&gt;
&lt;br /&gt;
The steering angle come from the rudder controller and is planned to be used as roll input to the controller.&lt;br /&gt;
&lt;br /&gt;
== Future plans ==&lt;br /&gt;
As of March 2026 the Lua control script provides ride-height control as an outer loop on top of FBWA, which already gives automatic altitude holding for the front foils; the rear foil is commanded over CAN. The earlier idea of switching to FBWB for altitude holding is therefore no longer required, though it remains an option for comparison.&lt;br /&gt;
&lt;br /&gt;
Control-loop coefficients are still placeholders — tuning requires the boat in the water. The first runs will be passive (foils disabled) to collect attitude, height-sensor and EKF data over CAN and decide whether ArduPilot's EKF height estimate is reliable enough to use as the control input instead of the Lua-computed value.&lt;br /&gt;
&lt;br /&gt;
Remaining integration work: feed the rudder/steering-angle CAN message into the controller and finalise the no-RC failsafe behaviour.&lt;br /&gt;
&lt;br /&gt;
Some additional reading: https://ardupilot.org/plane/docs/common-sensor-testing.html&lt;br /&gt;
&lt;br /&gt;
== Relevant links for configuring Ardupilot ==&lt;br /&gt;
https://ardupilot.org/copter/docs/common-gcs-only-operation.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/common-rangefinder-landingpage.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/setting-up-for-tuning.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/terrain-following-manual-modes.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/common-sensor-offset-compensation.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/crash_check.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/flight-modes.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/plane/docs/fbwb-mode.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/plane/docs/fixed-wing-faq.html --Disable Gyro calibration on start-up&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/rover/docs/sonar-sensors.html --Two sonar sensors&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/dev/docs/plane-architecture.html --Plane architecture and files&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Autopilot&amp;diff=307</id>
		<title>Autopilot</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Autopilot&amp;diff=307"/>
		<updated>2026-06-16T10:27:44Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* CAN Bus Format */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Platform ==&lt;br /&gt;
Ease of development dictated the choice to run the control loop on existing hard- and software, which was chosen to be Ardupilot running on a [https://docs.cubepilot.org/user-guides/autopilot/the-cube-module-overview orange cube].&lt;br /&gt;
[[File:Ardupilot.jpg|thumb|Ardupilot PCB with the orange cube mounted.]]&lt;br /&gt;
To make use for our application a PCB has been designed to integrate into the hydrofoil design.&lt;br /&gt;
&lt;br /&gt;
To connect to the ardupilot on the cube for tweaking settings and tuning control loops, [https://ardupilot.org/planner/docs/mission-planner-overview.html Mission Planner] is used. The control logic itself runs as a Lua script on the cube (see [[#Lua control script|Lua control script]]). The following sections describe the tweaked settings and the on-board script.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
The cube is a plug-and-play unit and therefore does not need setup changes in the underlying ardupilot software. Only necessary settings should be tweaked.&lt;br /&gt;
&lt;br /&gt;
Apart from the settings, tuning needs to be done in Mission Planner; this can only be done with the solar boat in the water and therefore no values are known for now.&lt;br /&gt;
&lt;br /&gt;
The ardupilot PCB supports three servo motors, two front and one back motor. It has two isolated power supplies for the servo motors. Support for CAN and the cube is powered by the 24V input from the CAN connection.&lt;br /&gt;
&lt;br /&gt;
It has its own GPS antenna and four UART serial ports, where Serial1 is used for the MAVLINK connection to Mission Planner running on a laptop. The two ultrasonic height sensors connect over the '''CAN bus''' (through an RS485-to-CAN interface PCB), not the cube's UART ports; the Lua control script reads them to keep the boat at its target ride height so it can 'surf' over waves.&lt;br /&gt;
&lt;br /&gt;
For steering on foils an extra MCU is added onto the board, namely the ATSAMD20E18A. This MCU receives the steering position from the rudder and forwards it (it is intended to be put on the CAN bus for the control system to use).&lt;br /&gt;
&lt;br /&gt;
== Height Sensors ==&lt;br /&gt;
Currently testing ultrasonic height sensors, the RS485 version of the DYP-A02YY4W-V2.0, with a CAN-interface PCB in between that places the readings on the CAN bus.&lt;br /&gt;
&lt;br /&gt;
Each sensor broadcasts a 3-byte frame at 8&amp;amp;nbsp;Hz: byte 0 is a status enum (0x02 = Operational, anything else = no valid reading), bytes 1–2 are the measured height in millimetres (uint16, little-endian). The front-left sensor uses CAN ID 0x011 and the front-right 0x012 (see [[#CAN Bus Format|CAN Bus Format]]).&lt;br /&gt;
&lt;br /&gt;
The sensors are mounted as far forward and outboard as possible to stay clear of the bow wake (CAD: 3.8&amp;amp;nbsp;m forward, 0.23&amp;amp;nbsp;m left/right, 0.175&amp;amp;nbsp;m above the IMU). The trade-off is that their reading changes strongly with roll; the Lua script presents each sensor to ArduPilot as a downward scripting rangefinder (so ArduPilot median-filters and logs them) and applies a roll/pitch + lever-arm correction before using the values for control (see [[#Lua control script|Lua control script]]).&lt;br /&gt;
&lt;br /&gt;
== Lua control script ==&lt;br /&gt;
The foil control logic runs as a Lua script on the cube (in the project git). It is a '''cascade''' that leans on ArduPilot's tested C++ attitude loop rather than re-implementing control in Lua:&lt;br /&gt;
&lt;br /&gt;
* '''Inner loop — ArduPlane FBWA (mode 5):''' stabilises pitch and roll attitude from the IMU and drives the three foils as control surfaces. The two front foils are configured as elevons and the rear foil as an elevator output.&lt;br /&gt;
* '''Outer loop — the Lua script:''' reads the two CAN height sensors, computes a roll/pitch + lever-arm-corrected ride height, and turns the height error into a gentle pitch-target bias on the pitch input channel while holding roll level. Vertical-velocity damping uses the EKF's IMU-fused velocity estimate.&lt;br /&gt;
&lt;br /&gt;
The rear foil is driven over CAN: the script reads ArduPilot's elevator output and sends it as a servo command (ID 0x010).&lt;br /&gt;
&lt;br /&gt;
'''No RC transmitter''' is fitted — throttle and rudder are handled separately. Attitude targets are supplied via RC channel overrides from the script, refreshed every loop. A hardware '''enable pin''' (FMU_CH6) switches between active stabilisation (FBWA) and neutral foils (MANUAL). It is wired active-low and fail-safe: a disconnected or open enable line disables foiling.&lt;br /&gt;
&lt;br /&gt;
On boot the script enforces the parameters it needs (see the [[#Ardupilot settings|settings table]]) and falls to neutral foils on loss of the enable signal, stale sensor data, or a script error. It also publishes attitude, both height estimates, and a status word on the CAN bus for the datalogger (see [[#CAN Bus Format|CAN Bus Format]]).&lt;br /&gt;
&lt;br /&gt;
Two height estimates run simultaneously and are both logged: the Lua roll-corrected value (currently used for control) and ArduPilot's EKF/rangefinder height. The first on-water runs will be flown with the foils disabled to collect this data and decide whether the EKF estimate is reliable enough to drive control.&lt;br /&gt;
&lt;br /&gt;
The script is checked with luacheck and has been validated in ArduPilot SITL (software-in-the-loop) with the CAN bus simulated over UDP multicast.&lt;br /&gt;
&lt;br /&gt;
== Ardupilot settings ==&lt;br /&gt;
To use the ardupilot as the foil control unit, some settings need to be changed. '''Most of the settings below are applied automatically at boot by the Lua script's parameter-enforcement routine''' — only &amp;lt;code&amp;gt;SCR_ENABLE&amp;lt;/code&amp;gt; and the physical sensor mounting offsets (&amp;lt;code&amp;gt;RNGFNDx_POS_*&amp;lt;/code&amp;gt;) must be set/measured manually. There are more ports available on the ardupilot; whenever more are used or changed the table will be updated.&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Configuration of ardupilot&lt;br /&gt;
!Setting&lt;br /&gt;
!Value&lt;br /&gt;
!Description&lt;br /&gt;
!Reason&lt;br /&gt;
|-&lt;br /&gt;
|SCR_ENABLE&lt;br /&gt;
|1&lt;br /&gt;
|Enable Lua scripting&lt;br /&gt;
|Required to run the control script; must be set manually before the script can run.&lt;br /&gt;
|-&lt;br /&gt;
|INS_GYR_CAL&lt;br /&gt;
|0&lt;br /&gt;
|Controls the automatic gyro calibration.&lt;br /&gt;
|Gyro calibration requires that the unit be held as still as possible.&lt;br /&gt;
|-&lt;br /&gt;
|INITIAL_MODE&lt;br /&gt;
|5&lt;br /&gt;
|FBWA&lt;br /&gt;
|Fly By Wire A, the attitude-stabilisation mode the inner loop uses. More [https://ardupilot.org/plane/docs/fbwa-mode.html here].&lt;br /&gt;
|-&lt;br /&gt;
|SERVO1_FUNCTION&lt;br /&gt;
|77&lt;br /&gt;
|ElevonLeft&lt;br /&gt;
|Controls the left front foil assembly (wired to IO-CH1).&lt;br /&gt;
|-&lt;br /&gt;
|SERVO2_FUNCTION&lt;br /&gt;
|78&lt;br /&gt;
|ElevonRight&lt;br /&gt;
|Controls the right front foil assembly (wired to IO-CH2).&lt;br /&gt;
|-&lt;br /&gt;
|SERVO3_FUNCTION&lt;br /&gt;
|19&lt;br /&gt;
|Elevator&lt;br /&gt;
|Rear foil pitch command; the script reads this output and forwards it to the rear foil over CAN.&lt;br /&gt;
|-&lt;br /&gt;
|SERVO14_FUNCTION&lt;br /&gt;
|-1&lt;br /&gt;
|GPIO&lt;br /&gt;
|Frees FMU_CH6 so it can be read as the foil enable input.&lt;br /&gt;
|-&lt;br /&gt;
|BTN_ENABLE&lt;br /&gt;
|1&lt;br /&gt;
|Enable button (digital pin) function&lt;br /&gt;
|Enables reading the foil enable/disable input.&lt;br /&gt;
|-&lt;br /&gt;
|BTN_PIN1&lt;br /&gt;
|55&lt;br /&gt;
|GPIO pin 55 (FMU_CH6)&lt;br /&gt;
|Maps the enable input to FMU_CH6; active-low and fail-safe.&lt;br /&gt;
|-&lt;br /&gt;
|BTN_REPORT_SEND&lt;br /&gt;
|2&lt;br /&gt;
|Report button state over MAVLink&lt;br /&gt;
|Surfaces the enable state to the GCS.&lt;br /&gt;
|-&lt;br /&gt;
|CAN_P1_DRIVER&lt;br /&gt;
|1&lt;br /&gt;
|Enable CAN port 1&lt;br /&gt;
|CAN carries the height sensors, the rear foil command and telemetry.&lt;br /&gt;
|-&lt;br /&gt;
|CAN_D1_PROTOCOL&lt;br /&gt;
|10&lt;br /&gt;
|Scripting&lt;br /&gt;
|Lets the Lua script send/receive raw CAN frames on bus 1.&lt;br /&gt;
|-&lt;br /&gt;
|RNGFND1_TYPE / RNGFND2_TYPE&lt;br /&gt;
|36&lt;br /&gt;
|Lua scripting rangefinder&lt;br /&gt;
|The two height sensors, fed by the script.&lt;br /&gt;
|-&lt;br /&gt;
|RNGFND1_ORIENT / RNGFND2_ORIENT&lt;br /&gt;
|25&lt;br /&gt;
|Pitch270 (downward)&lt;br /&gt;
|Required for ArduPilot to treat the sensor as a height source.&lt;br /&gt;
|-&lt;br /&gt;
|RNGFND1/2_MIN_CM / MAX_CM&lt;br /&gt;
|40 / 150&lt;br /&gt;
|Valid range (cm)&lt;br /&gt;
|Range gate for the ultrasonic sensors.&lt;br /&gt;
|-&lt;br /&gt;
|RNGFND1/2_POS_X / _POS_Y / _POS_Z&lt;br /&gt;
|3.8 / ∓0.23 / −0.175&lt;br /&gt;
|Sensor mounting offset from the IMU (m; X fwd, Y right, Z down)&lt;br /&gt;
|Lets the height correction compensate the roll/pitch lever arm. CAD-measured: 3.8 m forward, 0.23 m left/right, 0.175 m above the IMU. RNGFND1 = left (−Y), RNGFND2 = right (+Y).&lt;br /&gt;
|-&lt;br /&gt;
|THR_FAILSAFE&lt;br /&gt;
|0&lt;br /&gt;
|Disable throttle/RC failsafe&lt;br /&gt;
|No RC receiver is fitted, so RC failsafe must not trigger.&lt;br /&gt;
|-&lt;br /&gt;
|ARSPD_USE&lt;br /&gt;
|0&lt;br /&gt;
|Do not use airspeed&lt;br /&gt;
|No airspeed sensor.&lt;br /&gt;
|-&lt;br /&gt;
|BRD_SAFETY_DEFLT&lt;br /&gt;
|0&lt;br /&gt;
|Safety switch disabled at boot&lt;br /&gt;
|No safety switch fitted; outputs must be live at boot (the enable pin is the safety interlock).&lt;br /&gt;
|-&lt;br /&gt;
|TERRAIN_ENABLE&lt;br /&gt;
|0&lt;br /&gt;
|Disable terrain following&lt;br /&gt;
|Not applicable; avoids interference with foil height control.&lt;br /&gt;
|-&lt;br /&gt;
|GPS_TYPE2&lt;br /&gt;
|5&lt;br /&gt;
|NMEA&lt;br /&gt;
|Sets the GPS data sent onto the serial data port.&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL1_PROTOCOL&lt;br /&gt;
|2&lt;br /&gt;
|MAVLINK2&lt;br /&gt;
|Protocol on the Mission Planner serial port.&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL1_BAUD&lt;br /&gt;
|57&lt;br /&gt;
|57600&lt;br /&gt;
|Baudrate of the Mission Planner serial port.&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL4_PROTOCOL&lt;br /&gt;
|5&lt;br /&gt;
|GPS&lt;br /&gt;
|Protocol on the GPS serial port.&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL4_BAUD&lt;br /&gt;
|9&lt;br /&gt;
|9600&lt;br /&gt;
|Baudrate of the GPS serial port.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CAN Bus Format ==&lt;br /&gt;
All traffic is classic CAN, standard 11-bit IDs, 1&amp;amp;nbsp;Mbit/s, little-endian unless noted. Inputs are produced by other nodes; outputs are produced by the Lua control script.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ CAN bus messages&lt;br /&gt;
!ID&lt;br /&gt;
!Direction&lt;br /&gt;
!Length&lt;br /&gt;
!Contents&lt;br /&gt;
|-&lt;br /&gt;
|0x011&lt;br /&gt;
|in&lt;br /&gt;
|3&lt;br /&gt;
|Front-left height sensor: [0] state (0x02 = Operational), [1..2] height in mm (uint16 LE)&lt;br /&gt;
|-&lt;br /&gt;
|0x012&lt;br /&gt;
|in&lt;br /&gt;
|3&lt;br /&gt;
|Front-right height sensor (same layout as 0x011)&lt;br /&gt;
|-&lt;br /&gt;
|0x010&lt;br /&gt;
|out&lt;br /&gt;
|2&lt;br /&gt;
|Rear foil servo command: PWM as uint16, '''big-endian''' (1500 = neutral)&lt;br /&gt;
|-&lt;br /&gt;
|0x250&lt;br /&gt;
|out&lt;br /&gt;
|6&lt;br /&gt;
|Telemetry – attitude: [0..1] roll, [2..3] pitch (int16, centidegrees), [4..5] yaw (uint16, centidegrees, 0..36000)&lt;br /&gt;
|-&lt;br /&gt;
|0x251&lt;br /&gt;
|out&lt;br /&gt;
|8&lt;br /&gt;
|Telemetry – state: [0..1] Lua roll-corrected height, [2..3] EKF height (uint16 mm, 0xFFFF = invalid), [4..5] status bits, [6] vehicle mode, [7] downward-rangefinder status&lt;br /&gt;
|}&lt;br /&gt;
The 0x251 status bits are: 0 wings enabled, 1 left sensor fresh, 2 right sensor fresh, 3 both fresh, 4 control height valid, 5 control source = EKF, 6 EKF healthy, 7 EKF initialised, 8 home set, 9 EKF origin set, 10 EKF height (HAGL) available, 11 EKF velocity available.&lt;br /&gt;
&lt;br /&gt;
Byte 6 of &amp;lt;code&amp;gt;0x251&amp;lt;/code&amp;gt; is the ArduPlane flight-mode number as reported by the autopilot. In normal operation the script only commands two: &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; = MANUAL (foils disabled / neutral) and &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt; = FBWA (active stabilisation). Any other value means the mode was changed elsewhere (e.g. from the GCS); see the [https://ardupilot.org/plane/docs/flight-modes.html ArduPlane flight-mode list] for the full enumeration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The steering angle come from the rudder controller and is planned to be used as roll input to the controller.&lt;br /&gt;
&lt;br /&gt;
== Future plans ==&lt;br /&gt;
As of March 2026 the Lua control script provides ride-height control as an outer loop on top of FBWA, which already gives automatic altitude holding for the front foils; the rear foil is commanded over CAN. The earlier idea of switching to FBWB for altitude holding is therefore no longer required, though it remains an option for comparison.&lt;br /&gt;
&lt;br /&gt;
Control-loop coefficients are still placeholders — tuning requires the boat in the water. The first runs will be passive (foils disabled) to collect attitude, height-sensor and EKF data over CAN and decide whether ArduPilot's EKF height estimate is reliable enough to use as the control input instead of the Lua-computed value.&lt;br /&gt;
&lt;br /&gt;
Remaining integration work: feed the rudder/steering-angle CAN message into the controller and finalise the no-RC failsafe behaviour.&lt;br /&gt;
&lt;br /&gt;
Some additional reading: https://ardupilot.org/plane/docs/common-sensor-testing.html&lt;br /&gt;
&lt;br /&gt;
== Relevant links for configuring Ardupilot ==&lt;br /&gt;
https://ardupilot.org/copter/docs/common-gcs-only-operation.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/common-rangefinder-landingpage.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/setting-up-for-tuning.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/terrain-following-manual-modes.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/common-sensor-offset-compensation.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/crash_check.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/flight-modes.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/plane/docs/fbwb-mode.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/plane/docs/fixed-wing-faq.html --Disable Gyro calibration on start-up&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/rover/docs/sonar-sensors.html --Two sonar sensors&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/dev/docs/plane-architecture.html --Plane architecture and files&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Autopilot&amp;diff=306</id>
		<title>Autopilot</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Autopilot&amp;diff=306"/>
		<updated>2026-06-11T07:56:32Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: Added new info based on scripting done in ardupilot LUA&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Platform ==&lt;br /&gt;
Ease of development dictated the choice to run the control loop on existing hard- and software, which was chosen to be Ardupilot running on a [https://docs.cubepilot.org/user-guides/autopilot/the-cube-module-overview orange cube].&lt;br /&gt;
[[File:Ardupilot.jpg|thumb|Ardupilot PCB with the orange cube mounted.]]&lt;br /&gt;
To make use for our application a PCB has been designed to integrate into the hydrofoil design.&lt;br /&gt;
&lt;br /&gt;
To connect to the ardupilot on the cube for tweaking settings and tuning control loops, [https://ardupilot.org/planner/docs/mission-planner-overview.html Mission Planner] is used. The control logic itself runs as a Lua script on the cube (see [[#Lua control script|Lua control script]]). The following sections describe the tweaked settings and the on-board script.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
The cube is a plug-and-play unit and therefore does not need setup changes in the underlying ardupilot software. Only necessary settings should be tweaked.&lt;br /&gt;
&lt;br /&gt;
Apart from the settings, tuning needs to be done in Mission Planner; this can only be done with the solar boat in the water and therefore no values are known for now.&lt;br /&gt;
&lt;br /&gt;
The ardupilot PCB supports three servo motors, two front and one back motor. It has two isolated power supplies for the servo motors. Support for CAN and the cube is powered by the 24V input from the CAN connection.&lt;br /&gt;
&lt;br /&gt;
It has its own GPS antenna and four UART serial ports, where Serial1 is used for the MAVLINK connection to Mission Planner running on a laptop. The two ultrasonic height sensors connect over the '''CAN bus''' (through an RS485-to-CAN interface PCB), not the cube's UART ports; the Lua control script reads them to keep the boat at its target ride height so it can 'surf' over waves.&lt;br /&gt;
&lt;br /&gt;
For steering on foils an extra MCU is added onto the board, namely the ATSAMD20E18A. This MCU receives the steering position from the rudder and forwards it (it is intended to be put on the CAN bus for the control system to use).&lt;br /&gt;
&lt;br /&gt;
== Height Sensors ==&lt;br /&gt;
Currently testing ultrasonic height sensors, the RS485 version of the DYP-A02YY4W-V2.0, with a CAN-interface PCB in between that places the readings on the CAN bus.&lt;br /&gt;
&lt;br /&gt;
Each sensor broadcasts a 3-byte frame at 8&amp;amp;nbsp;Hz: byte 0 is a status enum (0x02 = Operational, anything else = no valid reading), bytes 1–2 are the measured height in millimetres (uint16, little-endian). The front-left sensor uses CAN ID 0x011 and the front-right 0x012 (see [[#CAN Bus Format|CAN Bus Format]]).&lt;br /&gt;
&lt;br /&gt;
The sensors are mounted as far forward and outboard as possible to stay clear of the bow wake (CAD: 3.8&amp;amp;nbsp;m forward, 0.23&amp;amp;nbsp;m left/right, 0.175&amp;amp;nbsp;m above the IMU). The trade-off is that their reading changes strongly with roll; the Lua script presents each sensor to ArduPilot as a downward scripting rangefinder (so ArduPilot median-filters and logs them) and applies a roll/pitch + lever-arm correction before using the values for control (see [[#Lua control script|Lua control script]]).&lt;br /&gt;
&lt;br /&gt;
== Lua control script ==&lt;br /&gt;
The foil control logic runs as a Lua script on the cube (in the project git). It is a '''cascade''' that leans on ArduPilot's tested C++ attitude loop rather than re-implementing control in Lua:&lt;br /&gt;
&lt;br /&gt;
* '''Inner loop — ArduPlane FBWA (mode 5):''' stabilises pitch and roll attitude from the IMU and drives the three foils as control surfaces. The two front foils are configured as elevons and the rear foil as an elevator output.&lt;br /&gt;
* '''Outer loop — the Lua script:''' reads the two CAN height sensors, computes a roll/pitch + lever-arm-corrected ride height, and turns the height error into a gentle pitch-target bias on the pitch input channel while holding roll level. Vertical-velocity damping uses the EKF's IMU-fused velocity estimate.&lt;br /&gt;
&lt;br /&gt;
The rear foil is driven over CAN: the script reads ArduPilot's elevator output and sends it as a servo command (ID 0x010).&lt;br /&gt;
&lt;br /&gt;
'''No RC transmitter''' is fitted — throttle and rudder are handled separately. Attitude targets are supplied via RC channel overrides from the script, refreshed every loop. A hardware '''enable pin''' (FMU_CH6) switches between active stabilisation (FBWA) and neutral foils (MANUAL). It is wired active-low and fail-safe: a disconnected or open enable line disables foiling.&lt;br /&gt;
&lt;br /&gt;
On boot the script enforces the parameters it needs (see the [[#Ardupilot settings|settings table]]) and falls to neutral foils on loss of the enable signal, stale sensor data, or a script error. It also publishes attitude, both height estimates, and a status word on the CAN bus for the datalogger (see [[#CAN Bus Format|CAN Bus Format]]).&lt;br /&gt;
&lt;br /&gt;
Two height estimates run simultaneously and are both logged: the Lua roll-corrected value (currently used for control) and ArduPilot's EKF/rangefinder height. The first on-water runs will be flown with the foils disabled to collect this data and decide whether the EKF estimate is reliable enough to drive control.&lt;br /&gt;
&lt;br /&gt;
The script is checked with luacheck and has been validated in ArduPilot SITL (software-in-the-loop) with the CAN bus simulated over UDP multicast.&lt;br /&gt;
&lt;br /&gt;
== Ardupilot settings ==&lt;br /&gt;
To use the ardupilot as the foil control unit, some settings need to be changed. '''Most of the settings below are applied automatically at boot by the Lua script's parameter-enforcement routine''' — only &amp;lt;code&amp;gt;SCR_ENABLE&amp;lt;/code&amp;gt; and the physical sensor mounting offsets (&amp;lt;code&amp;gt;RNGFNDx_POS_*&amp;lt;/code&amp;gt;) must be set/measured manually. There are more ports available on the ardupilot; whenever more are used or changed the table will be updated.&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Configuration of ardupilot&lt;br /&gt;
!Setting&lt;br /&gt;
!Value&lt;br /&gt;
!Description&lt;br /&gt;
!Reason&lt;br /&gt;
|-&lt;br /&gt;
|SCR_ENABLE&lt;br /&gt;
|1&lt;br /&gt;
|Enable Lua scripting&lt;br /&gt;
|Required to run the control script; must be set manually before the script can run.&lt;br /&gt;
|-&lt;br /&gt;
|INS_GYR_CAL&lt;br /&gt;
|0&lt;br /&gt;
|Controls the automatic gyro calibration.&lt;br /&gt;
|Gyro calibration requires that the unit be held as still as possible.&lt;br /&gt;
|-&lt;br /&gt;
|INITIAL_MODE&lt;br /&gt;
|5&lt;br /&gt;
|FBWA&lt;br /&gt;
|Fly By Wire A, the attitude-stabilisation mode the inner loop uses. More [https://ardupilot.org/plane/docs/fbwa-mode.html here].&lt;br /&gt;
|-&lt;br /&gt;
|SERVO1_FUNCTION&lt;br /&gt;
|77&lt;br /&gt;
|ElevonLeft&lt;br /&gt;
|Controls the left front foil assembly (wired to IO-CH1).&lt;br /&gt;
|-&lt;br /&gt;
|SERVO2_FUNCTION&lt;br /&gt;
|78&lt;br /&gt;
|ElevonRight&lt;br /&gt;
|Controls the right front foil assembly (wired to IO-CH2).&lt;br /&gt;
|-&lt;br /&gt;
|SERVO3_FUNCTION&lt;br /&gt;
|19&lt;br /&gt;
|Elevator&lt;br /&gt;
|Rear foil pitch command; the script reads this output and forwards it to the rear foil over CAN.&lt;br /&gt;
|-&lt;br /&gt;
|SERVO14_FUNCTION&lt;br /&gt;
|-1&lt;br /&gt;
|GPIO&lt;br /&gt;
|Frees FMU_CH6 so it can be read as the foil enable input.&lt;br /&gt;
|-&lt;br /&gt;
|BTN_ENABLE&lt;br /&gt;
|1&lt;br /&gt;
|Enable button (digital pin) function&lt;br /&gt;
|Enables reading the foil enable/disable input.&lt;br /&gt;
|-&lt;br /&gt;
|BTN_PIN1&lt;br /&gt;
|55&lt;br /&gt;
|GPIO pin 55 (FMU_CH6)&lt;br /&gt;
|Maps the enable input to FMU_CH6; active-low and fail-safe.&lt;br /&gt;
|-&lt;br /&gt;
|BTN_REPORT_SEND&lt;br /&gt;
|2&lt;br /&gt;
|Report button state over MAVLink&lt;br /&gt;
|Surfaces the enable state to the GCS.&lt;br /&gt;
|-&lt;br /&gt;
|CAN_P1_DRIVER&lt;br /&gt;
|1&lt;br /&gt;
|Enable CAN port 1&lt;br /&gt;
|CAN carries the height sensors, the rear foil command and telemetry.&lt;br /&gt;
|-&lt;br /&gt;
|CAN_D1_PROTOCOL&lt;br /&gt;
|10&lt;br /&gt;
|Scripting&lt;br /&gt;
|Lets the Lua script send/receive raw CAN frames on bus 1.&lt;br /&gt;
|-&lt;br /&gt;
|RNGFND1_TYPE / RNGFND2_TYPE&lt;br /&gt;
|36&lt;br /&gt;
|Lua scripting rangefinder&lt;br /&gt;
|The two height sensors, fed by the script.&lt;br /&gt;
|-&lt;br /&gt;
|RNGFND1_ORIENT / RNGFND2_ORIENT&lt;br /&gt;
|25&lt;br /&gt;
|Pitch270 (downward)&lt;br /&gt;
|Required for ArduPilot to treat the sensor as a height source.&lt;br /&gt;
|-&lt;br /&gt;
|RNGFND1/2_MIN_CM / MAX_CM&lt;br /&gt;
|40 / 150&lt;br /&gt;
|Valid range (cm)&lt;br /&gt;
|Range gate for the ultrasonic sensors.&lt;br /&gt;
|-&lt;br /&gt;
|RNGFND1/2_POS_X / _POS_Y / _POS_Z&lt;br /&gt;
|3.8 / ∓0.23 / −0.175&lt;br /&gt;
|Sensor mounting offset from the IMU (m; X fwd, Y right, Z down)&lt;br /&gt;
|Lets the height correction compensate the roll/pitch lever arm. CAD-measured: 3.8 m forward, 0.23 m left/right, 0.175 m above the IMU. RNGFND1 = left (−Y), RNGFND2 = right (+Y).&lt;br /&gt;
|-&lt;br /&gt;
|THR_FAILSAFE&lt;br /&gt;
|0&lt;br /&gt;
|Disable throttle/RC failsafe&lt;br /&gt;
|No RC receiver is fitted, so RC failsafe must not trigger.&lt;br /&gt;
|-&lt;br /&gt;
|ARSPD_USE&lt;br /&gt;
|0&lt;br /&gt;
|Do not use airspeed&lt;br /&gt;
|No airspeed sensor.&lt;br /&gt;
|-&lt;br /&gt;
|BRD_SAFETY_DEFLT&lt;br /&gt;
|0&lt;br /&gt;
|Safety switch disabled at boot&lt;br /&gt;
|No safety switch fitted; outputs must be live at boot (the enable pin is the safety interlock).&lt;br /&gt;
|-&lt;br /&gt;
|TERRAIN_ENABLE&lt;br /&gt;
|0&lt;br /&gt;
|Disable terrain following&lt;br /&gt;
|Not applicable; avoids interference with foil height control.&lt;br /&gt;
|-&lt;br /&gt;
|GPS_TYPE2&lt;br /&gt;
|5&lt;br /&gt;
|NMEA&lt;br /&gt;
|Sets the GPS data sent onto the serial data port.&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL1_PROTOCOL&lt;br /&gt;
|2&lt;br /&gt;
|MAVLINK2&lt;br /&gt;
|Protocol on the Mission Planner serial port.&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL1_BAUD&lt;br /&gt;
|57&lt;br /&gt;
|57600&lt;br /&gt;
|Baudrate of the Mission Planner serial port.&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL4_PROTOCOL&lt;br /&gt;
|5&lt;br /&gt;
|GPS&lt;br /&gt;
|Protocol on the GPS serial port.&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL4_BAUD&lt;br /&gt;
|9&lt;br /&gt;
|9600&lt;br /&gt;
|Baudrate of the GPS serial port.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CAN Bus Format ==&lt;br /&gt;
All traffic is classic CAN, standard 11-bit IDs, 1&amp;amp;nbsp;Mbit/s, little-endian unless noted. Inputs are produced by other nodes; outputs are produced by the Lua control script.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ CAN bus messages&lt;br /&gt;
!ID&lt;br /&gt;
!Direction&lt;br /&gt;
!Length&lt;br /&gt;
!Contents&lt;br /&gt;
|-&lt;br /&gt;
|0x011&lt;br /&gt;
|in&lt;br /&gt;
|3&lt;br /&gt;
|Front-left height sensor: [0] state (0x02 = Operational), [1..2] height in mm (uint16 LE)&lt;br /&gt;
|-&lt;br /&gt;
|0x012&lt;br /&gt;
|in&lt;br /&gt;
|3&lt;br /&gt;
|Front-right height sensor (same layout as 0x011)&lt;br /&gt;
|-&lt;br /&gt;
|0x010&lt;br /&gt;
|out&lt;br /&gt;
|2&lt;br /&gt;
|Rear foil servo command: PWM as uint16, '''big-endian''' (1500 = neutral)&lt;br /&gt;
|-&lt;br /&gt;
|0x250&lt;br /&gt;
|out&lt;br /&gt;
|6&lt;br /&gt;
|Telemetry – attitude: [0..1] roll, [2..3] pitch (int16, centidegrees), [4..5] yaw (uint16, centidegrees, 0..36000)&lt;br /&gt;
|-&lt;br /&gt;
|0x251&lt;br /&gt;
|out&lt;br /&gt;
|8&lt;br /&gt;
|Telemetry – state: [0..1] Lua roll-corrected height, [2..3] EKF height (uint16 mm, 0xFFFF = invalid), [4..5] status bits, [6] vehicle mode, [7] downward-rangefinder status&lt;br /&gt;
|}&lt;br /&gt;
The 0x251 status bits are: 0 wings enabled, 1 left sensor fresh, 2 right sensor fresh, 3 both fresh, 4 control height valid, 5 control source = EKF, 6 EKF healthy, 7 EKF initialised, 8 home set, 9 EKF origin set, 10 EKF height (HAGL) available, 11 EKF velocity available.&lt;br /&gt;
&lt;br /&gt;
The rudder/steering angle (from the ATSAMD20 MCU) is planned to be added to this bus and fed forward into the controller.&lt;br /&gt;
&lt;br /&gt;
== Future plans ==&lt;br /&gt;
As of March 2026 the Lua control script provides ride-height control as an outer loop on top of FBWA, which already gives automatic altitude holding for the front foils; the rear foil is commanded over CAN. The earlier idea of switching to FBWB for altitude holding is therefore no longer required, though it remains an option for comparison.&lt;br /&gt;
&lt;br /&gt;
Control-loop coefficients are still placeholders — tuning requires the boat in the water. The first runs will be passive (foils disabled) to collect attitude, height-sensor and EKF data over CAN and decide whether ArduPilot's EKF height estimate is reliable enough to use as the control input instead of the Lua-computed value.&lt;br /&gt;
&lt;br /&gt;
Remaining integration work: feed the rudder/steering-angle CAN message into the controller and finalise the no-RC failsafe behaviour.&lt;br /&gt;
&lt;br /&gt;
Some additional reading: https://ardupilot.org/plane/docs/common-sensor-testing.html&lt;br /&gt;
&lt;br /&gt;
== Relevant links for configuring Ardupilot ==&lt;br /&gt;
https://ardupilot.org/copter/docs/common-gcs-only-operation.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/common-rangefinder-landingpage.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/setting-up-for-tuning.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/terrain-following-manual-modes.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/common-sensor-offset-compensation.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/crash_check.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/flight-modes.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/plane/docs/fbwb-mode.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/plane/docs/fixed-wing-faq.html --Disable Gyro calibration on start-up&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/rover/docs/sonar-sensors.html --Two sonar sensors&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/dev/docs/plane-architecture.html --Plane architecture and files&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Autopilot&amp;diff=305</id>
		<title>Autopilot</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Autopilot&amp;diff=305"/>
		<updated>2026-06-11T07:28:06Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Platform ==&lt;br /&gt;
Ease of development dictated the choice to run the control loop on existing hard- and software. which was chosen to be Ardupilot running on a [https://docs.cubepilot.org/user-guides/autopilot/the-cube-module-overview orange cube].&lt;br /&gt;
[[File:Ardupilot.jpg|thumb|Ardupilot PCB with the orange cube mounted.]]&lt;br /&gt;
To make use for our application a PCB has been designed to integrate into the hydrofoil design. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To connect to the ardupilot on the cube for tweaking settings and tuning control loops, [https://ardupilot.org/planner/docs/mission-planner-overview.html Mission Planner] will be used. The following section have tweaked settings found in Mission Planner.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
The cube is a plug-and-play unit and therefore does not need setup changes in the underlying ardupilot software. Only necessary settings should be tweaked.&lt;br /&gt;
&lt;br /&gt;
Apart from the settings, tuning needs to be done in Mission Planner, this can only be done with the solar boat in the water and therefore no values are known for now.&lt;br /&gt;
&lt;br /&gt;
The ardupilot PCB supports three servo motors, two front and one back motor. It has two isolated power supplies for the servo motors. Support for CAN and the cube is powered by the 24v input from the CAN connection.&lt;br /&gt;
&lt;br /&gt;
It has its own GPS antenna and four UART serial ports, where Serial1 is used for the MAVLINK connect to Mission Planner that is running on a laptop. Two of these serial ports will be used to implement the height sensors that will be mounted on the boat for measuring the height of the water. This ensures that the system correctly responds to waves where the boat can 'surf' over.&lt;br /&gt;
&lt;br /&gt;
For steering on foils an extra MCU is added onto the board namely: ATSAMD20E18A. This MCU can receive data from the rudder that gives the steering position and sends it through to the cube.&lt;br /&gt;
&lt;br /&gt;
== Height Sensors ==&lt;br /&gt;
Currently testing ultrasonic height sensors, the RS485 version of the DYP-A02YY4W-V2.0. with the CAN-interface PCB in between.&lt;br /&gt;
&lt;br /&gt;
== Ardupilot settings ==&lt;br /&gt;
To use the ardupilot as the foil control unit, some settings need to be changed since they do not apply to us or should be disabled. These settings are given below with a small explanation why it has been configured as is.&lt;br /&gt;
&lt;br /&gt;
The settings below are the changed settings used by the ardupilot. There are more ports available on the ardupilot, whenever more are used or are changed the table will be updated.&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
Configuration of ardupilot&lt;br /&gt;
!Setting&lt;br /&gt;
!Value&lt;br /&gt;
!Description&lt;br /&gt;
!Reason&lt;br /&gt;
|-&lt;br /&gt;
|INS_GYR_CAL&lt;br /&gt;
|0&lt;br /&gt;
|Controls the automatic gyro calibration.&lt;br /&gt;
|Gyro calibration requires that the unit should be held as still as possible.&lt;br /&gt;
|-&lt;br /&gt;
|SERVO1_FUNCTION&lt;br /&gt;
|78&lt;br /&gt;
|ElevonRight&lt;br /&gt;
|Controls the right foil assembly.&lt;br /&gt;
|-&lt;br /&gt;
|SERVO2_FUNCTION&lt;br /&gt;
|77&lt;br /&gt;
|ElevonLeft&lt;br /&gt;
|Controls the left foil assembly.&lt;br /&gt;
|-&lt;br /&gt;
|INITIAL_MODE&lt;br /&gt;
|5&lt;br /&gt;
|FBWA&lt;br /&gt;
|Fly By Wire A this is a fly mode for the control unit. More can be found [https://ardupilot.org/plane/docs/fbwa-mode.html here].&lt;br /&gt;
|-&lt;br /&gt;
|GPS_TYPE2&lt;br /&gt;
|5&lt;br /&gt;
|NMEA&lt;br /&gt;
|This sets the GPS data that is sent onto the serial data port.&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL1_PROTOCOL&lt;br /&gt;
|2&lt;br /&gt;
|MAVLINK2&lt;br /&gt;
|Controls what protocol to use on the serial port&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL1_BAUD&lt;br /&gt;
|57&lt;br /&gt;
|57600&lt;br /&gt;
|Specifies the baudrate of the serial port.&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL4_PROTOCOL&lt;br /&gt;
|5&lt;br /&gt;
|GPS&lt;br /&gt;
|Controls what protocol to use on the serial port&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL4_BAUD&lt;br /&gt;
|9&lt;br /&gt;
|9600&lt;br /&gt;
|Specifies the baudrate of the serial port.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CAN Bus Format ==&lt;br /&gt;
The following data is output on the CAN bus for logging &amp;amp; rudder control:&lt;br /&gt;
&lt;br /&gt;
== Future plans ==&lt;br /&gt;
As of now: 21-03-2023, FBWA mode is used for controlling the front two foil assembly. It would probably be beneficial whenever the whole system is finished to move towards the FBWB mode.&lt;br /&gt;
&lt;br /&gt;
This mode supports &amp;quot;Automatic Altitude Holding&amp;quot;, that makes sure that the same level of altitude is automatically kept. Further testing is needed for determining the control loops and their coefficients.&lt;br /&gt;
&lt;br /&gt;
Implementing the different sensors into ardupilot and using that data to respond to the environment. These sensors are at least the height sensors and the rudder sensor for the steering angle.&lt;br /&gt;
&lt;br /&gt;
As of March 2026, some progress was made with LUA scripting, see git, some additional reading:&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/plane/docs/common-sensor-testing.html&lt;br /&gt;
&lt;br /&gt;
== Relevant links for configuring Ardupilot ==&lt;br /&gt;
https://ardupilot.org/copter/docs/common-gcs-only-operation.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/common-rangefinder-landingpage.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/setting-up-for-tuning.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/terrain-following-manual-modes.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/common-sensor-offset-compensation.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/crash_check.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/flight-modes.html --FBW-A mode seems best fit for front only, FBW-B for finalized system&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/plane/docs/fbwb-mode.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/stabilize-mode.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/plane/docs/fixed-wing-faq.html --Disable Gyro calibration on start-up&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/rover/docs/sonar-sensors.html --Two sonar sensors&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/dev/docs/plane-architecture.html --Plane architecture and files&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Foils&amp;diff=304</id>
		<title>Foils</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Foils&amp;diff=304"/>
		<updated>2026-05-22T07:30:35Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* Wing design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The foils of the solar boat is a system that is comprised of the following:&lt;br /&gt;
&lt;br /&gt;
* Wing design&lt;br /&gt;
* Foil assembly&lt;br /&gt;
* [[Autopilot]]&lt;br /&gt;
&lt;br /&gt;
A small overview is given below what any of these signify in the hydrofoils.&lt;br /&gt;
&lt;br /&gt;
== Wing design ==&lt;br /&gt;
[[File:Wing.jpg|thumb|The Cenus wing to be used on the solar boat.]]&lt;br /&gt;
The wing design is based on the calculation of the airfoil database website: http://airfoiltools.com/plotter/index &lt;br /&gt;
&lt;br /&gt;
From this database an implementation has been made into matlab to tweak some parameters as well as a plot for generating the wing shape. &lt;br /&gt;
&lt;br /&gt;
The matlab scripts are on the [https://git.engineersofinnovation.nl git] and can be found [https://git.engineersofinnovation.nl/matlab-scripts/Hydrofoil_Design here].&lt;br /&gt;
&lt;br /&gt;
The Scripts here make an assumption of a Driver weight of 75 kg and a total boat &amp;amp; driver weight of 180 kg. This gives a mass on rudder of 62.3 kg, mass on each of 2 foils of 58.8 kg. &lt;br /&gt;
&lt;br /&gt;
[[File:cenus_lift_aoa.png|thumb|Lift vs Angle of Attack for the first Cenus wing]]&lt;br /&gt;
&lt;br /&gt;
== Foil assembly ==&lt;br /&gt;
The foil assembly connects the wing to the foil mast and then to the hull of the boat.&lt;br /&gt;
[[File:Foil assembly.gif|center|thumb|230x230px|Scaled down for showing moving of the foil assembly.]]&lt;br /&gt;
&lt;br /&gt;
== Autopilot ==&lt;br /&gt;
The [[autopilot]] is the control electronics that controls the servos of the foil assembly. This a signal PCB with that measures the angle of the solar boat and adjust accordingly towards keeping the hull above the water.&lt;br /&gt;
&lt;br /&gt;
== Height sensors ==&lt;br /&gt;
We use ultrasonic height sensors for sensing distance between water and our hull. Currently we use cheap A02 RS485 sensors from DYP. &lt;br /&gt;
&lt;br /&gt;
Datasheets can be found https://www.dypcn.com/uploads/A02-Datasheet.pdf and https://www.dypcn.com/uploads/A02-Output-Interfaces.pdf&lt;br /&gt;
&lt;br /&gt;
Data from this sensor is being processed by our RS485 to CAN interface.&lt;br /&gt;
&lt;br /&gt;
==== Pinout ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Pin#!!Wire Colour !!Signal on wire&lt;br /&gt;
|-&lt;br /&gt;
| 1|| style=&amp;quot;background: #0065B2;color:white;&amp;quot; | Blue||&lt;br /&gt;
|-&lt;br /&gt;
|2|| style=&amp;quot;background: #241F21;color:white;&amp;quot; | Black||&lt;br /&gt;
|-&lt;br /&gt;
| 3|| style=&amp;quot;background: #FFFFFF;&amp;quot; | White||&lt;br /&gt;
|-&lt;br /&gt;
|4|| style=&amp;quot;background: #83603A;&amp;quot; | Brown||&lt;br /&gt;
|-&lt;br /&gt;
|5|| style=&amp;quot;background: #B2B3B7;&amp;quot; | Gray||&lt;br /&gt;
|}&lt;br /&gt;
= CAN Messages =&lt;br /&gt;
All multi-byte values are little-endian. Any state byte not listed maps to &amp;lt;code&amp;gt;Unknown&amp;lt;/code&amp;gt; on the receiver side.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Message&lt;br /&gt;
!CAN ID&lt;br /&gt;
!DLC&lt;br /&gt;
!Byte&lt;br /&gt;
!Field&lt;br /&gt;
!Type&lt;br /&gt;
!Values / Range&lt;br /&gt;
|-&lt;br /&gt;
|ServoRudderSetpoint&lt;br /&gt;
|0x010&lt;br /&gt;
|2&lt;br /&gt;
|0–1&lt;br /&gt;
|Setpoint&lt;br /&gt;
|u16 LE&lt;br /&gt;
|1000–2000&lt;br /&gt;
|-&lt;br /&gt;
|HeightSensorFrontLeft&lt;br /&gt;
|0x011&lt;br /&gt;
|3&lt;br /&gt;
|0&lt;br /&gt;
|State&lt;br /&gt;
|u8 enum&lt;br /&gt;
|0=NotPluggedIn, 1=ModbusError, 2=Operational, 0xFF=Unknown&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|1–2&lt;br /&gt;
|Height value&lt;br /&gt;
|u16 LE&lt;br /&gt;
|distance in mm&lt;br /&gt;
|-&lt;br /&gt;
|HeightSensorFrontRight&lt;br /&gt;
|0x012&lt;br /&gt;
|3&lt;br /&gt;
|0&lt;br /&gt;
|State&lt;br /&gt;
|u8 enum&lt;br /&gt;
|0=NotPluggedIn, 1=ModbusError, 2=Operational, 0xFF=Unknown&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|1–2&lt;br /&gt;
|Height value&lt;br /&gt;
|u16 LE&lt;br /&gt;
|distance in mm&lt;br /&gt;
|-&lt;br /&gt;
|HeightSensor (placement TBD)&lt;br /&gt;
|0x013&lt;br /&gt;
|3&lt;br /&gt;
|0&lt;br /&gt;
|State&lt;br /&gt;
|u8 enum&lt;br /&gt;
|0=NotPluggedIn, 1=ModbusError, 2=Operational, 0xFF=Unknown&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|1–2&lt;br /&gt;
|Height value&lt;br /&gt;
|u16 LE&lt;br /&gt;
|distance in mm&lt;br /&gt;
|-&lt;br /&gt;
|HeightSensor (placement TBD)&lt;br /&gt;
|0x014&lt;br /&gt;
|3&lt;br /&gt;
|0&lt;br /&gt;
|State&lt;br /&gt;
|u8 enum&lt;br /&gt;
|0=NotPluggedIn, 1=ModbusError, 2=Operational, 0xFF=Unknown&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|1–2&lt;br /&gt;
|Height value&lt;br /&gt;
|u16 LE&lt;br /&gt;
|distance in mm&lt;br /&gt;
|-&lt;br /&gt;
|ServoRudderStatus&lt;br /&gt;
|0x020&lt;br /&gt;
|3&lt;br /&gt;
|0&lt;br /&gt;
|State&lt;br /&gt;
|u8 enum&lt;br /&gt;
|0=Uninitialized, 1=Operational, 0xFF=Unknown&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|1–2&lt;br /&gt;
|Current setpoint&lt;br /&gt;
|u16 LE&lt;br /&gt;
|1000–2000&lt;br /&gt;
|-&lt;br /&gt;
|ServoRudderCommand&lt;br /&gt;
|0x021&lt;br /&gt;
|1&lt;br /&gt;
|0&lt;br /&gt;
|Command&lt;br /&gt;
|u8 enum&lt;br /&gt;
|0=Initialize&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=File:Cenus_lift_aoa.png&amp;diff=303</id>
		<title>File:Cenus lift aoa.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=File:Cenus_lift_aoa.png&amp;diff=303"/>
		<updated>2026-05-22T07:30:13Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Foils&amp;diff=302</id>
		<title>Foils</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Foils&amp;diff=302"/>
		<updated>2026-05-22T07:28:17Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The foils of the solar boat is a system that is comprised of the following:&lt;br /&gt;
&lt;br /&gt;
* Wing design&lt;br /&gt;
* Foil assembly&lt;br /&gt;
* [[Autopilot]]&lt;br /&gt;
&lt;br /&gt;
A small overview is given below what any of these signify in the hydrofoils.&lt;br /&gt;
&lt;br /&gt;
== Wing design ==&lt;br /&gt;
[[File:Wing.jpg|thumb|The Cenus wing to be used on the solar boat.]]&lt;br /&gt;
The wing design is based on the calculation of the airfoil database website: http://airfoiltools.com/plotter/index &lt;br /&gt;
&lt;br /&gt;
From this database an implementation has been made into matlab to tweak some parameters as well as a plot for generating the wing shape. &lt;br /&gt;
&lt;br /&gt;
The matlab scripts are on the [https://git.engineersofinnovation.nl git] and can be found [https://git.engineersofinnovation.nl/matlab-scripts/Hydrofoil_Design here].&lt;br /&gt;
&lt;br /&gt;
The Scripts here make an assumption of a Driver weight of 75 kg and a total boat &amp;amp; driver weight of 180 kg. This gives a mass on rudder of 62.3 kg, mass on each of 2 foils of 58.8 kg. &lt;br /&gt;
&lt;br /&gt;
[[File:cenus_lift_aoa.jpg|thumb|Lift vs Angle of Attack for the first Cenus wing]]&lt;br /&gt;
&lt;br /&gt;
== Foil assembly ==&lt;br /&gt;
The foil assembly connects the wing to the foil mast and then to the hull of the boat.&lt;br /&gt;
[[File:Foil assembly.gif|center|thumb|230x230px|Scaled down for showing moving of the foil assembly.]]&lt;br /&gt;
&lt;br /&gt;
== Autopilot ==&lt;br /&gt;
The [[autopilot]] is the control electronics that controls the servos of the foil assembly. This a signal PCB with that measures the angle of the solar boat and adjust accordingly towards keeping the hull above the water.&lt;br /&gt;
&lt;br /&gt;
== Height sensors ==&lt;br /&gt;
We use ultrasonic height sensors for sensing distance between water and our hull. Currently we use cheap A02 RS485 sensors from DYP. &lt;br /&gt;
&lt;br /&gt;
Datasheets can be found https://www.dypcn.com/uploads/A02-Datasheet.pdf and https://www.dypcn.com/uploads/A02-Output-Interfaces.pdf&lt;br /&gt;
&lt;br /&gt;
Data from this sensor is being processed by our RS485 to CAN interface.&lt;br /&gt;
&lt;br /&gt;
==== Pinout ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Pin#!!Wire Colour !!Signal on wire&lt;br /&gt;
|-&lt;br /&gt;
| 1|| style=&amp;quot;background: #0065B2;color:white;&amp;quot; | Blue||&lt;br /&gt;
|-&lt;br /&gt;
|2|| style=&amp;quot;background: #241F21;color:white;&amp;quot; | Black||&lt;br /&gt;
|-&lt;br /&gt;
| 3|| style=&amp;quot;background: #FFFFFF;&amp;quot; | White||&lt;br /&gt;
|-&lt;br /&gt;
|4|| style=&amp;quot;background: #83603A;&amp;quot; | Brown||&lt;br /&gt;
|-&lt;br /&gt;
|5|| style=&amp;quot;background: #B2B3B7;&amp;quot; | Gray||&lt;br /&gt;
|}&lt;br /&gt;
= CAN Messages =&lt;br /&gt;
All multi-byte values are little-endian. Any state byte not listed maps to &amp;lt;code&amp;gt;Unknown&amp;lt;/code&amp;gt; on the receiver side.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Message&lt;br /&gt;
!CAN ID&lt;br /&gt;
!DLC&lt;br /&gt;
!Byte&lt;br /&gt;
!Field&lt;br /&gt;
!Type&lt;br /&gt;
!Values / Range&lt;br /&gt;
|-&lt;br /&gt;
|ServoRudderSetpoint&lt;br /&gt;
|0x010&lt;br /&gt;
|2&lt;br /&gt;
|0–1&lt;br /&gt;
|Setpoint&lt;br /&gt;
|u16 LE&lt;br /&gt;
|1000–2000&lt;br /&gt;
|-&lt;br /&gt;
|HeightSensorFrontLeft&lt;br /&gt;
|0x011&lt;br /&gt;
|3&lt;br /&gt;
|0&lt;br /&gt;
|State&lt;br /&gt;
|u8 enum&lt;br /&gt;
|0=NotPluggedIn, 1=ModbusError, 2=Operational, 0xFF=Unknown&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|1–2&lt;br /&gt;
|Height value&lt;br /&gt;
|u16 LE&lt;br /&gt;
|distance in mm&lt;br /&gt;
|-&lt;br /&gt;
|HeightSensorFrontRight&lt;br /&gt;
|0x012&lt;br /&gt;
|3&lt;br /&gt;
|0&lt;br /&gt;
|State&lt;br /&gt;
|u8 enum&lt;br /&gt;
|0=NotPluggedIn, 1=ModbusError, 2=Operational, 0xFF=Unknown&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|1–2&lt;br /&gt;
|Height value&lt;br /&gt;
|u16 LE&lt;br /&gt;
|distance in mm&lt;br /&gt;
|-&lt;br /&gt;
|HeightSensor (placement TBD)&lt;br /&gt;
|0x013&lt;br /&gt;
|3&lt;br /&gt;
|0&lt;br /&gt;
|State&lt;br /&gt;
|u8 enum&lt;br /&gt;
|0=NotPluggedIn, 1=ModbusError, 2=Operational, 0xFF=Unknown&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|1–2&lt;br /&gt;
|Height value&lt;br /&gt;
|u16 LE&lt;br /&gt;
|distance in mm&lt;br /&gt;
|-&lt;br /&gt;
|HeightSensor (placement TBD)&lt;br /&gt;
|0x014&lt;br /&gt;
|3&lt;br /&gt;
|0&lt;br /&gt;
|State&lt;br /&gt;
|u8 enum&lt;br /&gt;
|0=NotPluggedIn, 1=ModbusError, 2=Operational, 0xFF=Unknown&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|1–2&lt;br /&gt;
|Height value&lt;br /&gt;
|u16 LE&lt;br /&gt;
|distance in mm&lt;br /&gt;
|-&lt;br /&gt;
|ServoRudderStatus&lt;br /&gt;
|0x020&lt;br /&gt;
|3&lt;br /&gt;
|0&lt;br /&gt;
|State&lt;br /&gt;
|u8 enum&lt;br /&gt;
|0=Uninitialized, 1=Operational, 0xFF=Unknown&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|1–2&lt;br /&gt;
|Current setpoint&lt;br /&gt;
|u16 LE&lt;br /&gt;
|1000–2000&lt;br /&gt;
|-&lt;br /&gt;
|ServoRudderCommand&lt;br /&gt;
|0x021&lt;br /&gt;
|1&lt;br /&gt;
|0&lt;br /&gt;
|Command&lt;br /&gt;
|u8 enum&lt;br /&gt;
|0=Initialize&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=GaN_MPPT&amp;diff=286</id>
		<title>GaN MPPT</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=GaN_MPPT&amp;diff=286"/>
		<updated>2026-05-12T09:34:50Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* PhaseFault_t (Byte 1 of Status) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:MPPT overview.jpg|thumb|Baseboard with two phases populated]]&lt;br /&gt;
Part of a system consisting of 8x Gan Phases and 1x Baseboard.: Picture above is fully populated BaseBoard with 8 GaN boost converters mounted. PCB's can be cooled through Inductors on the bottom using a coldplate, while still being easily replaced from the top by remving the four bolts. Software based on TPEE MPPT&lt;br /&gt;
&lt;br /&gt;
== Can Bus Protocol Format ==&lt;br /&gt;
The CAN bus telemetry is output using Standard CAN IDs (11-bit) by default. The ID structure uses the upper 7 bits for the Node ID (default 64, offset by hardware pins) and the lower 4 bits for the Packet ID.&lt;br /&gt;
&lt;br /&gt;
Here is the documentation for the telemetry messages:&lt;br /&gt;
&lt;br /&gt;
CAN Bus Frame Format&lt;br /&gt;
&lt;br /&gt;
Frame Type: Standard Frame (11-bit ID)&lt;br /&gt;
&lt;br /&gt;
Bitrate: 1000kbps&lt;br /&gt;
&lt;br /&gt;
Node ID: Configurable generalCanId (64) + Hardware ID offset (Pins ID0-ID3)&lt;br /&gt;
&lt;br /&gt;
NB: The ID is based on the position on the mainboard. Where ID0-ID2 is equal to the position 0-7, and ID3 is dependent on the DIP-switch on the mainboard. Front ID3 = 1, Read ID3 = 0.&lt;br /&gt;
&lt;br /&gt;
CAN ID Construction: (NodeID &amp;lt;&amp;lt; 4) | PacketID&lt;br /&gt;
&lt;br /&gt;
=== Power ===&lt;br /&gt;
Packet ID 0x00: Power (2Hz)&lt;br /&gt;
&lt;br /&gt;
Sent every 500ms. Contains the primary voltage and current measurements.&lt;br /&gt;
&lt;br /&gt;
Packet ID: 0x00&lt;br /&gt;
&lt;br /&gt;
Data Length: 8 Bytes&lt;br /&gt;
&lt;br /&gt;
Format: Big Endian (Network Order)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Byte'''&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Type'''&lt;br /&gt;
|'''Scaling'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|0-1&lt;br /&gt;
|Input  Voltage&lt;br /&gt;
|int16&lt;br /&gt;
|0.01  V/bit&lt;br /&gt;
|Input  Voltage (Vlow)&lt;br /&gt;
|-&lt;br /&gt;
|2-3&lt;br /&gt;
|Input  Current&lt;br /&gt;
|int16&lt;br /&gt;
|0.0005  A/bit&lt;br /&gt;
|Input  Current (Iind). Scaling factor 2000.0f&lt;br /&gt;
|-&lt;br /&gt;
|4-5&lt;br /&gt;
|Output  Voltage&lt;br /&gt;
|int16&lt;br /&gt;
|0.01  V/bit&lt;br /&gt;
|Output  Voltage (Vhigh)&lt;br /&gt;
|-&lt;br /&gt;
|6-7&lt;br /&gt;
|Output  Current&lt;br /&gt;
|int16&lt;br /&gt;
|0.0005  A/bit&lt;br /&gt;
|Output  Current (Ihigh). Scaling factor 2000.0f&lt;br /&gt;
|}&lt;br /&gt;
Note on Scaling:&lt;br /&gt;
&lt;br /&gt;
buffer_append_float16(data, value, scale, &amp;amp;index) multiplies the float value by scale and stores it as an int16.&lt;br /&gt;
&lt;br /&gt;
To decode: float value = (float)((int16_t)received_value) / scale&lt;br /&gt;
&lt;br /&gt;
Input/Output Current Scale: 2000.0 -&amp;gt; Divide received int16 by 2000.0 to get Amps.&lt;br /&gt;
&lt;br /&gt;
Input/Output Voltage Scale: 100.0 -&amp;gt; Divide received int16 by 100.0 to get Volts.&lt;br /&gt;
&lt;br /&gt;
=== Status ===&lt;br /&gt;
Packet ID 0x01: Status (1Hz)&lt;br /&gt;
&lt;br /&gt;
Sent every 1000ms. Contains the operating state and fault codes.&lt;br /&gt;
&lt;br /&gt;
Packet ID: 0x01&lt;br /&gt;
&lt;br /&gt;
Data Length: 5 Bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Byte'''&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Type'''&lt;br /&gt;
|'''Scaling   / Enum'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|Mode&lt;br /&gt;
|uint8&lt;br /&gt;
|PhaseMode_t&lt;br /&gt;
|Operating  Mode (1=CIV, 2=CIC, 3=MinInputCurrent, 4=COV, 5=COC, 6=Temp Derating,  7=Fault)&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Fault&lt;br /&gt;
|uint8&lt;br /&gt;
|PhaseFault_t&lt;br /&gt;
|Fault  Code (0=OK, 1=Config, 2=Input OV, 3=Output OV, 4=Output OC, 5=Input OC,  6=Input UC, 7=Phase OC)&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Enabled&lt;br /&gt;
|uint8&lt;br /&gt;
|bool&lt;br /&gt;
|1 if  Enabled, 0 if Disabled&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Board  Temp&lt;br /&gt;
|int8&lt;br /&gt;
|1  °C/bit&lt;br /&gt;
|Ambient  Temperature in °C&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Heat  Sink Temp&lt;br /&gt;
|int8&lt;br /&gt;
|1  °C/bit&lt;br /&gt;
|Heatsink  Temperature in °C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sweep Data ===&lt;br /&gt;
Packet ID 0x02: Sweep Data (On Request)&lt;br /&gt;
&lt;br /&gt;
Sent during an MPPT sweep operation.&lt;br /&gt;
&lt;br /&gt;
Packet ID: 0x02&lt;br /&gt;
&lt;br /&gt;
Data Length: 5 Bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Byte'''&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Type'''&lt;br /&gt;
|'''Scaling'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|Index&lt;br /&gt;
|uint8&lt;br /&gt;
|1&lt;br /&gt;
|Sweep  point index (0-255)&lt;br /&gt;
|-&lt;br /&gt;
|1-2&lt;br /&gt;
|Current&lt;br /&gt;
|int16&lt;br /&gt;
|0.0005  A/bit&lt;br /&gt;
|Current  at this sweep point (Scale 2000.0)&lt;br /&gt;
|-&lt;br /&gt;
|3-4&lt;br /&gt;
|Voltage&lt;br /&gt;
|int16&lt;br /&gt;
|0.01  V/bit&lt;br /&gt;
|Voltage  at this sweep point (Scale 100.0)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Enums ===&lt;br /&gt;
&lt;br /&gt;
=== PhaseMode_t (Byte 0 of Status) ===&lt;br /&gt;
0: None (Start)&lt;br /&gt;
&lt;br /&gt;
1: CIV (Constant Input Voltage)&lt;br /&gt;
&lt;br /&gt;
2: CIC (Constant Input Current)&lt;br /&gt;
&lt;br /&gt;
3: MinInputCurrent&lt;br /&gt;
&lt;br /&gt;
4: COV (Constant Output Voltage)&lt;br /&gt;
&lt;br /&gt;
5: COC (Constant Output Current)&lt;br /&gt;
&lt;br /&gt;
6: TD (Temperature Derating)&lt;br /&gt;
&lt;br /&gt;
7: Fault&lt;br /&gt;
&lt;br /&gt;
==== PhaseFault_t (Byte 1 of Status) ====&lt;br /&gt;
0: OK&lt;br /&gt;
&lt;br /&gt;
1: Config Error&lt;br /&gt;
&lt;br /&gt;
2: Input Over Voltage&lt;br /&gt;
&lt;br /&gt;
3: Output Over Voltage&lt;br /&gt;
&lt;br /&gt;
4: Output Over Current&lt;br /&gt;
&lt;br /&gt;
5: Input Over Current&lt;br /&gt;
&lt;br /&gt;
6: Input Under Current&lt;br /&gt;
&lt;br /&gt;
7: Phase Over Current&lt;br /&gt;
&lt;br /&gt;
8: General Fault&lt;br /&gt;
&lt;br /&gt;
9: Sync lost&lt;br /&gt;
#&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=GaN_MPPT&amp;diff=285</id>
		<title>GaN MPPT</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=GaN_MPPT&amp;diff=285"/>
		<updated>2026-05-12T09:34:22Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* PhaseFault_t (Byte 1 of Status) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:MPPT overview.jpg|thumb|Baseboard with two phases populated]]&lt;br /&gt;
Part of a system consisting of 8x Gan Phases and 1x Baseboard.: Picture above is fully populated BaseBoard with 8 GaN boost converters mounted. PCB's can be cooled through Inductors on the bottom using a coldplate, while still being easily replaced from the top by remving the four bolts. Software based on TPEE MPPT&lt;br /&gt;
&lt;br /&gt;
== Can Bus Protocol Format ==&lt;br /&gt;
The CAN bus telemetry is output using Standard CAN IDs (11-bit) by default. The ID structure uses the upper 7 bits for the Node ID (default 64, offset by hardware pins) and the lower 4 bits for the Packet ID.&lt;br /&gt;
&lt;br /&gt;
Here is the documentation for the telemetry messages:&lt;br /&gt;
&lt;br /&gt;
CAN Bus Frame Format&lt;br /&gt;
&lt;br /&gt;
Frame Type: Standard Frame (11-bit ID)&lt;br /&gt;
&lt;br /&gt;
Bitrate: 1000kbps&lt;br /&gt;
&lt;br /&gt;
Node ID: Configurable generalCanId (64) + Hardware ID offset (Pins ID0-ID3)&lt;br /&gt;
&lt;br /&gt;
NB: The ID is based on the position on the mainboard. Where ID0-ID2 is equal to the position 0-7, and ID3 is dependent on the DIP-switch on the mainboard. Front ID3 = 1, Read ID3 = 0.&lt;br /&gt;
&lt;br /&gt;
CAN ID Construction: (NodeID &amp;lt;&amp;lt; 4) | PacketID&lt;br /&gt;
&lt;br /&gt;
=== Power ===&lt;br /&gt;
Packet ID 0x00: Power (2Hz)&lt;br /&gt;
&lt;br /&gt;
Sent every 500ms. Contains the primary voltage and current measurements.&lt;br /&gt;
&lt;br /&gt;
Packet ID: 0x00&lt;br /&gt;
&lt;br /&gt;
Data Length: 8 Bytes&lt;br /&gt;
&lt;br /&gt;
Format: Big Endian (Network Order)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Byte'''&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Type'''&lt;br /&gt;
|'''Scaling'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|0-1&lt;br /&gt;
|Input  Voltage&lt;br /&gt;
|int16&lt;br /&gt;
|0.01  V/bit&lt;br /&gt;
|Input  Voltage (Vlow)&lt;br /&gt;
|-&lt;br /&gt;
|2-3&lt;br /&gt;
|Input  Current&lt;br /&gt;
|int16&lt;br /&gt;
|0.0005  A/bit&lt;br /&gt;
|Input  Current (Iind). Scaling factor 2000.0f&lt;br /&gt;
|-&lt;br /&gt;
|4-5&lt;br /&gt;
|Output  Voltage&lt;br /&gt;
|int16&lt;br /&gt;
|0.01  V/bit&lt;br /&gt;
|Output  Voltage (Vhigh)&lt;br /&gt;
|-&lt;br /&gt;
|6-7&lt;br /&gt;
|Output  Current&lt;br /&gt;
|int16&lt;br /&gt;
|0.0005  A/bit&lt;br /&gt;
|Output  Current (Ihigh). Scaling factor 2000.0f&lt;br /&gt;
|}&lt;br /&gt;
Note on Scaling:&lt;br /&gt;
&lt;br /&gt;
buffer_append_float16(data, value, scale, &amp;amp;index) multiplies the float value by scale and stores it as an int16.&lt;br /&gt;
&lt;br /&gt;
To decode: float value = (float)((int16_t)received_value) / scale&lt;br /&gt;
&lt;br /&gt;
Input/Output Current Scale: 2000.0 -&amp;gt; Divide received int16 by 2000.0 to get Amps.&lt;br /&gt;
&lt;br /&gt;
Input/Output Voltage Scale: 100.0 -&amp;gt; Divide received int16 by 100.0 to get Volts.&lt;br /&gt;
&lt;br /&gt;
=== Status ===&lt;br /&gt;
Packet ID 0x01: Status (1Hz)&lt;br /&gt;
&lt;br /&gt;
Sent every 1000ms. Contains the operating state and fault codes.&lt;br /&gt;
&lt;br /&gt;
Packet ID: 0x01&lt;br /&gt;
&lt;br /&gt;
Data Length: 5 Bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Byte'''&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Type'''&lt;br /&gt;
|'''Scaling   / Enum'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|Mode&lt;br /&gt;
|uint8&lt;br /&gt;
|PhaseMode_t&lt;br /&gt;
|Operating  Mode (1=CIV, 2=CIC, 3=MinInputCurrent, 4=COV, 5=COC, 6=Temp Derating,  7=Fault)&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Fault&lt;br /&gt;
|uint8&lt;br /&gt;
|PhaseFault_t&lt;br /&gt;
|Fault  Code (0=OK, 1=Config, 2=Input OV, 3=Output OV, 4=Output OC, 5=Input OC,  6=Input UC, 7=Phase OC)&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Enabled&lt;br /&gt;
|uint8&lt;br /&gt;
|bool&lt;br /&gt;
|1 if  Enabled, 0 if Disabled&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Board  Temp&lt;br /&gt;
|int8&lt;br /&gt;
|1  °C/bit&lt;br /&gt;
|Ambient  Temperature in °C&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Heat  Sink Temp&lt;br /&gt;
|int8&lt;br /&gt;
|1  °C/bit&lt;br /&gt;
|Heatsink  Temperature in °C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sweep Data ===&lt;br /&gt;
Packet ID 0x02: Sweep Data (On Request)&lt;br /&gt;
&lt;br /&gt;
Sent during an MPPT sweep operation.&lt;br /&gt;
&lt;br /&gt;
Packet ID: 0x02&lt;br /&gt;
&lt;br /&gt;
Data Length: 5 Bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Byte'''&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Type'''&lt;br /&gt;
|'''Scaling'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|Index&lt;br /&gt;
|uint8&lt;br /&gt;
|1&lt;br /&gt;
|Sweep  point index (0-255)&lt;br /&gt;
|-&lt;br /&gt;
|1-2&lt;br /&gt;
|Current&lt;br /&gt;
|int16&lt;br /&gt;
|0.0005  A/bit&lt;br /&gt;
|Current  at this sweep point (Scale 2000.0)&lt;br /&gt;
|-&lt;br /&gt;
|3-4&lt;br /&gt;
|Voltage&lt;br /&gt;
|int16&lt;br /&gt;
|0.01  V/bit&lt;br /&gt;
|Voltage  at this sweep point (Scale 100.0)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Enums ===&lt;br /&gt;
&lt;br /&gt;
=== PhaseMode_t (Byte 0 of Status) ===&lt;br /&gt;
0: None (Start)&lt;br /&gt;
&lt;br /&gt;
1: CIV (Constant Input Voltage)&lt;br /&gt;
&lt;br /&gt;
2: CIC (Constant Input Current)&lt;br /&gt;
&lt;br /&gt;
3: MinInputCurrent&lt;br /&gt;
&lt;br /&gt;
4: COV (Constant Output Voltage)&lt;br /&gt;
&lt;br /&gt;
5: COC (Constant Output Current)&lt;br /&gt;
&lt;br /&gt;
6: TD (Temperature Derating)&lt;br /&gt;
&lt;br /&gt;
7: Fault&lt;br /&gt;
&lt;br /&gt;
==== PhaseFault_t (Byte 1 of Status) ====&lt;br /&gt;
0: OK&lt;br /&gt;
&lt;br /&gt;
1: Config Error&lt;br /&gt;
&lt;br /&gt;
2: Input Over Voltage&lt;br /&gt;
&lt;br /&gt;
3: Output Over Voltage&lt;br /&gt;
&lt;br /&gt;
4: Output Over Current&lt;br /&gt;
&lt;br /&gt;
5: Input Over Current&lt;br /&gt;
&lt;br /&gt;
6: Input Under Current&lt;br /&gt;
&lt;br /&gt;
7: Phase Over Current&lt;br /&gt;
&lt;br /&gt;
8: General Fault&lt;br /&gt;
&lt;br /&gt;
9: Sync lost&lt;br /&gt;
#&lt;br /&gt;
Value	Name&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=CAN-bus&amp;diff=284</id>
		<title>CAN-bus</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=CAN-bus&amp;diff=284"/>
		<updated>2026-05-06T14:31:10Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* CAN-bus pinout */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The communication between the electronics within the [[Solar boat (boii)|solar boat]] is build upon the CAN-bus protocol, where the [[datalogger]] logs the CAN messages. Pinout of our Binder connectors are: &lt;br /&gt;
&lt;br /&gt;
== CAN-bus ID overview ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;markdown&amp;quot;&amp;gt;&lt;br /&gt;
0x100 EoI Battery start&lt;br /&gt;
0x10F EoI Battery end&lt;br /&gt;
&lt;br /&gt;
0x200 EoI GNNS info, u8 fix (bool); u8 sats; u8 sats used &lt;br /&gt;
0x201 EoI GNNS f32 speed, kmh; f32 direction, degrees&lt;br /&gt;
0x202 EoI GNNS f64 Latitude, degrees&lt;br /&gt;
0x203 EoI GNNS f64 Longitude, degrees&lt;br /&gt;
0x204 EoI GNNS date time, u16 year, u8 month, u8 day, u8 hour, u8 minute, u8 second&lt;br /&gt;
&lt;br /&gt;
0x400 Gan MPPT R0 : Vin, Iin,   Vout,   Iout&lt;br /&gt;
0x401 Gan MPPT R0 : Mode,   Fault,   Enabled,   TBoard,   THS&lt;br /&gt;
0x410 Gan MPPT R1 &lt;br /&gt;
0x411 Gan MPPT R1 &lt;br /&gt;
...&lt;br /&gt;
0x470 Gan MPPT R7&lt;br /&gt;
0x471 Gan MPPT R7&lt;br /&gt;
0x480 Gan MPPT F0&lt;br /&gt;
0x481 Gan MPPT F0&lt;br /&gt;
...&lt;br /&gt;
0x4F0 Gan MPPT F7&lt;br /&gt;
0x4F1 Gan MPPT F7&lt;br /&gt;
  &lt;br /&gt;
0x4E6 Gan MPPT Baseboard Front&lt;br /&gt;
0x4EE Gan MPPT Baseboard Rear&lt;br /&gt;
&lt;br /&gt;
0x700 MPPT start&lt;br /&gt;
0x77F MPPT end&lt;br /&gt;
&lt;br /&gt;
0x0900 THROTTLE To VESC&lt;br /&gt;
0x1337 THROTTLE Status&lt;br /&gt;
&lt;br /&gt;
0x0909 VESC Status message 1&lt;br /&gt;
0x0E09 VESC Status message 2&lt;br /&gt;
0x0F09 VESC Status message 3&lt;br /&gt;
0x1009 VESC Status message 4&lt;br /&gt;
0x1B09 VESC Status message 5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CAN-bus pinout ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Colours of the Standard Binder CAN Cable and its pinout&lt;br /&gt;
|-&lt;br /&gt;
! Binder Connector pin Number !! Wire Colour !! Signal on wire&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||style=&amp;quot;background: #83603A;&amp;quot;| Brown || 24v Power&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||style=&amp;quot;background: #FFFFFF;&amp;quot;| White || CAN H&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||style=&amp;quot;background: #0065B2;&amp;quot;| Blue  || CAN L&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||style=&amp;quot;background: #241F21;color:white;&amp;quot;| Black || Ground&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||style=&amp;quot;background: #B2B3B7;&amp;quot;| Gray  || Safety&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Battery (MG) CAN-format (No longer used) ==&lt;br /&gt;
As of now the MG electronics [[battery]] is used in the [[Solar boat (boii)|solar boat]]. Although a new battery is being developed, this MG battery is still in use (as of September '22). Therefore the battery format is given here below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Node-ID&lt;br /&gt;
!Index&lt;br /&gt;
!Subindex&lt;br /&gt;
!Data&lt;br /&gt;
!Type&lt;br /&gt;
!Resolution&lt;br /&gt;
|-&lt;br /&gt;
|0x302&lt;br /&gt;
|0x2005&lt;br /&gt;
|0x01&lt;br /&gt;
|Voltage &amp;lt;code&amp;gt;[V]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[mV/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x02&lt;br /&gt;
|Current &amp;lt;code&amp;gt;[A]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int16_t&lt;br /&gt;
|10 &amp;lt;code&amp;gt;[mA/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x03&lt;br /&gt;
|Current Discharge &amp;lt;code&amp;gt;[A]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int16_t&lt;br /&gt;
|10 &amp;lt;code&amp;gt;[mA/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x04&lt;br /&gt;
|Current Charge &amp;lt;code&amp;gt;[A]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int16_t&lt;br /&gt;
|10 &amp;lt;code&amp;gt;[mA/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x05&lt;br /&gt;
|State-of-Charge &amp;lt;code&amp;gt;[%]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[%/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x06&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x07&lt;br /&gt;
|Time to Go &amp;lt;code&amp;gt;[min]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[min/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|0x402&lt;br /&gt;
|0x2005&lt;br /&gt;
|0x09&lt;br /&gt;
|Cell Temperature High &amp;lt;code&amp;gt;[°C]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[°C/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0A&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0B&lt;br /&gt;
|Cell Temperature Low &amp;lt;code&amp;gt;[°C]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[°C/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0C&lt;br /&gt;
|Cell Voltage High &amp;lt;code&amp;gt;[V]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[mV/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0D&lt;br /&gt;
|Cell Voltage Low &amp;lt;code&amp;gt;[V]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[mV/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0E&lt;br /&gt;
|BMS State&lt;br /&gt;
|uint32_t&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0F&lt;br /&gt;
|Temperature Collection &amp;lt;code&amp;gt;[°C]&amp;lt;/code&amp;gt;&lt;br /&gt;
|4x uint8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[°C/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|0x482&lt;br /&gt;
|0x2000&lt;br /&gt;
|Cell nr&lt;br /&gt;
|Cell &amp;lt;code&amp;gt;[Cell_nr]&amp;lt;/code&amp;gt; Voltage &amp;lt;code&amp;gt;[V]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[mV/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|0x202&lt;br /&gt;
|Don't Care&lt;br /&gt;
|Don't Care&lt;br /&gt;
|Power Level &amp;lt;code&amp;gt;[%]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[%/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=CAN-bus&amp;diff=283</id>
		<title>CAN-bus</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=CAN-bus&amp;diff=283"/>
		<updated>2026-05-06T14:29:20Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* CAN-bus ID overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The communication between the electronics within the [[Solar boat (boii)|solar boat]] is build upon the CAN-bus protocol, where the [[datalogger]] logs the CAN messages. Pinout of our Binder connectors are: &lt;br /&gt;
&lt;br /&gt;
== CAN-bus ID overview ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;markdown&amp;quot;&amp;gt;&lt;br /&gt;
0x100 EoI Battery start&lt;br /&gt;
0x10F EoI Battery end&lt;br /&gt;
&lt;br /&gt;
0x200 EoI GNNS info, u8 fix (bool); u8 sats; u8 sats used &lt;br /&gt;
0x201 EoI GNNS f32 speed, kmh; f32 direction, degrees&lt;br /&gt;
0x202 EoI GNNS f64 Latitude, degrees&lt;br /&gt;
0x203 EoI GNNS f64 Longitude, degrees&lt;br /&gt;
0x204 EoI GNNS date time, u16 year, u8 month, u8 day, u8 hour, u8 minute, u8 second&lt;br /&gt;
&lt;br /&gt;
0x400 Gan MPPT R0 : Vin, Iin,   Vout,   Iout&lt;br /&gt;
0x401 Gan MPPT R0 : Mode,   Fault,   Enabled,   TBoard,   THS&lt;br /&gt;
0x410 Gan MPPT R1 &lt;br /&gt;
0x411 Gan MPPT R1 &lt;br /&gt;
...&lt;br /&gt;
0x470 Gan MPPT R7&lt;br /&gt;
0x471 Gan MPPT R7&lt;br /&gt;
0x480 Gan MPPT F0&lt;br /&gt;
0x481 Gan MPPT F0&lt;br /&gt;
...&lt;br /&gt;
0x4F0 Gan MPPT F7&lt;br /&gt;
0x4F1 Gan MPPT F7&lt;br /&gt;
  &lt;br /&gt;
0x4E6 Gan MPPT Baseboard Front&lt;br /&gt;
0x4EE Gan MPPT Baseboard Rear&lt;br /&gt;
&lt;br /&gt;
0x700 MPPT start&lt;br /&gt;
0x77F MPPT end&lt;br /&gt;
&lt;br /&gt;
0x0900 THROTTLE To VESC&lt;br /&gt;
0x1337 THROTTLE Status&lt;br /&gt;
&lt;br /&gt;
0x0909 VESC Status message 1&lt;br /&gt;
0x0E09 VESC Status message 2&lt;br /&gt;
0x0F09 VESC Status message 3&lt;br /&gt;
0x1009 VESC Status message 4&lt;br /&gt;
0x1B09 VESC Status message 5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CAN-bus pinout ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Colours of the Standard Binder CAN Cable and its pinout&lt;br /&gt;
|-&lt;br /&gt;
! Binder Connector pin Number !! Wire Colour !! Signal on wire&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||style=&amp;quot;background: #83603A;&amp;quot;| Brown || 24v Power&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||style=&amp;quot;background: #FFFFFF;&amp;quot;| White || CAN H&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||style=&amp;quot;background: #0065B2;&amp;quot;| Blue  || CAN L&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||style=&amp;quot;background: #241F21;color:white;&amp;quot;| Black || Ground&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||style=&amp;quot;background: #B2B3B7;&amp;quot;| Gray  || Safety&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that the M12 connectors have a different pinout and thus different colour wires. To make compatibility between systems easier the binder connectors are soldered with the wrong colored wires so that plugging in a M12 device results in the right signals being passed to the Binder connector. This Compatibility pinout is shown below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ NON-STANDARD!! Colours when connecting an M12 cable to a binder connector NON-STANDARD!!&lt;br /&gt;
|-&lt;br /&gt;
! Binder Connector pin Number !! Wire Colour !! Signal on wire&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||style=&amp;quot;background: #FFFFFF;&amp;quot;| White || 24v Power&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||style=&amp;quot;background: #241F21;color:white;&amp;quot;| Black || CAN H&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||style=&amp;quot;background: #B2B3B7;&amp;quot;| Gray  || CAN L&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||style=&amp;quot;background: #0065B2;&amp;quot;| Blue  || Ground&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||style=&amp;quot;background: #83603A;&amp;quot;| Brown || Safety&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Battery (MG) CAN-format (No longer used) ==&lt;br /&gt;
As of now the MG electronics [[battery]] is used in the [[Solar boat (boii)|solar boat]]. Although a new battery is being developed, this MG battery is still in use (as of September '22). Therefore the battery format is given here below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Node-ID&lt;br /&gt;
!Index&lt;br /&gt;
!Subindex&lt;br /&gt;
!Data&lt;br /&gt;
!Type&lt;br /&gt;
!Resolution&lt;br /&gt;
|-&lt;br /&gt;
|0x302&lt;br /&gt;
|0x2005&lt;br /&gt;
|0x01&lt;br /&gt;
|Voltage &amp;lt;code&amp;gt;[V]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[mV/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x02&lt;br /&gt;
|Current &amp;lt;code&amp;gt;[A]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int16_t&lt;br /&gt;
|10 &amp;lt;code&amp;gt;[mA/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x03&lt;br /&gt;
|Current Discharge &amp;lt;code&amp;gt;[A]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int16_t&lt;br /&gt;
|10 &amp;lt;code&amp;gt;[mA/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x04&lt;br /&gt;
|Current Charge &amp;lt;code&amp;gt;[A]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int16_t&lt;br /&gt;
|10 &amp;lt;code&amp;gt;[mA/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x05&lt;br /&gt;
|State-of-Charge &amp;lt;code&amp;gt;[%]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[%/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x06&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x07&lt;br /&gt;
|Time to Go &amp;lt;code&amp;gt;[min]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[min/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|0x402&lt;br /&gt;
|0x2005&lt;br /&gt;
|0x09&lt;br /&gt;
|Cell Temperature High &amp;lt;code&amp;gt;[°C]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[°C/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0A&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0B&lt;br /&gt;
|Cell Temperature Low &amp;lt;code&amp;gt;[°C]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[°C/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0C&lt;br /&gt;
|Cell Voltage High &amp;lt;code&amp;gt;[V]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[mV/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0D&lt;br /&gt;
|Cell Voltage Low &amp;lt;code&amp;gt;[V]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[mV/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0E&lt;br /&gt;
|BMS State&lt;br /&gt;
|uint32_t&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0F&lt;br /&gt;
|Temperature Collection &amp;lt;code&amp;gt;[°C]&amp;lt;/code&amp;gt;&lt;br /&gt;
|4x uint8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[°C/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|0x482&lt;br /&gt;
|0x2000&lt;br /&gt;
|Cell nr&lt;br /&gt;
|Cell &amp;lt;code&amp;gt;[Cell_nr]&amp;lt;/code&amp;gt; Voltage &amp;lt;code&amp;gt;[V]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[mV/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|0x202&lt;br /&gt;
|Don't Care&lt;br /&gt;
|Don't Care&lt;br /&gt;
|Power Level &amp;lt;code&amp;gt;[%]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[%/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=CAN-bus&amp;diff=279</id>
		<title>CAN-bus</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=CAN-bus&amp;diff=279"/>
		<updated>2026-05-01T05:41:15Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* CAN-bus ID overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The communication between the electronics within the [[Solar boat (boii)|solar boat]] is build upon the CAN-bus protocol, where the [[datalogger]] logs the CAN messages. Pinout of our Binder connectors are: &lt;br /&gt;
&lt;br /&gt;
== CAN-bus ID overview ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;markdown&amp;quot;&amp;gt;&lt;br /&gt;
0x100 EoI Battery start&lt;br /&gt;
0x10F EoI Battery end&lt;br /&gt;
&lt;br /&gt;
0x200 EoI GNNS info, u8 fix (bool); u8 sats; u8 sats used &lt;br /&gt;
0x201 EoI GNNS f32 speed, kmh; f32 direction, degrees&lt;br /&gt;
0x202 EoI GNNS f64 Latitude, degrees&lt;br /&gt;
0x203 EoI GNNS f64 Longitude, degrees&lt;br /&gt;
0x204 EoI GNNS date time, u16 year, u8 month, u8 day, u8 hour, u8 minute, u8 second&lt;br /&gt;
&lt;br /&gt;
0x400 Gan MPPT R0 : Vin, Iin,   Vout,   Iout&lt;br /&gt;
0x401 Gan MPPT R0 : Mode,   Fault,   Enabled,   TBoard,   THS&lt;br /&gt;
0x410 Gan MPPT R1 &lt;br /&gt;
0x411 Gan MPPT R1 &lt;br /&gt;
...&lt;br /&gt;
0x470 Gan MPPT R7&lt;br /&gt;
0x471 Gan MPPT R7&lt;br /&gt;
0x480 Gan MPPT F0&lt;br /&gt;
0x481 Gan MPPT F0&lt;br /&gt;
...&lt;br /&gt;
0x4F0 Gan MPPT F0&lt;br /&gt;
0x4F1 Gan MPPT F0&lt;br /&gt;
  &lt;br /&gt;
0x4E6 Gan MPPT Baseboard Front&lt;br /&gt;
0x4EE Gan MPPT Baseboard Rear&lt;br /&gt;
&lt;br /&gt;
0x700 MPPT start&lt;br /&gt;
0x77F MPPT end&lt;br /&gt;
&lt;br /&gt;
0x0900 THROTTLE To VESC&lt;br /&gt;
0x1337 THROTTLE Status&lt;br /&gt;
&lt;br /&gt;
0x0909 VESC Status message 1&lt;br /&gt;
0x0E09 VESC Status message 2&lt;br /&gt;
0x0F09 VESC Status message 3&lt;br /&gt;
0x1009 VESC Status message 4&lt;br /&gt;
0x1B09 VESC Status message 5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CAN-bus pinout ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Colours of the Standard Binder CAN Cable and its pinout&lt;br /&gt;
|-&lt;br /&gt;
! Binder Connector pin Number !! Wire Colour !! Signal on wire&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||style=&amp;quot;background: #83603A;&amp;quot;| Brown || 24v Power&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||style=&amp;quot;background: #FFFFFF;&amp;quot;| White || CAN H&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||style=&amp;quot;background: #0065B2;&amp;quot;| Blue  || CAN L&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||style=&amp;quot;background: #241F21;color:white;&amp;quot;| Black || Ground&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||style=&amp;quot;background: #B2B3B7;&amp;quot;| Gray  || Safety&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that the M12 connectors have a different pinout and thus different colour wires. To make compatibility between systems easier the binder connectors are soldered with the wrong colored wires so that plugging in a M12 device results in the right signals being passed to the Binder connector. This Compatibility pinout is shown below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ NON-STANDARD!! Colours when connecting an M12 cable to a binder connector NON-STANDARD!!&lt;br /&gt;
|-&lt;br /&gt;
! Binder Connector pin Number !! Wire Colour !! Signal on wire&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||style=&amp;quot;background: #FFFFFF;&amp;quot;| White || 24v Power&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||style=&amp;quot;background: #241F21;color:white;&amp;quot;| Black || CAN H&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||style=&amp;quot;background: #B2B3B7;&amp;quot;| Gray  || CAN L&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||style=&amp;quot;background: #0065B2;&amp;quot;| Blue  || Ground&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||style=&amp;quot;background: #83603A;&amp;quot;| Brown || Safety&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Battery (MG) CAN-format (No longer used) ==&lt;br /&gt;
As of now the MG electronics [[battery]] is used in the [[Solar boat (boii)|solar boat]]. Although a new battery is being developed, this MG battery is still in use (as of September '22). Therefore the battery format is given here below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Node-ID&lt;br /&gt;
!Index&lt;br /&gt;
!Subindex&lt;br /&gt;
!Data&lt;br /&gt;
!Type&lt;br /&gt;
!Resolution&lt;br /&gt;
|-&lt;br /&gt;
|0x302&lt;br /&gt;
|0x2005&lt;br /&gt;
|0x01&lt;br /&gt;
|Voltage &amp;lt;code&amp;gt;[V]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[mV/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x02&lt;br /&gt;
|Current &amp;lt;code&amp;gt;[A]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int16_t&lt;br /&gt;
|10 &amp;lt;code&amp;gt;[mA/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x03&lt;br /&gt;
|Current Discharge &amp;lt;code&amp;gt;[A]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int16_t&lt;br /&gt;
|10 &amp;lt;code&amp;gt;[mA/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x04&lt;br /&gt;
|Current Charge &amp;lt;code&amp;gt;[A]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int16_t&lt;br /&gt;
|10 &amp;lt;code&amp;gt;[mA/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x05&lt;br /&gt;
|State-of-Charge &amp;lt;code&amp;gt;[%]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[%/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x06&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x07&lt;br /&gt;
|Time to Go &amp;lt;code&amp;gt;[min]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[min/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|0x402&lt;br /&gt;
|0x2005&lt;br /&gt;
|0x09&lt;br /&gt;
|Cell Temperature High &amp;lt;code&amp;gt;[°C]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[°C/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0A&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0B&lt;br /&gt;
|Cell Temperature Low &amp;lt;code&amp;gt;[°C]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[°C/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0C&lt;br /&gt;
|Cell Voltage High &amp;lt;code&amp;gt;[V]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[mV/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0D&lt;br /&gt;
|Cell Voltage Low &amp;lt;code&amp;gt;[V]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[mV/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0E&lt;br /&gt;
|BMS State&lt;br /&gt;
|uint32_t&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0F&lt;br /&gt;
|Temperature Collection &amp;lt;code&amp;gt;[°C]&amp;lt;/code&amp;gt;&lt;br /&gt;
|4x uint8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[°C/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|0x482&lt;br /&gt;
|0x2000&lt;br /&gt;
|Cell nr&lt;br /&gt;
|Cell &amp;lt;code&amp;gt;[Cell_nr]&amp;lt;/code&amp;gt; Voltage &amp;lt;code&amp;gt;[V]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[mV/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|0x202&lt;br /&gt;
|Don't Care&lt;br /&gt;
|Don't Care&lt;br /&gt;
|Power Level &amp;lt;code&amp;gt;[%]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[%/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=274</id>
		<title>Throttle</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=274"/>
		<updated>2026-04-06T11:35:24Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* Setting the Control Mode over CAN */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The throttle controls the motor and is operated by the pilot during sailing. It controls the duty cycle of the motor via the [[CAN-bus|CAN bus]] using the standard VESC message format. &lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
[[File:Throttle Schematic.png|thumb|Throttle shown in the inactive (green led) neutral position]]&lt;br /&gt;
To use the throttle to control the motor the green illuminated ''arm-button'' will have to be pressed for a few seconds, however some conditions need to be met to ensure a safe start of the motor. &lt;br /&gt;
&lt;br /&gt;
# The ''dead-man cord'' needs to be applied to the bottom of the throttle body, should snap in place magnetically&lt;br /&gt;
# The ''throttle lever'' Should be in its neutral position, pointing straight up with a noticeable tactile bump&lt;br /&gt;
# The [[CAN-bus|CAN bus]] need to be actively acknowledging packets, which means other devices need to be active on the bus&lt;br /&gt;
# No other error should have occurred inside the electronics&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If one of these conditions is not met, the throttle will beep the number of times indicated above. &lt;br /&gt;
&lt;br /&gt;
== Programming Throttle Position ==&lt;br /&gt;
The throttle position is read out by a magnet attached tot the ''throttle lever'', because the orientation of this magnet is not know in the firmware, this position can be programmed into the EEPROM. To enter programming mode hold down the arm button during power-on. A four beep descending tone should be played, and the LED should do a double blink in red continuously. To program the throttle push lever as far forward as possible and press the button, a single beep be heard. Repeat this twice with the lever in the center and finally with the lever all the way backwards. After three beeps the throttle is reprogrammed and normal operation is resumed. To summarize:  &lt;br /&gt;
&lt;br /&gt;
# Lever in the forward position  &lt;br /&gt;
# Lever in the center position &lt;br /&gt;
# Lever in de backward position &lt;br /&gt;
#  &lt;br /&gt;
&lt;br /&gt;
If no programming is desired leave the lever alone for 10 seconds and the lever will reboot into normal mode.&lt;br /&gt;
&lt;br /&gt;
== Setting the Control Mode over CAN ==&lt;br /&gt;
The Throttle controls the VESC motodriver at 40Hz messaging rate with the default CAN format implemented inside the VESC. [https://dongilc.gitbook.io/openrobot-inc/tutorials/control-with-can More info on the format.] and [https://triforce-docs.readthedocs.io/en/latest/canbus/canbus.html Here]. The throttle supports the following modes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Control Mode !! Configuration Byte Value !! Unit !! Additional data required&lt;br /&gt;
|-&lt;br /&gt;
| Filtered Duty Cycle || 0x01 || Percentage || None lever in the maximum forward position is 100%&lt;br /&gt;
|-&lt;br /&gt;
|Duty Cycle|| 0x02 || Percentage  || None lever in the maximum forward position is 100% &lt;br /&gt;
|-&lt;br /&gt;
|Current Control || 0x03 || 100mA  || Specify the max current for forward and backwards in two int16_t's&lt;br /&gt;
|-&lt;br /&gt;
|RPM Control || 0x04 || RPM  || Specify the rpm for forward and backwards in two int16_t's &lt;br /&gt;
|-&lt;br /&gt;
|Current Control Relative&lt;br /&gt;
|0x05&lt;br /&gt;
|Percentage&lt;br /&gt;
|None lever in the maximum forward position is 100%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These modes can be send to the throttle when the throttle is off. If the throttle is on the configuration will be ignored. A sound will play when a message is received. The message has to be send to the Throttle address 0x337, same as the reboot command. the format is as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message for Setting the control mode&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA || Control type || MSB int16_t  || LSB int16_t|| MSB int16_t  || LSB int16_t&lt;br /&gt;
|-&lt;br /&gt;
| Hardcoded command|| See Table Above || colspan=2 | Max value for lever completely forward || colspan=2 | Same but for backward (Positive for reverse)&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example command: ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line=&amp;quot;1&amp;quot; start=&amp;quot;69&amp;quot;&amp;gt;&lt;br /&gt;
# duty cycle&lt;br /&gt;
cansend can0 337#AA0200000000&lt;br /&gt;
&lt;br /&gt;
# 120A current control&lt;br /&gt;
cansend can0 337#AA0304B004B0&lt;br /&gt;
&lt;br /&gt;
# relative current control&lt;br /&gt;
cansend can0 337#AA0400000000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CAN Diagnostics messages ==&lt;br /&gt;
The throttle also send out messages to help debugging every 200 ms. It is send on address 0x337 and has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message for Diagnostic Purposes&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5 !! Byte 6 !! Byte 7&lt;br /&gt;
|-&lt;br /&gt;
| MSB int16_t  || LSB int16_t || MSB int16_t  || LSB int16_t || MSB int16_t  || LSB int16_t || uint8_t || Error status&lt;br /&gt;
|-&lt;br /&gt;
| colspan=2 | Filtered lever position, from +512 to -512 || colspan=2 | Raw position reported by the magnetic encoder || colspan=2 | Raw data from the deadmanswitch ADC || Gain that is required to readout the lever position || Enum of current error state. 0x00 is good&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If any of the error status bits are set, the throttle is set into IDLE mode and will shut off the motor. The following table shows what the bitfield represents:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Bit !! Enum Name !! Explanation&lt;br /&gt;
|-&lt;br /&gt;
| 0 to 2 || twiError || See next table for possible values&lt;br /&gt;
|-&lt;br /&gt;
| 3      || noLimitsLoaded || Reading of EEPROM for throttle limits failed&lt;br /&gt;
|-&lt;br /&gt;
| 4      || gainClipping || The Magnetic encoder detected no good magnetic field present&lt;br /&gt;
|-&lt;br /&gt;
| 5      || gainInvalid || The gain value read from the magnetic encoder is beyond the range specified in software&lt;br /&gt;
|-&lt;br /&gt;
| 6      || deadmanMissing || The hall sensor of the deadman-switch doesn't detect a strong enough magnet&lt;br /&gt;
|-&lt;br /&gt;
| 7      || impeadanceHigh || The impeadance of the deadman signal is too high, indicating a bad connection&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ TWI error states&lt;br /&gt;
|-&lt;br /&gt;
! Value !! Error name !! Error Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 ||	TWI_ERROR_NoError              || Indicates that the command completed successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||	TWI_ERROR_BusFault             || A TWI bus fault occurred while attempting to capture the bus. &lt;br /&gt;
|-&lt;br /&gt;
| 2 ||	TWI_ERROR_BusCaptureTimeout    || A timeout occurred whilst waiting for the bus to be ready. &lt;br /&gt;
|-&lt;br /&gt;
| 3 ||	TWI_ERROR_SlaveResponseTimeout || No ACK received at the nominated slave address within the timeout period.&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||	TWI_ERROR_SlaveNotReady        || Slave NAKed the TWI bus START condition. &lt;br /&gt;
|-&lt;br /&gt;
| 5 ||	TWI_ERROR_SlaveNAK             || Slave NAKed whilst attempting to send data to the device. &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=273</id>
		<title>Throttle</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=273"/>
		<updated>2026-04-05T14:11:08Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* Setting the Control Mode over CAN */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The throttle controls the motor and is operated by the pilot during sailing. It controls the duty cycle of the motor via the [[CAN-bus|CAN bus]] using the standard VESC message format. &lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
[[File:Throttle Schematic.png|thumb|Throttle shown in the inactive (green led) neutral position]]&lt;br /&gt;
To use the throttle to control the motor the green illuminated ''arm-button'' will have to be pressed for a few seconds, however some conditions need to be met to ensure a safe start of the motor. &lt;br /&gt;
&lt;br /&gt;
# The ''dead-man cord'' needs to be applied to the bottom of the throttle body, should snap in place magnetically&lt;br /&gt;
# The ''throttle lever'' Should be in its neutral position, pointing straight up with a noticeable tactile bump&lt;br /&gt;
# The [[CAN-bus|CAN bus]] need to be actively acknowledging packets, which means other devices need to be active on the bus&lt;br /&gt;
# No other error should have occurred inside the electronics&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If one of these conditions is not met, the throttle will beep the number of times indicated above. &lt;br /&gt;
&lt;br /&gt;
== Programming Throttle Position ==&lt;br /&gt;
The throttle position is read out by a magnet attached tot the ''throttle lever'', because the orientation of this magnet is not know in the firmware, this position can be programmed into the EEPROM. To enter programming mode hold down the arm button during power-on. A four beep descending tone should be played, and the LED should do a double blink in red continuously. To program the throttle push lever as far forward as possible and press the button, a single beep be heard. Repeat this twice with the lever in the center and finally with the lever all the way backwards. After three beeps the throttle is reprogrammed and normal operation is resumed. To summarize:  &lt;br /&gt;
&lt;br /&gt;
# Lever in the forward position  &lt;br /&gt;
# Lever in the center position &lt;br /&gt;
# Lever in de backward position &lt;br /&gt;
#  &lt;br /&gt;
&lt;br /&gt;
If no programming is desired leave the lever alone for 10 seconds and the lever will reboot into normal mode.&lt;br /&gt;
&lt;br /&gt;
== Setting the Control Mode over CAN ==&lt;br /&gt;
The Throttle controls the VESC motodriver at 40Hz messaging rate with the default CAN format implemented inside the VESC. [https://dongilc.gitbook.io/openrobot-inc/tutorials/control-with-can More info on the format.] The throttle supports the following modes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Control Mode !! Configuration Byte Value !! Unit !! Additional data required&lt;br /&gt;
|-&lt;br /&gt;
| Filtered Duty Cycle || 0x01 || Percentage || None lever in the maximum forward position is 100%&lt;br /&gt;
|-&lt;br /&gt;
|Duty Cycle|| 0x02 || Percentage  || None lever in the maximum forward position is 100% &lt;br /&gt;
|-&lt;br /&gt;
|Current Control || 0x03 || 100mA  || Specify the max current for forward and backwards in two int16_t's&lt;br /&gt;
|-&lt;br /&gt;
|RPM Control || 0x04 || RPM  || Specify the rpm for forward and backwards in two int16_t's &lt;br /&gt;
|-&lt;br /&gt;
|Current Control Relative&lt;br /&gt;
|0x05&lt;br /&gt;
|Percentage&lt;br /&gt;
|None lever in the maximum forward position is 100%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These modes can be send to the throttle when the throttle is off. If the throttle is on the configuration will be ignored. A sound will play when a message is received. The message has to be send to the Throttle address 0x337, same as the reboot command. the format is as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message for Setting the control mode&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA || Control type || MSB int16_t  || LSB int16_t|| MSB int16_t  || LSB int16_t&lt;br /&gt;
|-&lt;br /&gt;
| Hardcoded command|| See Table Above || colspan=2 | Max value for lever completely forward || colspan=2 | Same but for backward (Positive for reverse)&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example command: ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line=&amp;quot;1&amp;quot; start=&amp;quot;69&amp;quot;&amp;gt;&lt;br /&gt;
# duty cycle&lt;br /&gt;
cansend can0 337#AA0200000000&lt;br /&gt;
&lt;br /&gt;
# 120A current control&lt;br /&gt;
cansend can0 337#AA0304B004B0&lt;br /&gt;
&lt;br /&gt;
# relative current control&lt;br /&gt;
cansend can0 337#AA0400000000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CAN Diagnostics messages ==&lt;br /&gt;
The throttle also send out messages to help debugging every 200 ms. It is send on address 0x337 and has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message for Diagnostic Purposes&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5 !! Byte 6 !! Byte 7&lt;br /&gt;
|-&lt;br /&gt;
| MSB int16_t  || LSB int16_t || MSB int16_t  || LSB int16_t || MSB int16_t  || LSB int16_t || uint8_t || Error status&lt;br /&gt;
|-&lt;br /&gt;
| colspan=2 | Filtered lever position, from +512 to -512 || colspan=2 | Raw position reported by the magnetic encoder || colspan=2 | Raw data from the deadmanswitch ADC || Gain that is required to readout the lever position || Enum of current error state. 0x00 is good&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If any of the error status bits are set, the throttle is set into IDLE mode and will shut off the motor. The following table shows what the bitfield represents:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Bit !! Enum Name !! Explanation&lt;br /&gt;
|-&lt;br /&gt;
| 0 to 2 || twiError || See next table for possible values&lt;br /&gt;
|-&lt;br /&gt;
| 3      || noLimitsLoaded || Reading of EEPROM for throttle limits failed&lt;br /&gt;
|-&lt;br /&gt;
| 4      || gainClipping || The Magnetic encoder detected no good magnetic field present&lt;br /&gt;
|-&lt;br /&gt;
| 5      || gainInvalid || The gain value read from the magnetic encoder is beyond the range specified in software&lt;br /&gt;
|-&lt;br /&gt;
| 6      || deadmanMissing || The hall sensor of the deadman-switch doesn't detect a strong enough magnet&lt;br /&gt;
|-&lt;br /&gt;
| 7      || impeadanceHigh || The impeadance of the deadman signal is too high, indicating a bad connection&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ TWI error states&lt;br /&gt;
|-&lt;br /&gt;
! Value !! Error name !! Error Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 ||	TWI_ERROR_NoError              || Indicates that the command completed successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||	TWI_ERROR_BusFault             || A TWI bus fault occurred while attempting to capture the bus. &lt;br /&gt;
|-&lt;br /&gt;
| 2 ||	TWI_ERROR_BusCaptureTimeout    || A timeout occurred whilst waiting for the bus to be ready. &lt;br /&gt;
|-&lt;br /&gt;
| 3 ||	TWI_ERROR_SlaveResponseTimeout || No ACK received at the nominated slave address within the timeout period.&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||	TWI_ERROR_SlaveNotReady        || Slave NAKed the TWI bus START condition. &lt;br /&gt;
|-&lt;br /&gt;
| 5 ||	TWI_ERROR_SlaveNAK             || Slave NAKed whilst attempting to send data to the device. &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Autopilot&amp;diff=268</id>
		<title>Autopilot</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Autopilot&amp;diff=268"/>
		<updated>2026-03-15T18:08:53Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Platform ==&lt;br /&gt;
Ease of development dictated the choice to run the control loop on existing hard- and software. which was chosen to be Ardupilot running on a [https://docs.cubepilot.org/user-guides/autopilot/the-cube-module-overview orange cube].&lt;br /&gt;
[[File:Ardupilot.jpg|thumb|Ardupilot PCB with the orange cube mounted.]]&lt;br /&gt;
To make use for our application a PCB has been designed to integrate into the hydrofoil design. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To connect to the ardupilot on the cube for tweaking settings and tuning control loops, [https://ardupilot.org/planner/docs/mission-planner-overview.html Mission Planner] will be used. The following section have tweaked settings found in Mission Planner.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
The cube is a plug-and-play unit and therefore does not need setup changes in the underlying ardupilot software. Only necessary settings should be tweaked.&lt;br /&gt;
&lt;br /&gt;
Apart from the settings, tuning needs to be done in Mission Planner, this can only be done with the solar boat in the water and therefore no values are known for now.&lt;br /&gt;
&lt;br /&gt;
The ardupilot PCB supports three servo motors, two front and one back motor. It has two isolated power supplies for the servo motors. Support for CAN and the cube is powered by the 24v input from the CAN connection.&lt;br /&gt;
&lt;br /&gt;
It has its own GPS antenna and four UART serial ports, where Serial1 is used for the MAVLINK connect to Mission Planner that is running on a laptop. Two of these serial ports will be used to implement the height sensors that will be mounted on the boat for measuring the height of the water. This ensures that the system correctly responds to waves where the boat can 'surf' over.&lt;br /&gt;
&lt;br /&gt;
For steering on foils an extra MCU is added onto the board namely: ATSAMD20E18A. This MCU can receive data from the rudder that gives the steering position and sends it through to the cube.&lt;br /&gt;
&lt;br /&gt;
== Height Sensors ==&lt;br /&gt;
Currently testing ultrasonic height sensors, the RS485 version of the DYP-A02YY4W-V2.0. &lt;br /&gt;
&lt;br /&gt;
== Ardupilot settings ==&lt;br /&gt;
To use the ardupilot as the foil control unit, some settings need to be changed since they do not apply to us or should be disabled. These settings are given below with a small explanation why it has been configured as is.&lt;br /&gt;
&lt;br /&gt;
The settings below are the changed settings used by the ardupilot. There are more ports available on the ardupilot, whenever more are used or are changed the table will be updated.&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
Configuration of ardupilot&lt;br /&gt;
!Setting&lt;br /&gt;
!Value&lt;br /&gt;
!Description&lt;br /&gt;
!Reason&lt;br /&gt;
|-&lt;br /&gt;
|INS_GYR_CAL&lt;br /&gt;
|0&lt;br /&gt;
|Controls the automatic gyro calibration.&lt;br /&gt;
|Gyro calibration requires that the unit should be held as still as possible.&lt;br /&gt;
|-&lt;br /&gt;
|SERVO1_FUNCTION&lt;br /&gt;
|78&lt;br /&gt;
|ElevonRight&lt;br /&gt;
|Controls the right foil assembly.&lt;br /&gt;
|-&lt;br /&gt;
|SERVO2_FUNCTION&lt;br /&gt;
|77&lt;br /&gt;
|ElevonLeft&lt;br /&gt;
|Controls the left foil assembly.&lt;br /&gt;
|-&lt;br /&gt;
|INITIAL_MODE&lt;br /&gt;
|5&lt;br /&gt;
|FBWA&lt;br /&gt;
|Fly By Wire A this is a fly mode for the control unit. More can be found [https://ardupilot.org/plane/docs/fbwa-mode.html here].&lt;br /&gt;
|-&lt;br /&gt;
|GPS_TYPE2&lt;br /&gt;
|5&lt;br /&gt;
|NMEA&lt;br /&gt;
|This sets the GPS data that is sent onto the serial data port.&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL1_PROTOCOL&lt;br /&gt;
|2&lt;br /&gt;
|MAVLINK2&lt;br /&gt;
|Controls what protocol to use on the serial port&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL1_BAUD&lt;br /&gt;
|57&lt;br /&gt;
|57600&lt;br /&gt;
|Specifies the baudrate of the serial port.&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL4_PROTOCOL&lt;br /&gt;
|5&lt;br /&gt;
|GPS&lt;br /&gt;
|Controls what protocol to use on the serial port&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL4_BAUD&lt;br /&gt;
|9&lt;br /&gt;
|9600&lt;br /&gt;
|Specifies the baudrate of the serial port.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Future plans ==&lt;br /&gt;
As of now: 21-03-2023, FBWA mode is used for controlling the front two foil assembly. It would probably be beneficial whenever the whole system is finished to move towards the FBWB mode.&lt;br /&gt;
&lt;br /&gt;
This mode supports &amp;quot;Automatic Altitude Holding&amp;quot;, that makes sure that the same level of altitude is automatically kept. Further testing is needed for determining the control loops and their coefficients.&lt;br /&gt;
&lt;br /&gt;
Implementing the different sensors into ardupilot and using that data to respond to the environment. These sensors are at least the height sensors and the rudder sensor for the steering angle.&lt;br /&gt;
&lt;br /&gt;
As of March 2026, some progress was made with LUA scripting, see git, some additional reading:&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/plane/docs/common-sensor-testing.html&lt;br /&gt;
&lt;br /&gt;
== Relevant links for configuring Ardupilot ==&lt;br /&gt;
https://ardupilot.org/copter/docs/common-gcs-only-operation.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/common-rangefinder-landingpage.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/setting-up-for-tuning.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/terrain-following-manual-modes.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/common-sensor-offset-compensation.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/crash_check.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/flight-modes.html --FBW-A mode seems best fit for front only, FBW-B for finalized system&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/plane/docs/fbwb-mode.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/stabilize-mode.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/plane/docs/fixed-wing-faq.html --Disable Gyro calibration on start-up&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/rover/docs/sonar-sensors.html --Two sonar sensors&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/dev/docs/plane-architecture.html --Plane architecture and files&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=GaN_MPPT&amp;diff=267</id>
		<title>GaN MPPT</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=GaN_MPPT&amp;diff=267"/>
		<updated>2026-02-28T14:00:14Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* Can Bus Protocol Format */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:MPPT overview.jpg|thumb|Baseboard with two phases populated]]&lt;br /&gt;
Part of a system consisting of 8x Gan Phases and 1x Baseboard.: Picture above is fully populated BaseBoard with 8 GaN boost converters mounted. PCB's can be cooled through Inductors on the bottom using a coldplate, while still being easily replaced from the top by remving the four bolts. Software based on TPEE MPPT&lt;br /&gt;
&lt;br /&gt;
== Can Bus Protocol Format ==&lt;br /&gt;
The CAN bus telemetry is output using Standard CAN IDs (11-bit) by default. The ID structure uses the upper 7 bits for the Node ID (default 64, offset by hardware pins) and the lower 4 bits for the Packet ID.&lt;br /&gt;
&lt;br /&gt;
Here is the documentation for the telemetry messages:&lt;br /&gt;
&lt;br /&gt;
CAN Bus Frame Format&lt;br /&gt;
&lt;br /&gt;
Frame Type: Standard Frame (11-bit ID)&lt;br /&gt;
&lt;br /&gt;
Bitrate: 1000kbps&lt;br /&gt;
&lt;br /&gt;
Node ID: Configurable generalCanId (64) + Hardware ID offset (Pins ID0-ID3)&lt;br /&gt;
&lt;br /&gt;
NB: The ID is based on the position on the mainboard. Where ID0-ID2 is equal to the position 0-7, and ID3 is dependent on the DIP-switch on the mainboard. Front ID3 = 1, Read ID3 = 0.&lt;br /&gt;
&lt;br /&gt;
CAN ID Construction: (NodeID &amp;lt;&amp;lt; 4) | PacketID&lt;br /&gt;
&lt;br /&gt;
=== Power ===&lt;br /&gt;
Packet ID 0x00: Power (2Hz)&lt;br /&gt;
&lt;br /&gt;
Sent every 500ms. Contains the primary voltage and current measurements.&lt;br /&gt;
&lt;br /&gt;
Packet ID: 0x00&lt;br /&gt;
&lt;br /&gt;
Data Length: 8 Bytes&lt;br /&gt;
&lt;br /&gt;
Format: Big Endian (Network Order)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Byte'''&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Type'''&lt;br /&gt;
|'''Scaling'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|0-1&lt;br /&gt;
|Input  Voltage&lt;br /&gt;
|int16&lt;br /&gt;
|0.01  V/bit&lt;br /&gt;
|Input  Voltage (Vlow)&lt;br /&gt;
|-&lt;br /&gt;
|2-3&lt;br /&gt;
|Input  Current&lt;br /&gt;
|int16&lt;br /&gt;
|0.0005  A/bit&lt;br /&gt;
|Input  Current (Iind). Scaling factor 2000.0f&lt;br /&gt;
|-&lt;br /&gt;
|4-5&lt;br /&gt;
|Output  Voltage&lt;br /&gt;
|int16&lt;br /&gt;
|0.01  V/bit&lt;br /&gt;
|Output  Voltage (Vhigh)&lt;br /&gt;
|-&lt;br /&gt;
|6-7&lt;br /&gt;
|Output  Current&lt;br /&gt;
|int16&lt;br /&gt;
|0.0005  A/bit&lt;br /&gt;
|Output  Current (Ihigh). Scaling factor 2000.0f&lt;br /&gt;
|}&lt;br /&gt;
Note on Scaling:&lt;br /&gt;
&lt;br /&gt;
buffer_append_float16(data, value, scale, &amp;amp;index) multiplies the float value by scale and stores it as an int16.&lt;br /&gt;
&lt;br /&gt;
To decode: float value = (float)((int16_t)received_value) / scale&lt;br /&gt;
&lt;br /&gt;
Input/Output Current Scale: 2000.0 -&amp;gt; Divide received int16 by 2000.0 to get Amps.&lt;br /&gt;
&lt;br /&gt;
Input/Output Voltage Scale: 100.0 -&amp;gt; Divide received int16 by 100.0 to get Volts.&lt;br /&gt;
&lt;br /&gt;
=== Status ===&lt;br /&gt;
Packet ID 0x01: Status (1Hz)&lt;br /&gt;
&lt;br /&gt;
Sent every 1000ms. Contains the operating state and fault codes.&lt;br /&gt;
&lt;br /&gt;
Packet ID: 0x01&lt;br /&gt;
&lt;br /&gt;
Data Length: 5 Bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Byte'''&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Type'''&lt;br /&gt;
|'''Scaling   / Enum'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|Mode&lt;br /&gt;
|uint8&lt;br /&gt;
|PhaseMode_t&lt;br /&gt;
|Operating  Mode (1=CIV, 2=CIC, 3=MinInputCurrent, 4=COV, 5=COC, 6=Temp Derating,  7=Fault)&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Fault&lt;br /&gt;
|uint8&lt;br /&gt;
|PhaseFault_t&lt;br /&gt;
|Fault  Code (0=OK, 1=Config, 2=Input OV, 3=Output OV, 4=Output OC, 5=Input OC,  6=Input UC, 7=Phase OC)&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Enabled&lt;br /&gt;
|uint8&lt;br /&gt;
|bool&lt;br /&gt;
|1 if  Enabled, 0 if Disabled&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Board  Temp&lt;br /&gt;
|int8&lt;br /&gt;
|1  °C/bit&lt;br /&gt;
|Ambient  Temperature in °C&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Heat  Sink Temp&lt;br /&gt;
|int8&lt;br /&gt;
|1  °C/bit&lt;br /&gt;
|Heatsink  Temperature in °C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sweep Data ===&lt;br /&gt;
Packet ID 0x02: Sweep Data (On Request)&lt;br /&gt;
&lt;br /&gt;
Sent during an MPPT sweep operation.&lt;br /&gt;
&lt;br /&gt;
Packet ID: 0x02&lt;br /&gt;
&lt;br /&gt;
Data Length: 5 Bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Byte'''&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Type'''&lt;br /&gt;
|'''Scaling'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|Index&lt;br /&gt;
|uint8&lt;br /&gt;
|1&lt;br /&gt;
|Sweep  point index (0-255)&lt;br /&gt;
|-&lt;br /&gt;
|1-2&lt;br /&gt;
|Current&lt;br /&gt;
|int16&lt;br /&gt;
|0.0005  A/bit&lt;br /&gt;
|Current  at this sweep point (Scale 2000.0)&lt;br /&gt;
|-&lt;br /&gt;
|3-4&lt;br /&gt;
|Voltage&lt;br /&gt;
|int16&lt;br /&gt;
|0.01  V/bit&lt;br /&gt;
|Voltage  at this sweep point (Scale 100.0)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Enums ===&lt;br /&gt;
&lt;br /&gt;
=== PhaseMode_t (Byte 0 of Status) ===&lt;br /&gt;
0: None (Start)&lt;br /&gt;
&lt;br /&gt;
1: CIV (Constant Input Voltage)&lt;br /&gt;
&lt;br /&gt;
2: CIC (Constant Input Current)&lt;br /&gt;
&lt;br /&gt;
3: MinInputCurrent&lt;br /&gt;
&lt;br /&gt;
4: COV (Constant Output Voltage)&lt;br /&gt;
&lt;br /&gt;
5: COC (Constant Output Current)&lt;br /&gt;
&lt;br /&gt;
6: TD (Temperature Derating)&lt;br /&gt;
&lt;br /&gt;
7: Fault&lt;br /&gt;
&lt;br /&gt;
==== PhaseFault_t (Byte 1 of Status) ====&lt;br /&gt;
0: OK&lt;br /&gt;
&lt;br /&gt;
1: Config Error&lt;br /&gt;
&lt;br /&gt;
2: Input Over Voltage&lt;br /&gt;
&lt;br /&gt;
3: Output Over Voltage&lt;br /&gt;
&lt;br /&gt;
4: Output Over Current&lt;br /&gt;
&lt;br /&gt;
5: Input Over Current&lt;br /&gt;
&lt;br /&gt;
6: Input Under Current&lt;br /&gt;
&lt;br /&gt;
7: Phase Over Current&lt;br /&gt;
&lt;br /&gt;
8: General Fault&lt;br /&gt;
#&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=GaN_MPPT&amp;diff=266</id>
		<title>GaN MPPT</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=GaN_MPPT&amp;diff=266"/>
		<updated>2026-02-28T13:54:08Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:MPPT overview.jpg|thumb|Baseboard with two phases populated]]&lt;br /&gt;
Part of a system consisting of 8x Gan Phases and 1x Baseboard.: Picture above is fully populated BaseBoard with 8 GaN boost converters mounted. PCB's can be cooled through Inductors on the bottom using a coldplate, while still being easily replaced from the top by remving the four bolts. Software based on TPEE MPPT&lt;br /&gt;
&lt;br /&gt;
== Can Bus Protocol Format ==&lt;br /&gt;
The CAN bus telemetry is output using Standard CAN IDs (11-bit) by default. The ID structure uses the upper 7 bits for the Node ID (default 64, offset by hardware pins) and the lower 4 bits for the Packet ID.&lt;br /&gt;
&lt;br /&gt;
Here is the documentation for the telemetry messages:&lt;br /&gt;
&lt;br /&gt;
CAN Bus Frame Format&lt;br /&gt;
&lt;br /&gt;
Frame Type: Standard Frame (11-bit ID)&lt;br /&gt;
&lt;br /&gt;
Bitrate: 1000kbps&lt;br /&gt;
&lt;br /&gt;
Node ID: Configurable generalCanId (64) + Hardware ID offset (Pins ID0-ID3)&lt;br /&gt;
&lt;br /&gt;
CAN ID Construction: (NodeID &amp;lt;&amp;lt; 4) | PacketID&lt;br /&gt;
&lt;br /&gt;
=== Power ===&lt;br /&gt;
Packet ID 0x00: Power (2Hz)&lt;br /&gt;
&lt;br /&gt;
Sent every 500ms. Contains the primary voltage and current measurements.&lt;br /&gt;
&lt;br /&gt;
Packet ID: 0x00&lt;br /&gt;
&lt;br /&gt;
Data Length: 8 Bytes&lt;br /&gt;
&lt;br /&gt;
Format: Big Endian (Network Order)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Byte'''&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Type'''&lt;br /&gt;
|'''Scaling'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|0-1&lt;br /&gt;
|Input  Voltage&lt;br /&gt;
|int16&lt;br /&gt;
|0.01  V/bit&lt;br /&gt;
|Input  Voltage (Vlow)&lt;br /&gt;
|-&lt;br /&gt;
|2-3&lt;br /&gt;
|Input  Current&lt;br /&gt;
|int16&lt;br /&gt;
|0.0005  A/bit&lt;br /&gt;
|Input  Current (Iind). Scaling factor 2000.0f&lt;br /&gt;
|-&lt;br /&gt;
|4-5&lt;br /&gt;
|Output  Voltage&lt;br /&gt;
|int16&lt;br /&gt;
|0.01  V/bit&lt;br /&gt;
|Output  Voltage (Vhigh)&lt;br /&gt;
|-&lt;br /&gt;
|6-7&lt;br /&gt;
|Output  Current&lt;br /&gt;
|int16&lt;br /&gt;
|0.0005  A/bit&lt;br /&gt;
|Output  Current (Ihigh). Scaling factor 2000.0f&lt;br /&gt;
|}&lt;br /&gt;
Note on Scaling:&lt;br /&gt;
&lt;br /&gt;
buffer_append_float16(data, value, scale, &amp;amp;index) multiplies the float value by scale and stores it as an int16.&lt;br /&gt;
&lt;br /&gt;
To decode: float value = (float)((int16_t)received_value) / scale&lt;br /&gt;
&lt;br /&gt;
Input/Output Current Scale: 2000.0 -&amp;gt; Divide received int16 by 2000.0 to get Amps.&lt;br /&gt;
&lt;br /&gt;
Input/Output Voltage Scale: 100.0 -&amp;gt; Divide received int16 by 100.0 to get Volts.&lt;br /&gt;
&lt;br /&gt;
=== Status ===&lt;br /&gt;
Packet ID 0x01: Status (1Hz)&lt;br /&gt;
&lt;br /&gt;
Sent every 1000ms. Contains the operating state and fault codes.&lt;br /&gt;
&lt;br /&gt;
Packet ID: 0x01&lt;br /&gt;
&lt;br /&gt;
Data Length: 5 Bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Byte'''&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Type'''&lt;br /&gt;
|'''Scaling   / Enum'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|Mode&lt;br /&gt;
|uint8&lt;br /&gt;
|PhaseMode_t&lt;br /&gt;
|Operating  Mode (1=CIV, 2=CIC, 3=MinInputCurrent, 4=COV, 5=COC, 6=Temp Derating,  7=Fault)&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Fault&lt;br /&gt;
|uint8&lt;br /&gt;
|PhaseFault_t&lt;br /&gt;
|Fault  Code (0=OK, 1=Config, 2=Input OV, 3=Output OV, 4=Output OC, 5=Input OC,  6=Input UC, 7=Phase OC)&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Enabled&lt;br /&gt;
|uint8&lt;br /&gt;
|bool&lt;br /&gt;
|1 if  Enabled, 0 if Disabled&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Board  Temp&lt;br /&gt;
|int8&lt;br /&gt;
|1  °C/bit&lt;br /&gt;
|Ambient  Temperature in °C&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Heat  Sink Temp&lt;br /&gt;
|int8&lt;br /&gt;
|1  °C/bit&lt;br /&gt;
|Heatsink  Temperature in °C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sweep Data ===&lt;br /&gt;
Packet ID 0x02: Sweep Data (On Request)&lt;br /&gt;
&lt;br /&gt;
Sent during an MPPT sweep operation.&lt;br /&gt;
&lt;br /&gt;
Packet ID: 0x02&lt;br /&gt;
&lt;br /&gt;
Data Length: 5 Bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Byte'''&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Type'''&lt;br /&gt;
|'''Scaling'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|Index&lt;br /&gt;
|uint8&lt;br /&gt;
|1&lt;br /&gt;
|Sweep  point index (0-255)&lt;br /&gt;
|-&lt;br /&gt;
|1-2&lt;br /&gt;
|Current&lt;br /&gt;
|int16&lt;br /&gt;
|0.0005  A/bit&lt;br /&gt;
|Current  at this sweep point (Scale 2000.0)&lt;br /&gt;
|-&lt;br /&gt;
|3-4&lt;br /&gt;
|Voltage&lt;br /&gt;
|int16&lt;br /&gt;
|0.01  V/bit&lt;br /&gt;
|Voltage  at this sweep point (Scale 100.0)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Enums ===&lt;br /&gt;
&lt;br /&gt;
=== PhaseMode_t (Byte 0 of Status) ===&lt;br /&gt;
0: None (Start)&lt;br /&gt;
&lt;br /&gt;
1: CIV (Constant Input Voltage)&lt;br /&gt;
&lt;br /&gt;
2: CIC (Constant Input Current)&lt;br /&gt;
&lt;br /&gt;
3: MinInputCurrent&lt;br /&gt;
&lt;br /&gt;
4: COV (Constant Output Voltage)&lt;br /&gt;
&lt;br /&gt;
5: COC (Constant Output Current)&lt;br /&gt;
&lt;br /&gt;
6: TD (Temperature Derating)&lt;br /&gt;
&lt;br /&gt;
7: Fault&lt;br /&gt;
&lt;br /&gt;
==== PhaseFault_t (Byte 1 of Status) ====&lt;br /&gt;
0: OK&lt;br /&gt;
&lt;br /&gt;
1: Config Error&lt;br /&gt;
&lt;br /&gt;
2: Input Over Voltage&lt;br /&gt;
&lt;br /&gt;
3: Output Over Voltage&lt;br /&gt;
&lt;br /&gt;
4: Output Over Current&lt;br /&gt;
&lt;br /&gt;
5: Input Over Current&lt;br /&gt;
&lt;br /&gt;
6: Input Under Current&lt;br /&gt;
&lt;br /&gt;
7: Phase Over Current&lt;br /&gt;
&lt;br /&gt;
8: General Fault&lt;br /&gt;
#&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=GaN_MPPT&amp;diff=265</id>
		<title>GaN MPPT</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=GaN_MPPT&amp;diff=265"/>
		<updated>2026-02-25T22:42:41Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* Can Bus Protocol Format */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:MPPT overview.jpg|thumb|Baseboard with two phases populated]]&lt;br /&gt;
Part of a system consisting of 8x Gan Phases and 1x Baseboard.: Picture above is fully populated BaseBoard with 8 GaN boost converters mounted. PCB's can be cooled through Inductors on the bottom using a coldplate, while still being easily replaced from the top by remving the four bolts. Software based on TPEE MPPT&lt;br /&gt;
&lt;br /&gt;
== Can Bus Protocol Format ==&lt;br /&gt;
The CAN bus telemetry is output using Standard CAN IDs (11-bit) by default. The ID structure uses the upper 7 bits for the Node ID (default 10, offset by hardware pins) and the lower 4 bits for the Packet ID.&lt;br /&gt;
&lt;br /&gt;
Here is the documentation for the telemetry messages:&lt;br /&gt;
&lt;br /&gt;
CAN Bus Frame Format&lt;br /&gt;
&lt;br /&gt;
Frame Type: Standard Frame (11-bit ID)&lt;br /&gt;
&lt;br /&gt;
Bitrate: 1000kbps&lt;br /&gt;
&lt;br /&gt;
Node ID: Configurable generalCanId (64) + Hardware ID offset (Pins ID0-ID3)&lt;br /&gt;
&lt;br /&gt;
CAN ID Construction: (NodeID &amp;lt;&amp;lt; 4) | PacketID&lt;br /&gt;
&lt;br /&gt;
=== Status ===&lt;br /&gt;
Packet ID 0x01: Status (10Hz)&lt;br /&gt;
&lt;br /&gt;
Sent every 100ms. Contains the operating state and fault codes.&lt;br /&gt;
&lt;br /&gt;
Packet ID: 0x01&lt;br /&gt;
&lt;br /&gt;
Data Length: 5 Bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Byte'''&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Type'''&lt;br /&gt;
|'''Scaling   / Enum'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|Mode&lt;br /&gt;
|uint8&lt;br /&gt;
|PhaseMode_t&lt;br /&gt;
|Operating  Mode (1=CIV, 2=CIC, 3=MinInputCurrent, 4=COV, 5=COC, 6=Temp Derating,  7=Fault)&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Fault&lt;br /&gt;
|uint8&lt;br /&gt;
|PhaseFault_t&lt;br /&gt;
|Fault  Code (0=OK, 1=Config, 2=Input OV, 3=Output OV, 4=Output OC, 5=Input OC,  6=Input UC, 7=Phase OC)&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Enabled&lt;br /&gt;
|uint8&lt;br /&gt;
|bool&lt;br /&gt;
|1 if  Enabled, 0 if Disabled&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Board  Temp&lt;br /&gt;
|int8&lt;br /&gt;
|1  °C/bit&lt;br /&gt;
|Ambient  Temperature in °C&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Heat  Sink Temp&lt;br /&gt;
|int8&lt;br /&gt;
|1  °C/bit&lt;br /&gt;
|Heatsink  Temperature in °C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Power ===&lt;br /&gt;
Packet ID 0x00: Power (2Hz)&lt;br /&gt;
&lt;br /&gt;
Sent every 500ms. Contains the primary voltage and current measurements.&lt;br /&gt;
&lt;br /&gt;
Packet ID: 0x00&lt;br /&gt;
&lt;br /&gt;
Data Length: 8 Bytes&lt;br /&gt;
&lt;br /&gt;
Format: Big Endian (Network Order)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Byte'''&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Type'''&lt;br /&gt;
|'''Scaling'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|0-1&lt;br /&gt;
|Input  Voltage&lt;br /&gt;
|int16&lt;br /&gt;
|0.01  V/bit&lt;br /&gt;
|Input  Voltage (Vlow)&lt;br /&gt;
|-&lt;br /&gt;
|2-3&lt;br /&gt;
|Input  Current&lt;br /&gt;
|int16&lt;br /&gt;
|0.0005  A/bit&lt;br /&gt;
|Input  Current (Iind). Scaling factor 2000.0f&lt;br /&gt;
|-&lt;br /&gt;
|4-5&lt;br /&gt;
|Output  Voltage&lt;br /&gt;
|int16&lt;br /&gt;
|0.01  V/bit&lt;br /&gt;
|Output  Voltage (Vhigh)&lt;br /&gt;
|-&lt;br /&gt;
|6-7&lt;br /&gt;
|Output  Current&lt;br /&gt;
|int16&lt;br /&gt;
|0.0005  A/bit&lt;br /&gt;
|Output  Current (Ihigh). Scaling factor 2000.0f&lt;br /&gt;
|}&lt;br /&gt;
Note on Scaling:&lt;br /&gt;
&lt;br /&gt;
buffer_append_float16(data, value, scale, &amp;amp;index) multiplies the float value by scale and stores it as an int16.&lt;br /&gt;
&lt;br /&gt;
To decode: float value = (float)((int16_t)received_value) / scale&lt;br /&gt;
&lt;br /&gt;
Input/Output Current Scale: 2000.0 -&amp;gt; Divide received int16 by 2000.0 to get Amps.&lt;br /&gt;
&lt;br /&gt;
Input/Output Voltage Scale: 100.0 -&amp;gt; Divide received int16 by 100.0 to get Volts.&lt;br /&gt;
&lt;br /&gt;
=== Sweep Data ===&lt;br /&gt;
Packet ID 0x02: Sweep Data (On Request)&lt;br /&gt;
&lt;br /&gt;
Sent during an MPPT sweep operation.&lt;br /&gt;
&lt;br /&gt;
Packet ID: 0x02&lt;br /&gt;
&lt;br /&gt;
Data Length: 5 Bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Byte'''&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Type'''&lt;br /&gt;
|'''Scaling'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|Index&lt;br /&gt;
|uint8&lt;br /&gt;
|1&lt;br /&gt;
|Sweep  point index (0-255)&lt;br /&gt;
|-&lt;br /&gt;
|1-2&lt;br /&gt;
|Current&lt;br /&gt;
|int16&lt;br /&gt;
|0.0005  A/bit&lt;br /&gt;
|Current  at this sweep point (Scale 2000.0)&lt;br /&gt;
|-&lt;br /&gt;
|3-4&lt;br /&gt;
|Voltage&lt;br /&gt;
|int16&lt;br /&gt;
|0.01  V/bit&lt;br /&gt;
|Voltage  at this sweep point (Scale 100.0)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Enums ===&lt;br /&gt;
&lt;br /&gt;
=== PhaseMode_t (Byte 0 of Status) ===&lt;br /&gt;
0: None (Start)&lt;br /&gt;
&lt;br /&gt;
1: CIV (Constant Input Voltage)&lt;br /&gt;
&lt;br /&gt;
2: CIC (Constant Input Current)&lt;br /&gt;
&lt;br /&gt;
3: MinInputCurrent&lt;br /&gt;
&lt;br /&gt;
4: COV (Constant Output Voltage)&lt;br /&gt;
&lt;br /&gt;
5: COC (Constant Output Current)&lt;br /&gt;
&lt;br /&gt;
6: TD (Temperature Derating)&lt;br /&gt;
&lt;br /&gt;
7: Fault&lt;br /&gt;
&lt;br /&gt;
==== PhaseFault_t (Byte 1 of Status) ====&lt;br /&gt;
0: OK&lt;br /&gt;
&lt;br /&gt;
1: Config Error&lt;br /&gt;
&lt;br /&gt;
2: Input Over Voltage&lt;br /&gt;
&lt;br /&gt;
3: Output Over Voltage&lt;br /&gt;
&lt;br /&gt;
4: Output Over Current&lt;br /&gt;
&lt;br /&gt;
5: Input Over Current&lt;br /&gt;
&lt;br /&gt;
6: Input Under Current&lt;br /&gt;
&lt;br /&gt;
7: Phase Over Current&lt;br /&gt;
&lt;br /&gt;
8: General Fault&lt;br /&gt;
#&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=GaN_MPPT&amp;diff=264</id>
		<title>GaN MPPT</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=GaN_MPPT&amp;diff=264"/>
		<updated>2026-02-25T22:41:42Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:MPPT overview.jpg|thumb|Baseboard with two phases populated]]&lt;br /&gt;
Part of a system consisting of 8x Gan Phases and 1x Baseboard.: Picture above is fully populated BaseBoard with 8 GaN boost converters mounted. PCB's can be cooled through Inductors on the bottom using a coldplate, while still being easily replaced from the top by remving the four bolts. Software based on TPEE MPPT&lt;br /&gt;
&lt;br /&gt;
== Can Bus Protocol Format ==&lt;br /&gt;
The CAN bus telemetry is output using Standard CAN IDs (11-bit) by default. The ID structure uses the upper 7 bits for the Node ID (default 10, offset by hardware pins) and the lower 4 bits for the Packet ID.&lt;br /&gt;
&lt;br /&gt;
Here is the documentation for the telemetry messages:&lt;br /&gt;
&lt;br /&gt;
CAN Bus Frame Format&lt;br /&gt;
&lt;br /&gt;
Frame Type: Standard Frame (11-bit ID)&lt;br /&gt;
&lt;br /&gt;
Bitrate: Configurable (Default 500kbps)&lt;br /&gt;
&lt;br /&gt;
Node ID: Configurable generalCanId (Default 10) + Hardware ID offset (Pins ID0-ID3)&lt;br /&gt;
&lt;br /&gt;
CAN ID Construction: (NodeID &amp;lt;&amp;lt; 4) | PacketID&lt;br /&gt;
&lt;br /&gt;
=== Status ===&lt;br /&gt;
Packet ID 0x01: Status (10Hz)&lt;br /&gt;
&lt;br /&gt;
Sent every 100ms. Contains the operating state and fault codes.&lt;br /&gt;
&lt;br /&gt;
Packet ID: 0x01&lt;br /&gt;
&lt;br /&gt;
Data Length: 5 Bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Byte'''&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Type'''&lt;br /&gt;
|'''Scaling   / Enum'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|Mode&lt;br /&gt;
|uint8&lt;br /&gt;
|PhaseMode_t&lt;br /&gt;
|Operating  Mode (1=CIV, 2=CIC, 3=MinInputCurrent, 4=COV, 5=COC, 6=Temp Derating,  7=Fault)&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Fault&lt;br /&gt;
|uint8&lt;br /&gt;
|PhaseFault_t&lt;br /&gt;
|Fault  Code (0=OK, 1=Config, 2=Input OV, 3=Output OV, 4=Output OC, 5=Input OC,  6=Input UC, 7=Phase OC)&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Enabled&lt;br /&gt;
|uint8&lt;br /&gt;
|bool&lt;br /&gt;
|1 if  Enabled, 0 if Disabled&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Board  Temp&lt;br /&gt;
|int8&lt;br /&gt;
|1  °C/bit&lt;br /&gt;
|Ambient  Temperature in °C&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Heat  Sink Temp&lt;br /&gt;
|int8&lt;br /&gt;
|1  °C/bit&lt;br /&gt;
|Heatsink  Temperature in °C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Power ===&lt;br /&gt;
Packet ID 0x00: Power (2Hz)&lt;br /&gt;
&lt;br /&gt;
Sent every 500ms. Contains the primary voltage and current measurements.&lt;br /&gt;
&lt;br /&gt;
Packet ID: 0x00&lt;br /&gt;
&lt;br /&gt;
Data Length: 8 Bytes&lt;br /&gt;
&lt;br /&gt;
Format: Big Endian (Network Order)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Byte'''&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Type'''&lt;br /&gt;
|'''Scaling'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|0-1&lt;br /&gt;
|Input  Voltage&lt;br /&gt;
|int16&lt;br /&gt;
|0.01  V/bit&lt;br /&gt;
|Input  Voltage (Vlow)&lt;br /&gt;
|-&lt;br /&gt;
|2-3&lt;br /&gt;
|Input  Current&lt;br /&gt;
|int16&lt;br /&gt;
|0.0005  A/bit&lt;br /&gt;
|Input  Current (Iind). Scaling factor 2000.0f&lt;br /&gt;
|-&lt;br /&gt;
|4-5&lt;br /&gt;
|Output  Voltage&lt;br /&gt;
|int16&lt;br /&gt;
|0.01  V/bit&lt;br /&gt;
|Output  Voltage (Vhigh)&lt;br /&gt;
|-&lt;br /&gt;
|6-7&lt;br /&gt;
|Output  Current&lt;br /&gt;
|int16&lt;br /&gt;
|0.0005  A/bit&lt;br /&gt;
|Output  Current (Ihigh). Scaling factor 2000.0f&lt;br /&gt;
|}&lt;br /&gt;
Note on Scaling:&lt;br /&gt;
&lt;br /&gt;
buffer_append_float16(data, value, scale, &amp;amp;index) multiplies the float value by scale and stores it as an int16.&lt;br /&gt;
&lt;br /&gt;
To decode: float value = (float)((int16_t)received_value) / scale&lt;br /&gt;
&lt;br /&gt;
Input/Output Current Scale: 2000.0 -&amp;gt; Divide received int16 by 2000.0 to get Amps.&lt;br /&gt;
&lt;br /&gt;
Input/Output Voltage Scale: 100.0 -&amp;gt; Divide received int16 by 100.0 to get Volts.&lt;br /&gt;
&lt;br /&gt;
=== Sweep Data ===&lt;br /&gt;
Packet ID 0x02: Sweep Data (On Request)&lt;br /&gt;
&lt;br /&gt;
Sent during an MPPT sweep operation.&lt;br /&gt;
&lt;br /&gt;
Packet ID: 0x02&lt;br /&gt;
&lt;br /&gt;
Data Length: 5 Bytes&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Byte'''&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Type'''&lt;br /&gt;
|'''Scaling'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|Index&lt;br /&gt;
|uint8&lt;br /&gt;
|1&lt;br /&gt;
|Sweep  point index (0-255)&lt;br /&gt;
|-&lt;br /&gt;
|1-2&lt;br /&gt;
|Current&lt;br /&gt;
|int16&lt;br /&gt;
|0.0005  A/bit&lt;br /&gt;
|Current  at this sweep point (Scale 2000.0)&lt;br /&gt;
|-&lt;br /&gt;
|3-4&lt;br /&gt;
|Voltage&lt;br /&gt;
|int16&lt;br /&gt;
|0.01  V/bit&lt;br /&gt;
|Voltage  at this sweep point (Scale 100.0)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Enums ===&lt;br /&gt;
&lt;br /&gt;
=== PhaseMode_t (Byte 0 of Status) ===&lt;br /&gt;
0: None (Start)&lt;br /&gt;
&lt;br /&gt;
1: CIV (Constant Input Voltage)&lt;br /&gt;
&lt;br /&gt;
2: CIC (Constant Input Current)&lt;br /&gt;
&lt;br /&gt;
3: MinInputCurrent&lt;br /&gt;
&lt;br /&gt;
4: COV (Constant Output Voltage)&lt;br /&gt;
&lt;br /&gt;
5: COC (Constant Output Current)&lt;br /&gt;
&lt;br /&gt;
6: TD (Temperature Derating)&lt;br /&gt;
&lt;br /&gt;
7: Fault&lt;br /&gt;
&lt;br /&gt;
==== PhaseFault_t (Byte 1 of Status) ====&lt;br /&gt;
0: OK&lt;br /&gt;
&lt;br /&gt;
1: Config Error&lt;br /&gt;
&lt;br /&gt;
2: Input Over Voltage&lt;br /&gt;
&lt;br /&gt;
3: Output Over Voltage&lt;br /&gt;
&lt;br /&gt;
4: Output Over Current&lt;br /&gt;
&lt;br /&gt;
5: Input Over Current&lt;br /&gt;
&lt;br /&gt;
6: Input Under Current&lt;br /&gt;
&lt;br /&gt;
7: Phase Over Current&lt;br /&gt;
&lt;br /&gt;
8: General Fault&lt;br /&gt;
#&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=File:MPPT_overview.jpg&amp;diff=263</id>
		<title>File:MPPT overview.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=File:MPPT_overview.jpg&amp;diff=263"/>
		<updated>2026-02-25T22:33:14Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; a&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Safety&amp;diff=257</id>
		<title>Safety</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Safety&amp;diff=257"/>
		<updated>2025-06-26T05:50:06Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* Electrical Specifications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The safety system is meant to stop the boat in an emergency, there is an E-Stop button on the deck near the driver. Pressing this will disable the charge, discharge and peri-power paths in the battery.&lt;br /&gt;
&lt;br /&gt;
== Electrical Specifications ==&lt;br /&gt;
[[File:Safety .png|thumb|The safety output as implemented on the [[Battery|BMS]]. When the boat is on the SAFETY_n signal is low. connecting pin 1 of connector J7 to ground]]&lt;br /&gt;
The safety wire runs together with the [[CAN-bus|CAN bus]] over same physical wire, daisy-chained on every sub-system using the 5-pins binder connectors. The safety wire is referenced to CAN ground and has an open drain output at the battery. When the safety wire is low the boat is turned on. Each subsystem should have a pull-up installed from 5v to their safety input to ensure a high level is measured when its cable is disconnected. The safety input have 6v TVS diodes installed and should not be subject to voltages over 5v5 for long amounts of time.&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Safety&amp;diff=256</id>
		<title>Safety</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Safety&amp;diff=256"/>
		<updated>2025-06-26T05:49:10Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The safety system is meant to stop the boat in an emergency, there is an E-Stop button on the deck near the driver. Pressing this will disable the charge, discharge and peri-power paths in the battery.&lt;br /&gt;
&lt;br /&gt;
== Electrical Specifications ==&lt;br /&gt;
[[File:Safety .png|thumb|The safety output as implemented on the [[Battery|BMS]]. When the boat is on the SAFETY_n signal is low. connecting pin 1 of connector J7 to ground]]&lt;br /&gt;
The safety wire runs together with the [[CAN-bus|CAN bus]] over same physical wire, daisy-chained on every sub-system using the 5-pins binder connectors. The safety wire is referenced to CAN ground and has an open drain output at the battery. When the safety wire is low the boat is turned on, each subsystem should have a pull up installed to 5v their safety input to ensure a high level is measured when its cable is disconnected. The safety input have 6v TVS diodes installed and should not be subject to voltages over 5v5 for long amounts of time.&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=File:Safety_.png&amp;diff=255</id>
		<title>File:Safety .png</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=File:Safety_.png&amp;diff=255"/>
		<updated>2025-06-26T05:46:56Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Safety output circuitry used in BMS&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Safety&amp;diff=254</id>
		<title>Safety</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Safety&amp;diff=254"/>
		<updated>2025-06-26T05:41:46Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: Created page with &amp;quot;The safety system is meant to stop the boat in an emergency, there is an E-Stop buton on the deck near the driver. Pressing this will disable the charge, discharge and peri-power paths in the battery.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The safety system is meant to stop the boat in an emergency, there is an E-Stop buton on the deck near the driver. Pressing this will disable the charge, discharge and peri-power paths in the battery.&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=GaN_MPPT&amp;diff=253</id>
		<title>GaN MPPT</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=GaN_MPPT&amp;diff=253"/>
		<updated>2025-06-20T15:01:09Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;First idea's for a GaN based MPPT&lt;br /&gt;
&lt;br /&gt;
# Individual Phases are replaceable easily&lt;br /&gt;
# Software based on TPEE MPPT[https://www.tpee.nl/open-sec-open-source-mppt-developed-for-high-efficiency-solar-cars/]&lt;br /&gt;
##TPEE uses USB for config&lt;br /&gt;
# Compatible with 14S , sufficient protection for transients etc.&lt;br /&gt;
# Some way to get heat out of the enclosure&lt;br /&gt;
# Easy connectors on the enclosure (no conta-clip)&lt;br /&gt;
# Enough channels to have 2 MPPT's boards for the whole boat, probably 6 or 8?&lt;br /&gt;
# Interleaved operation to reduce RMS current through capacitors&lt;br /&gt;
# Functional isolation on CAN and safety inputs&lt;br /&gt;
#&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=GaN_MPPT&amp;diff=249</id>
		<title>GaN MPPT</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=GaN_MPPT&amp;diff=249"/>
		<updated>2025-06-10T18:11:18Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: Created page with &amp;quot;First idea's for a GaN based MPPT  # Individual Phases are replaceable easily # Software based on TPEE MPPT[https://www.tpee.nl/open-sec-open-source-mppt-developed-for-high-efficiency-solar-cars/] # Compatible with 14S , sufficient protection for transients etc. # Some way to get heat out of the enclosure # Easy connectors on the enclosure (no conta-clip) # Enough channels to have 2 MPPT's boards for the whole boat, probably 6 or 8? # Interleaved operation to reduce RMS...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;First idea's for a GaN based MPPT&lt;br /&gt;
&lt;br /&gt;
# Individual Phases are replaceable easily&lt;br /&gt;
# Software based on TPEE MPPT[https://www.tpee.nl/open-sec-open-source-mppt-developed-for-high-efficiency-solar-cars/]&lt;br /&gt;
# Compatible with 14S , sufficient protection for transients etc.&lt;br /&gt;
# Some way to get heat out of the enclosure&lt;br /&gt;
# Easy connectors on the enclosure (no conta-clip)&lt;br /&gt;
# Enough channels to have 2 MPPT's boards for the whole boat, probably 6 or 8?&lt;br /&gt;
# Interleaved operation to reduce RMS current through capacitors&lt;br /&gt;
# Functional isolation on CAN and safety inputs&lt;br /&gt;
#&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Hub_Sensor&amp;diff=241</id>
		<title>Hub Sensor</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Hub_Sensor&amp;diff=241"/>
		<updated>2025-05-25T13:16:20Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* Future Tests and Features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The hub sensor is an AS5047 magnetic encoder mounted behind the Lehner BLDC motor inside the rudder. The hub sensor communicated the position of the rotor to provide a reference position to the motordriver during startup.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
[[File:250525135749 Scope Screen.png|thumb|Scope screen of the RS422 in blue and SPI from the VESC. Showing the timing of the various data transfers]]&lt;br /&gt;
The hubsesnor is build around two PCBs, one that connects to the VESC and the other that sits behind the motor. These boards are build around the atxmega16e5 and communicate with each other though RS422. The bottom board reads out the AS5047 and NTC and sens this data to the top over serial at 2 Megabaud. This link is quite fast to be able to send this data at the sample rate of the VESC at around 12kHz. The data and power to the hub sensor are separated with functional isolation to make sure the top electronics are protected from water Ingres and shorts. &lt;br /&gt;
&lt;br /&gt;
== Startup and Timing Behavior ==&lt;br /&gt;
The top and hub MCUs share the same flash image so they are easy to update and their protocol is always in sync. During boot the flash of the hub MCU is cleared and it waits for a copy of the top MCU's flash. If this is successful the '''top green LED will blink every second in three quick bursts'''. During running this LED should be blinking continuously. If there is no data from the bottom board for 8ms the top board will reboot the hub and send another flash config, blinking of the red LED will occur during. &lt;br /&gt;
&lt;br /&gt;
== VESC tool ==&lt;br /&gt;
[[File:Vesc.png|thumb|VESC tool showing a counter value that has been generated on the hub PCB for testing. small steps in the data can be seen for unknown reason]]&lt;br /&gt;
[[File:Vesc tool.png|thumb|Showing the hub sensor with magnet data. Note the noise on the right side when the magnet is removed]]&lt;br /&gt;
The encoder was tested using VESC tool and a counter value generated at the bottom hub PCB. The data transmission is quite reliable without a motor attached, a spike of 360 degrees can be seen about every 10 minutes as of git hash &amp;quot;b45a45a&amp;quot; .DMA on the RX UART could ease the timing requirements on the top board and perhaps reduce this.&lt;br /&gt;
&lt;br /&gt;
== Future Tests and Features ==&lt;br /&gt;
Some additional features or tests that could be implemented or done in the future:&lt;br /&gt;
&lt;br /&gt;
* Actually test on the VESC 300/75&lt;br /&gt;
** Currently only tested on the UBOX 75 v2&lt;br /&gt;
*Test with high currents though the motor cables next to the data&lt;br /&gt;
* Implement error detection when for instance no magnet is found &lt;br /&gt;
** Perhaps set the parity bit wrong on the top to let the VESC know there is only garbage&lt;br /&gt;
* Check the temperature sensor accuracy&lt;br /&gt;
** We send the ADC values at the bottom as is to the top DAC. The idea is that we set the same voltage as measured at the bottom with the same resistor divider that's used on the VESC. We havent checked if this actually measures the temperature correctly&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Rudder&amp;diff=240</id>
		<title>Rudder</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Rudder&amp;diff=240"/>
		<updated>2025-05-25T13:13:40Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The motor currently in use in the rudder is the Lehner 30100/12 with a NTC Temp. Sensor (B 25/100 3988 ±1%) installed. There is also a [[Hub Sensor|magnetic encoder]] placed behind the motor.&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Hub_Sensor&amp;diff=239</id>
		<title>Hub Sensor</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Hub_Sensor&amp;diff=239"/>
		<updated>2025-05-25T12:52:34Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* VESC tool */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The hub sensor is an AS5047 magnetic encoder mounted behind the Lehner BLDC motor inside the rudder. The hub sensor communicated the position of the rotor to provide a reference position to the motordriver during startup.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
[[File:250525135749 Scope Screen.png|thumb|Scope screen of the RS422 in blue and SPI from the VESC. Showing the timing of the various data transfers]]&lt;br /&gt;
The hubsesnor is build around two PCBs, one that connects to the VESC and the other that sits behind the motor. These boards are build around the atxmega16e5 and communicate with each other though RS422. The bottom board reads out the AS5047 and NTC and sens this data to the top over serial at 2 Megabaud. This link is quite fast to be able to send this data at the sample rate of the VESC at around 12kHz. The data and power to the hub sensor are separated with functional isolation to make sure the top electronics are protected from water Ingres and shorts. &lt;br /&gt;
&lt;br /&gt;
== Startup and Timing Behavior ==&lt;br /&gt;
The top and hub MCUs share the same flash image so they are easy to update and their protocol is always in sync. During boot the flash of the hub MCU is cleared and it waits for a copy of the top MCU's flash. If this is successful the '''top green LED will blink every second in three quick bursts'''. During running this LED should be blinking continuously. If there is no data from the bottom board for 8ms the top board will reboot the hub and send another flash config, blinking of the red LED will occur during. &lt;br /&gt;
&lt;br /&gt;
== VESC tool ==&lt;br /&gt;
[[File:Vesc.png|thumb|VESC tool showing a counter value that has been generated on the hub PCB for testing. small steps in the data can be seen for unknown reason]]&lt;br /&gt;
[[File:Vesc tool.png|thumb|Showing the hub sensor with magnet data. Note the noise on the right side when the magnet is removed]]&lt;br /&gt;
The encoder was tested using VESC tool and a counter value generated at the bottom hub PCB. The data transmission is quite reliable without a motor attached, a spike of 360 degrees can be seen about every 10 minutes as of git hash &amp;quot;b45a45a&amp;quot; .DMA on the RX UART could ease the timing requirements on the top board and perhaps reduce this.&lt;br /&gt;
&lt;br /&gt;
== Future Tests and Features ==&lt;br /&gt;
Some additional features or tests that could be implemented or done in the future:&lt;br /&gt;
&lt;br /&gt;
* Actually test on the VESC 300/75&lt;br /&gt;
** Currently only tested on the UBOX 75 v2&lt;br /&gt;
* Implement error detection when for instance no magnet is found &lt;br /&gt;
** Perhaps set the parity bit wrong on the top to let the VESC know there is only garbage&lt;br /&gt;
* Check the temperature sensor accuracy&lt;br /&gt;
** We send the ADC values at the bottom as is to the top DAC. The idea is that we set the same voltage as measured at the bottom with the same resistor divider that's used on the VESC. We havent checked if this actually measures the temperature correctly&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Engineers_of_Innovation&amp;diff=238</id>
		<title>Engineers of Innovation</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Engineers_of_Innovation&amp;diff=238"/>
		<updated>2025-05-25T12:43:57Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Consult the [[mediawikiwiki:Special:MyLanguage/Help:Contents|User's Guide]] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
To get started with Engineers of Innovation a couple of links are shown here:&lt;br /&gt;
&lt;br /&gt;
* [https://engineersofinnovation.nl Our own website]&lt;br /&gt;
* [https://git.engineersofinnovation.nl Git]&lt;br /&gt;
* [https://engineers-of-innovation.365.altium.com/ Altium 365 workspace]&lt;br /&gt;
&lt;br /&gt;
=== Wiki page getting started ===&lt;br /&gt;
The different programs that are used all have their respective wiki page for getting started on getting an account and how to access the workspaces. The pages are linked below for easy access:&lt;br /&gt;
&lt;br /&gt;
* [[Altium|Getting started with Altium Designer]]&lt;br /&gt;
*[[Fusion 360|Getting started with Fusion 360]]&lt;br /&gt;
*[[GIT|Getting started with Git]]&lt;br /&gt;
&lt;br /&gt;
== The Solar boat (boii) ==&lt;br /&gt;
[[File:Solar boat with horizon.jpg|thumb|500x500px|Solar boat sailing on the sea around Madeira.]]Our solar boat is an 8 meter long and 1,20 meter wide ship. Where we sail competitive with different teams from Europe. &lt;br /&gt;
&lt;br /&gt;
The clickable picture below shows the different systems within the solar boat, these systems are their own respective project.&lt;br /&gt;
&lt;br /&gt;
Any other projects and subjects going on within the association can be found in the projects [[Project catalogue|catalogue]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;imagemap&amp;gt;&lt;br /&gt;
File:Boot blokschema.drawio.png|frameless|1000x1000px&lt;br /&gt;
rect 72 230 315 354 [[Rudder]]&lt;br /&gt;
rect 692 230 936 354 [[MPPT]]&lt;br /&gt;
rect 352 130 595 253 [[Battery]]&lt;br /&gt;
rect 352 310 595 433 [[Motordriver]]&lt;br /&gt;
rect 1532 90 1776 214 [[Datalogger]]&lt;br /&gt;
rect 1532 350 1775 473 [[Throttle]]&lt;br /&gt;
rect 1892 110 2201 208 [[Autopilot]]&lt;br /&gt;
rect 1892 330 2136 454 [[Foils]] &lt;br /&gt;
rect 2192 210 2436 334 [[MPPT]]&lt;br /&gt;
&amp;lt;/imagemap&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== All Pages Page ==&lt;br /&gt;
Click [[Special:AllPages|HERE]] for a list of all pages on this Wiki&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Page syntax! ==&lt;br /&gt;
Before anyone can edit or add pages to the wiki. An account [[Special:RequestAccount|request]] need to be made.&lt;br /&gt;
&lt;br /&gt;
For new users or users who just want to lookup what the syntax is, a '''[[Test]]''' page is created with general use cases.&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Hub_Sensor&amp;diff=237</id>
		<title>Hub Sensor</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Hub_Sensor&amp;diff=237"/>
		<updated>2025-05-25T12:32:18Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: added future thing to do&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The hub sensor is an AS5047 magnetic encoder mounted behind the Lehner BLDC motor inside the rudder. The hub sensor communicated the position of the rotor to provide a reference position to the motordriver during startup.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
[[File:250525135749 Scope Screen.png|thumb|Scope screen of the RS422 in blue and SPI from the VESC. Showing the timing of the various data transfers]]&lt;br /&gt;
The hubsesnor is build around two PCBs, one that connects to the VESC and the other that sits behind the motor. These boards are build around the atxmega16e5 and communicate with each other though RS422. The bottom board reads out the AS5047 and NTC and sens this data to the top over serial at 2 Megabaud. This link is quite fast to be able to send this data at the sample rate of the VESC at around 12kHz. The data and power to the hub sensor are separated with functional isolation to make sure the top electronics are protected from water Ingres and shorts. &lt;br /&gt;
&lt;br /&gt;
== Startup and Timing Behavior ==&lt;br /&gt;
The top and hub MCUs share the same flash image so they are easy to update and their protocol is always in sync. During boot the flash of the hub MCU is cleared and it waits for a copy of the top MCU's flash. If this is successful the '''top green LED will blink every second in three quick bursts'''. During running this LED should be blinking continuously. If there is no data from the bottom board for 8ms the top board will reboot the hub and send another flash config, blinking of the red LED will occur during. &lt;br /&gt;
&lt;br /&gt;
== VESC tool ==&lt;br /&gt;
[[File:Vesc.png|thumb|VESC tool showing a counter value that has been generated on the hub PCB for testing. small steps in the data can be seen for unknown reason]]&lt;br /&gt;
[[File:Vesc tool.png|thumb|Showing the hub sensor with magnet data. Note the noise on the right side when the magnet is removed]]&lt;br /&gt;
The encoder was tested using VESC tool and a counter value generated at the bottom hub PCB. The data transmission is quite reliable without a motor attached, a spike o0f 360 degrees can be seen every 10 minutes as of git hash &amp;quot;51da04c&amp;quot;. DMA on the RX UART could ease the timing requirements on the top board and perhaps reduce this.&lt;br /&gt;
&lt;br /&gt;
== Future Tests and Features ==&lt;br /&gt;
Some additional features or tests that could be implemented or done in the future:&lt;br /&gt;
&lt;br /&gt;
* Actually test on the VESC 300/75&lt;br /&gt;
** Currently only tested on the UBOX 75 v2&lt;br /&gt;
* Implement error detection when for instance no magnet is found &lt;br /&gt;
** Perhaps set the parity bit wrong on the top to let the VESC know there is only garbage&lt;br /&gt;
* Check the temperature sensor accuracy&lt;br /&gt;
** We send the ADC values at the bottom as is to the top DAC. The idea is that we set the same voltage as measured at the bottom with the same resistor divider that's used on the VESC. We havent checked if this actually measures the temperature correctly&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=File:Vesc_tool.png&amp;diff=236</id>
		<title>File:Vesc tool.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=File:Vesc_tool.png&amp;diff=236"/>
		<updated>2025-05-25T12:26:45Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Showing magnet data though the hub sensor&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Hub_Sensor&amp;diff=235</id>
		<title>Hub Sensor</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Hub_Sensor&amp;diff=235"/>
		<updated>2025-05-25T12:16:03Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: Created page with &amp;quot;The hub sensor is an AS5047 magnetic encoder mounted behind the Lehner BLDC motor inside the rudder. The hub sensor communicated the position of the rotor to provide a reference position to the motordriver during startup.  == Architecture == Scope screen of the RS422 in blue and SPI from the VESC. Showing the timing of the various data transfers The hubsesnor is build around two PCBs, one that connects to the VESC and the othe...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The hub sensor is an AS5047 magnetic encoder mounted behind the Lehner BLDC motor inside the rudder. The hub sensor communicated the position of the rotor to provide a reference position to the motordriver during startup.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
[[File:250525135749 Scope Screen.png|thumb|Scope screen of the RS422 in blue and SPI from the VESC. Showing the timing of the various data transfers]]&lt;br /&gt;
The hubsesnor is build around two PCBs, one that connects to the VESC and the other that sits behind the motor. These boards are build around the atxmega16e5 and communicate with each other though RS422. The bottom board reads out the AS5047 and NTC and sens this data to the top over serial at 1.5 Megabaud. This link is quite fast to be able to send this data at the sample rate of the VESC at around 12kHz. The data and power to the hub sensor are separated with functional isolation to make sure the top electronics are protected from water Ingres and shorts. &lt;br /&gt;
&lt;br /&gt;
== Startup and Timing Behavior ==&lt;br /&gt;
The top and hub MCUs share the same flash image so they are easy to update and their protocol is always in sync. During boot the flash of the hub MCU is cleared and it waits for a copy of the top MCU's flash. If this is successful the '''top green LED will blink every second in three quick bursts'''. During running this LED should be blinking continuously. If there is no data from the bottom board for 8ms the top board will reboot the hub and send another flash config, blinking of the red LED will occur during. &lt;br /&gt;
&lt;br /&gt;
== VESC tool ==&lt;br /&gt;
[[File:Vesc.png|thumb|VESC tool showing a counter value that has been generated on the hub PCB for testing. small steps in the data can be seen for unknown reason]]&lt;br /&gt;
The encoder was tested using VESC tool and a counter value generated at the bottom hub PCB. The data transmission is quite reliable without a motor attached, a spike o0f 360 degrees can be seen every 10 minutes as of git hash &amp;quot;51da04c&amp;quot;. DMA on the RX UART could ease the timing requirements on the top board and perhaps reduce this.&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=File:Vesc.png&amp;diff=234</id>
		<title>File:Vesc.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=File:Vesc.png&amp;diff=234"/>
		<updated>2025-05-25T12:13:18Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VESC tool showing a counter on the encoder channel&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=File:250525135749_Scope_Screen.png&amp;diff=233</id>
		<title>File:250525135749 Scope Screen.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=File:250525135749_Scope_Screen.png&amp;diff=233"/>
		<updated>2025-05-25T12:03:58Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scope image of the timing&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=232</id>
		<title>Throttle</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=232"/>
		<updated>2025-05-17T07:00:10Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* Setting the Control Mode over CAN */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The throttle controls the motor and is operated by the pilot during sailing. It controls the duty cycle of the motor via the CAN bus using the standard VESC message format. &lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
[[File:Throttle Schematic.png|thumb|Throttle shown in the inactive (green led) neutral position]]&lt;br /&gt;
To use the throttle to control the motor the green illuminated ''arm-button'' will have to be pressed for a few seconds, however some conditions need to be met to ensure a safe start of the motor. &lt;br /&gt;
&lt;br /&gt;
# The ''dead-man cord'' needs to be applied to the bottom of the throttle body, should snap in place magnetically&lt;br /&gt;
# The ''throttle lever'' Should be in its neutral position, pointing straight up with a noticeable tactile bump&lt;br /&gt;
# The CAN bus need to be actively acknowledging packets, which means other devices need to be active on the bus&lt;br /&gt;
# No other error should have occurred inside the electronics&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If one of these conditions is not met, the throttle will beep the number of times indicated above. &lt;br /&gt;
&lt;br /&gt;
== Programming Throttle Position ==&lt;br /&gt;
The throttle position is read out by a magnet attached tot the ''throttle lever'', because the orientation of this magnet is not know in the firmware, this position can be programmed into the EEPROM. To enter programming mode hold down the arm button during power-on. A four beep descending tone should be played, and the LED should do a double blink in red continuously. To program the throttle push lever as far forward as possible and press the button, a single beep be heard. Repeat this twice with the lever in the center and finally with the lever all the way backwards. After three beeps the throttle is reprogrammed and normal operation is resumed. To summarize:  &lt;br /&gt;
&lt;br /&gt;
# Lever in the forward position  &lt;br /&gt;
# Lever in the center position &lt;br /&gt;
# Lever in de backward position &lt;br /&gt;
#  &lt;br /&gt;
&lt;br /&gt;
If no programming is desired leave the lever alone for 10 seconds and the lever will reboot into normal mode.&lt;br /&gt;
&lt;br /&gt;
== Setting the Control Mode over CAN ==&lt;br /&gt;
The Throttle controls the VESC motodriver at 40Hz messaging rate with the default CAN format implemented inside the VESC. [https://dongilc.gitbook.io/openrobot-inc/tutorials/control-with-can More info on the format.] The throttle supports the following modes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Control Mode !! Configuration Byte Value !! Unit !! Additional data required&lt;br /&gt;
|-&lt;br /&gt;
| Duty Cycle|| 0x00 || Percentage || None lever in the maximum forward position is 100%&lt;br /&gt;
|-&lt;br /&gt;
|Filtered Duty Cycle|| 0x01 || Percentage  || None lever in the maximum forward position is 100% &lt;br /&gt;
|-&lt;br /&gt;
|Current Control || 0x02 || 100mA  || Specify the max current for forward and backwards in two int16_t's&lt;br /&gt;
|-&lt;br /&gt;
|RPM Control || 0x03 || RPM  || Specify the rpm for forward and backwards in two int16_t's &lt;br /&gt;
|-&lt;br /&gt;
|Current Control Relative&lt;br /&gt;
|0x04&lt;br /&gt;
|Percentage&lt;br /&gt;
|None lever in the maximum forward position is 100%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These modes can be send to the throttle when the throttle is off. If the throttle is on the configuration will be ignored. A sound will play when a message is received. The message has to be send to the Throttle address 0x337, same as the reboot command. the format is as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message for Setting the control mode&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA || Control type || MSB int16_t  || LSB int16_t|| MSB int16_t  || LSB int16_t&lt;br /&gt;
|-&lt;br /&gt;
| Hardcoded command|| See Table Above || colspan=2 | Max value for lever completely forward || colspan=2 | Same but for backward (Positive for reverse)&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example command: ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line=&amp;quot;1&amp;quot; start=&amp;quot;69&amp;quot;&amp;gt;&lt;br /&gt;
cansend can2 337#AA0000000000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CAN Diagnostics messages ==&lt;br /&gt;
The throttle also send out messages to help debugging every 200 ms. It is send on address 0x337 and has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message for Diagnostic Purposes&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5 !! Byte 6 !! Byte 7&lt;br /&gt;
|-&lt;br /&gt;
| MSB int16_t  || LSB int16_t || MSB int16_t  || LSB int16_t || MSB int16_t  || LSB int16_t || uint8_t || Error status&lt;br /&gt;
|-&lt;br /&gt;
| colspan=2 | Filtered lever position, from +512 to -512 || colspan=2 | Raw position reported by the magnetic encoder || colspan=2 | Raw data from the deadmanswitch ADC || Gain that is required to readout the lever position || Enum of current error state. 0x00 is good&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If any of the error status bits are set, the throttle is set into IDLE mode and will shut off the motor. The following table shows what the bitfield represents:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Bit !! Enum Name !! Explanation&lt;br /&gt;
|-&lt;br /&gt;
| 0 to 2 || twiError || See next table for possible values&lt;br /&gt;
|-&lt;br /&gt;
| 3      || noLimitsLoaded || Reading of EEPROM for throttle limits failed&lt;br /&gt;
|-&lt;br /&gt;
| 4      || gainClipping || The Magnetic encoder detected no good magnetic field present&lt;br /&gt;
|-&lt;br /&gt;
| 5      || gainInvalid || The gain value read from the magnetic encoder is beyond the range specified in software&lt;br /&gt;
|-&lt;br /&gt;
| 6      || deadmanMissing || The hall sensor of the deadman-switch doesn't detect a strong enough magnet&lt;br /&gt;
|-&lt;br /&gt;
| 7      || impeadanceHigh || The impeadance of the deadman signal is too high, indicating a bad connection&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ TWI error states&lt;br /&gt;
|-&lt;br /&gt;
! Value !! Error name !! Error Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 ||	TWI_ERROR_NoError              || Indicates that the command completed successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||	TWI_ERROR_BusFault             || A TWI bus fault occurred while attempting to capture the bus. &lt;br /&gt;
|-&lt;br /&gt;
| 2 ||	TWI_ERROR_BusCaptureTimeout    || A timeout occurred whilst waiting for the bus to be ready. &lt;br /&gt;
|-&lt;br /&gt;
| 3 ||	TWI_ERROR_SlaveResponseTimeout || No ACK received at the nominated slave address within the timeout period.&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||	TWI_ERROR_SlaveNotReady        || Slave NAKed the TWI bus START condition. &lt;br /&gt;
|-&lt;br /&gt;
| 5 ||	TWI_ERROR_SlaveNAK             || Slave NAKed whilst attempting to send data to the device. &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=231</id>
		<title>Throttle</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=231"/>
		<updated>2025-05-17T06:44:53Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* Setting the Control Mode over CAN */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The throttle controls the motor and is operated by the pilot during sailing. It controls the duty cycle of the motor via the CAN bus using the standard VESC message format. &lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
[[File:Throttle Schematic.png|thumb|Throttle shown in the inactive (green led) neutral position]]&lt;br /&gt;
To use the throttle to control the motor the green illuminated ''arm-button'' will have to be pressed for a few seconds, however some conditions need to be met to ensure a safe start of the motor. &lt;br /&gt;
&lt;br /&gt;
# The ''dead-man cord'' needs to be applied to the bottom of the throttle body, should snap in place magnetically&lt;br /&gt;
# The ''throttle lever'' Should be in its neutral position, pointing straight up with a noticeable tactile bump&lt;br /&gt;
# The CAN bus need to be actively acknowledging packets, which means other devices need to be active on the bus&lt;br /&gt;
# No other error should have occurred inside the electronics&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If one of these conditions is not met, the throttle will beep the number of times indicated above. &lt;br /&gt;
&lt;br /&gt;
== Programming Throttle Position ==&lt;br /&gt;
The throttle position is read out by a magnet attached tot the ''throttle lever'', because the orientation of this magnet is not know in the firmware, this position can be programmed into the EEPROM. To enter programming mode hold down the arm button during power-on. A four beep descending tone should be played, and the LED should do a double blink in red continuously. To program the throttle push lever as far forward as possible and press the button, a single beep be heard. Repeat this twice with the lever in the center and finally with the lever all the way backwards. After three beeps the throttle is reprogrammed and normal operation is resumed. To summarize:  &lt;br /&gt;
&lt;br /&gt;
# Lever in the forward position  &lt;br /&gt;
# Lever in the center position &lt;br /&gt;
# Lever in de backward position &lt;br /&gt;
#  &lt;br /&gt;
&lt;br /&gt;
If no programming is desired leave the lever alone for 10 seconds and the lever will reboot into normal mode.&lt;br /&gt;
&lt;br /&gt;
== Setting the Control Mode over CAN ==&lt;br /&gt;
The Throttle controls the VESC motodriver at 10Hz messaging rate with the default CAN format implemented inside the VESC. [https://dongilc.gitbook.io/openrobot-inc/tutorials/control-with-can More info on the format.] The throttle supports the following modes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Control Mode !! Configuration Byte Value !! Unit !! Additional data required&lt;br /&gt;
|-&lt;br /&gt;
| Duty Cycle|| 0x00 || Percentage || None lever in the maximum forward position is 100%&lt;br /&gt;
|-&lt;br /&gt;
|Filtered Duty Cycle|| 0x01 || Percentage  || None lever in the maximum forward position is 100% &lt;br /&gt;
|-&lt;br /&gt;
|Current Control || 0x02 || 100mA  || Specify the max current for forward and backwards in two int16_t's&lt;br /&gt;
|-&lt;br /&gt;
|RPM Control || 0x03 || RPM  || Specify the rpm for forward and backwards in two int16_t's &lt;br /&gt;
|-&lt;br /&gt;
|Current Control Relative&lt;br /&gt;
|0x04&lt;br /&gt;
|Percentage&lt;br /&gt;
|None lever in the maximum forward position is 100%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These modes can be send to the throttle when the throttle is off. If the throttle is on the configuration will be ignored. A sound will play when a message is received. The message has to be send to the Throttle address 0x337, same as the reboot command. the format is as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message for Setting the control mode&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA || Control type || MSB int16_t  || LSB int16_t|| MSB int16_t  || LSB int16_t&lt;br /&gt;
|-&lt;br /&gt;
| Hardcoded command|| See Table Above || colspan=2 | Max value for lever completely forward || colspan=2 | Same but for backward (Positive for reverse)&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example command: ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line=&amp;quot;1&amp;quot; start=&amp;quot;69&amp;quot;&amp;gt;&lt;br /&gt;
cansend can2 337#AA0000000000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CAN Diagnostics messages ==&lt;br /&gt;
The throttle also send out messages to help debugging every 200 ms. It is send on address 0x337 and has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message for Diagnostic Purposes&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5 !! Byte 6 !! Byte 7&lt;br /&gt;
|-&lt;br /&gt;
| MSB int16_t  || LSB int16_t || MSB int16_t  || LSB int16_t || MSB int16_t  || LSB int16_t || uint8_t || Error status&lt;br /&gt;
|-&lt;br /&gt;
| colspan=2 | Filtered lever position, from +512 to -512 || colspan=2 | Raw position reported by the magnetic encoder || colspan=2 | Raw data from the deadmanswitch ADC || Gain that is required to readout the lever position || Enum of current error state. 0x00 is good&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If any of the error status bits are set, the throttle is set into IDLE mode and will shut off the motor. The following table shows what the bitfield represents:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Bit !! Enum Name !! Explanation&lt;br /&gt;
|-&lt;br /&gt;
| 0 to 2 || twiError || See next table for possible values&lt;br /&gt;
|-&lt;br /&gt;
| 3      || noLimitsLoaded || Reading of EEPROM for throttle limits failed&lt;br /&gt;
|-&lt;br /&gt;
| 4      || gainClipping || The Magnetic encoder detected no good magnetic field present&lt;br /&gt;
|-&lt;br /&gt;
| 5      || gainInvalid || The gain value read from the magnetic encoder is beyond the range specified in software&lt;br /&gt;
|-&lt;br /&gt;
| 6      || deadmanMissing || The hall sensor of the deadman-switch doesn't detect a strong enough magnet&lt;br /&gt;
|-&lt;br /&gt;
| 7      || impeadanceHigh || The impeadance of the deadman signal is too high, indicating a bad connection&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ TWI error states&lt;br /&gt;
|-&lt;br /&gt;
! Value !! Error name !! Error Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 ||	TWI_ERROR_NoError              || Indicates that the command completed successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||	TWI_ERROR_BusFault             || A TWI bus fault occurred while attempting to capture the bus. &lt;br /&gt;
|-&lt;br /&gt;
| 2 ||	TWI_ERROR_BusCaptureTimeout    || A timeout occurred whilst waiting for the bus to be ready. &lt;br /&gt;
|-&lt;br /&gt;
| 3 ||	TWI_ERROR_SlaveResponseTimeout || No ACK received at the nominated slave address within the timeout period.&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||	TWI_ERROR_SlaveNotReady        || Slave NAKed the TWI bus START condition. &lt;br /&gt;
|-&lt;br /&gt;
| 5 ||	TWI_ERROR_SlaveNAK             || Slave NAKed whilst attempting to send data to the device. &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=230</id>
		<title>Throttle</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=230"/>
		<updated>2025-05-17T06:26:07Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* Setting the Control Mode over CAN */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The throttle controls the motor and is operated by the pilot during sailing. It controls the duty cycle of the motor via the CAN bus using the standard VESC message format. &lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
[[File:Throttle Schematic.png|thumb|Throttle shown in the inactive (green led) neutral position]]&lt;br /&gt;
To use the throttle to control the motor the green illuminated ''arm-button'' will have to be pressed for a few seconds, however some conditions need to be met to ensure a safe start of the motor. &lt;br /&gt;
&lt;br /&gt;
# The ''dead-man cord'' needs to be applied to the bottom of the throttle body, should snap in place magnetically&lt;br /&gt;
# The ''throttle lever'' Should be in its neutral position, pointing straight up with a noticeable tactile bump&lt;br /&gt;
# The CAN bus need to be actively acknowledging packets, which means other devices need to be active on the bus&lt;br /&gt;
# No other error should have occurred inside the electronics&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If one of these conditions is not met, the throttle will beep the number of times indicated above. &lt;br /&gt;
&lt;br /&gt;
== Programming Throttle Position ==&lt;br /&gt;
The throttle position is read out by a magnet attached tot the ''throttle lever'', because the orientation of this magnet is not know in the firmware, this position can be programmed into the EEPROM. To enter programming mode hold down the arm button during power-on. A four beep descending tone should be played, and the LED should do a double blink in red continuously. To program the throttle push lever as far forward as possible and press the button, a single beep be heard. Repeat this twice with the lever in the center and finally with the lever all the way backwards. After three beeps the throttle is reprogrammed and normal operation is resumed. To summarize:  &lt;br /&gt;
&lt;br /&gt;
# Lever in the forward position  &lt;br /&gt;
# Lever in the center position &lt;br /&gt;
# Lever in de backward position &lt;br /&gt;
#  &lt;br /&gt;
&lt;br /&gt;
If no programming is desired leave the lever alone for 10 seconds and the lever will reboot into normal mode.&lt;br /&gt;
&lt;br /&gt;
== Setting the Control Mode over CAN ==&lt;br /&gt;
The Throttle controls the VESC motodriver at 10Hz messaging rate with the default CAN format implemented inside the VESC. [https://dongilc.gitbook.io/openrobot-inc/tutorials/control-with-can More info on the format.] The throttle supports four modes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Control Mode !! Configuration Byte Value !! Unit !! Additional data required&lt;br /&gt;
|-&lt;br /&gt;
| Duty Cycle|| 0x00 || Percentage || None lever in the maximum forward position is 100%&lt;br /&gt;
|-&lt;br /&gt;
|Filtered Duty Cycle|| 0x01 || Percentage  || None lever in the maximum forward position is 100% &lt;br /&gt;
|-&lt;br /&gt;
|Current Control || 0x02 || 100mA  || Specify the max current for forward and backwards in two int16_t's&lt;br /&gt;
|-&lt;br /&gt;
|RPM Control || 0x03 || RPM  || Specify the rpm for forward and backwards in two int16_t's &lt;br /&gt;
|-&lt;br /&gt;
|Current Control Relative&lt;br /&gt;
|0x04&lt;br /&gt;
|Percentage&lt;br /&gt;
|None lever in the maximum forward position is 100%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These modes can be send to the throttle when the throttle is off. If the throttle is on the configuration will be ignored. A sound will play when a message is received. The message has to be send to the Throttle address 0x337, same as the reboot command. the format is as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message for Setting the control mode&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA || Control type || MSB int16_t  || LSB int16_t|| MSB int16_t  || LSB int16_t&lt;br /&gt;
|-&lt;br /&gt;
| Hardcoded command|| See Table Above || colspan=2 | Max value for lever completely forward || colspan=2 | Same but for backward (Positive for reverse)&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example command: ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line=&amp;quot;1&amp;quot; start=&amp;quot;69&amp;quot;&amp;gt;&lt;br /&gt;
cansend can2 337#AA0000000000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CAN Diagnostics messages ==&lt;br /&gt;
The throttle also send out messages to help debugging every 200 ms. It is send on address 0x337 and has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message for Diagnostic Purposes&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5 !! Byte 6 !! Byte 7&lt;br /&gt;
|-&lt;br /&gt;
| MSB int16_t  || LSB int16_t || MSB int16_t  || LSB int16_t || MSB int16_t  || LSB int16_t || uint8_t || Error status&lt;br /&gt;
|-&lt;br /&gt;
| colspan=2 | Filtered lever position, from +512 to -512 || colspan=2 | Raw position reported by the magnetic encoder || colspan=2 | Raw data from the deadmanswitch ADC || Gain that is required to readout the lever position || Enum of current error state. 0x00 is good&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If any of the error status bits are set, the throttle is set into IDLE mode and will shut off the motor. The following table shows what the bitfield represents:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Bit !! Enum Name !! Explanation&lt;br /&gt;
|-&lt;br /&gt;
| 0 to 2 || twiError || See next table for possible values&lt;br /&gt;
|-&lt;br /&gt;
| 3      || noLimitsLoaded || Reading of EEPROM for throttle limits failed&lt;br /&gt;
|-&lt;br /&gt;
| 4      || gainClipping || The Magnetic encoder detected no good magnetic field present&lt;br /&gt;
|-&lt;br /&gt;
| 5      || gainInvalid || The gain value read from the magnetic encoder is beyond the range specified in software&lt;br /&gt;
|-&lt;br /&gt;
| 6      || deadmanMissing || The hall sensor of the deadman-switch doesn't detect a strong enough magnet&lt;br /&gt;
|-&lt;br /&gt;
| 7      || impeadanceHigh || The impeadance of the deadman signal is too high, indicating a bad connection&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ TWI error states&lt;br /&gt;
|-&lt;br /&gt;
! Value !! Error name !! Error Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 ||	TWI_ERROR_NoError              || Indicates that the command completed successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||	TWI_ERROR_BusFault             || A TWI bus fault occurred while attempting to capture the bus. &lt;br /&gt;
|-&lt;br /&gt;
| 2 ||	TWI_ERROR_BusCaptureTimeout    || A timeout occurred whilst waiting for the bus to be ready. &lt;br /&gt;
|-&lt;br /&gt;
| 3 ||	TWI_ERROR_SlaveResponseTimeout || No ACK received at the nominated slave address within the timeout period.&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||	TWI_ERROR_SlaveNotReady        || Slave NAKed the TWI bus START condition. &lt;br /&gt;
|-&lt;br /&gt;
| 5 ||	TWI_ERROR_SlaveNAK             || Slave NAKed whilst attempting to send data to the device. &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Individual_Phases&amp;diff=227</id>
		<title>Individual Phases</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Individual_Phases&amp;diff=227"/>
		<updated>2024-11-13T13:20:22Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: Created page with &amp;quot;WIP&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;WIP&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Rudder&amp;diff=226</id>
		<title>Rudder</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Rudder&amp;diff=226"/>
		<updated>2024-11-02T09:50:34Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The motor currently in use in the rudder is the Lehner 30100/12 with a NTC Temp. Sensor (B 25/100 3988 ±1%) installed.&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Rudder&amp;diff=225</id>
		<title>Rudder</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Rudder&amp;diff=225"/>
		<updated>2024-11-02T09:48:59Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The motor currently in use in the rudder is the 30100/12 with a NTC Temp. Sensor (B 25/100 3988 ±1%) installed.&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Rudder&amp;diff=224</id>
		<title>Rudder</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Rudder&amp;diff=224"/>
		<updated>2024-11-02T09:45:58Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: Created page with &amp;quot;The motor currently in use in the rudder is the 30100/14 with a NTC Temp. Sensor (B 25/100 3988 ±1%) installed.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The motor currently in use in the rudder is the 30100/14 with a NTC Temp. Sensor (B 25/100 3988 ±1%) installed.&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Autopilot&amp;diff=223</id>
		<title>Autopilot</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Autopilot&amp;diff=223"/>
		<updated>2024-10-21T20:09:12Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Platform ==&lt;br /&gt;
Ease of development dictated the choice to run the control loop on existing hard- and software. which was chosen to be Ardupilot running on a [https://docs.cubepilot.org/user-guides/autopilot/the-cube-module-overview orange cube].&lt;br /&gt;
[[File:Ardupilot.jpg|thumb|Ardupilot PCB with the orange cube mounted.]]&lt;br /&gt;
To make use for our application a PCB has been designed to integrate into the hydrofoil design. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To connect to the ardupilot on the cube for tweaking settings and tuning control loops, [https://ardupilot.org/planner/docs/mission-planner-overview.html Mission Planner] will be used. The following section have tweaked settings found in Mission Planner.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
The cube is a plug-and-play unit and therefore does not need setup changes in the underlying ardupilot software. Only necessary settings should be tweaked.&lt;br /&gt;
&lt;br /&gt;
Apart from the settings, tuning needs to be done in Mission Planner, this can only be done with the solar boat in the water and therefore no values are known for now.&lt;br /&gt;
&lt;br /&gt;
The ardupilot PCB supports three servo motors, two front and one back motor. It has two isolated power supplies for the servo motors. Support for CAN and the cube is powered by the 24v input from the CAN connection.&lt;br /&gt;
&lt;br /&gt;
It has its own GPS antenna and four UART serial ports, where Serial1 is used for the MAVLINK connect to Mission Planner that is running on a laptop. Two of these serial ports will be used to implement the height sensors that will be mounted on the boat for measuring the height of the water. This ensures that the system correctly responds to waves where the boat can 'surf' over.&lt;br /&gt;
&lt;br /&gt;
For steering on foils an extra MCU is added onto the board namely: ATSAMD20E18A. This MCU can receive data from the rudder that gives the steering position and sends it through to the cube.&lt;br /&gt;
&lt;br /&gt;
== Height Sensors ==&lt;br /&gt;
Currently testing ultrasonic height sensors, the RS485 version of the DYP-A02YY4W-V2.0. &lt;br /&gt;
&lt;br /&gt;
== Ardupilot settings ==&lt;br /&gt;
To use the ardupilot as the foil control unit, some settings need to be changed since they do not apply to us or should be disabled. These settings are given below with a small explanation why it has been configured as is.&lt;br /&gt;
&lt;br /&gt;
The settings below are the changed settings used by the ardupilot. There are more ports available on the ardupilot, whenever more are used or are changed the table will be updated.&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
Configuration of ardupilot&lt;br /&gt;
!Setting&lt;br /&gt;
!Value&lt;br /&gt;
!Description&lt;br /&gt;
!Reason&lt;br /&gt;
|-&lt;br /&gt;
|INS_GYR_CAL&lt;br /&gt;
|0&lt;br /&gt;
|Controls the automatic gyro calibration.&lt;br /&gt;
|Gyro calibration requires that the unit should be held as still as possible.&lt;br /&gt;
|-&lt;br /&gt;
|SERVO1_FUNCTION&lt;br /&gt;
|78&lt;br /&gt;
|ElevonRight&lt;br /&gt;
|Controls the right foil assembly.&lt;br /&gt;
|-&lt;br /&gt;
|SERVO2_FUNCTION&lt;br /&gt;
|77&lt;br /&gt;
|ElevonLeft&lt;br /&gt;
|Controls the left foil assembly.&lt;br /&gt;
|-&lt;br /&gt;
|INITIAL_MODE&lt;br /&gt;
|5&lt;br /&gt;
|FBWA&lt;br /&gt;
|Fly By Wire A this is a fly mode for the control unit. More can be found [https://ardupilot.org/plane/docs/fbwa-mode.html here].&lt;br /&gt;
|-&lt;br /&gt;
|GPS_TYPE2&lt;br /&gt;
|5&lt;br /&gt;
|NMEA&lt;br /&gt;
|This sets the GPS data that is sent onto the serial data port.&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL1_PROTOCOL&lt;br /&gt;
|2&lt;br /&gt;
|MAVLINK2&lt;br /&gt;
|Controls what protocol to use on the serial port&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL1_BAUD&lt;br /&gt;
|57&lt;br /&gt;
|57600&lt;br /&gt;
|Specifies the baudrate of the serial port.&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL4_PROTOCOL&lt;br /&gt;
|5&lt;br /&gt;
|GPS&lt;br /&gt;
|Controls what protocol to use on the serial port&lt;br /&gt;
|-&lt;br /&gt;
|SERIAL4_BAUD&lt;br /&gt;
|9&lt;br /&gt;
|9600&lt;br /&gt;
|Specifies the baudrate of the serial port.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Future plans ==&lt;br /&gt;
As of now: 21-03-2023, FBWA mode is used for controlling the front two foil assembly. It would probably be beneficial whenever the whole system is finished to move towards the FBWB mode.&lt;br /&gt;
&lt;br /&gt;
This mode supports &amp;quot;Automatic Altitude Holding&amp;quot;, that makes sure that the same level of altitude is automatically kept. Further testing is needed for determining the control loops and their coefficients.&lt;br /&gt;
&lt;br /&gt;
Implementing the different sensors into ardupilot and using that data to respond to the environment. These sensors are at least the height sensors and the rudder sensor for the steering angle.&lt;br /&gt;
&lt;br /&gt;
== Relevant links for configuring Ardupilot ==&lt;br /&gt;
https://ardupilot.org/copter/docs/common-gcs-only-operation.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/common-rangefinder-landingpage.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/setting-up-for-tuning.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/terrain-following-manual-modes.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/common-sensor-offset-compensation.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/crash_check.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/flight-modes.html --FBW-A mode seems best fit for front only, FBW-B for finalized system&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/plane/docs/fbwb-mode.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/copter/docs/stabilize-mode.html&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/plane/docs/fixed-wing-faq.html --Disable Gyro calibration on start-up&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/rover/docs/sonar-sensors.html --Two sonar sensors&lt;br /&gt;
&lt;br /&gt;
https://ardupilot.org/dev/docs/plane-architecture.html --Plane architecture and files&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=216</id>
		<title>Throttle</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=216"/>
		<updated>2024-04-23T18:34:54Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* Programming Throttle Position */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The throttle controls the motor and is operated by the pilot during sailing. It controls the duty cycle of the motor via the CAN bus using the standard VESC message format. &lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
[[File:Throttle Schematic.png|thumb|Throttle shown in the inactive (green led) neutral position]]&lt;br /&gt;
To use the throttle to control the motor the green illuminated ''arm-button'' will have to be pressed for a few seconds, however some conditions need to be met to ensure a safe start of the motor. &lt;br /&gt;
&lt;br /&gt;
# The ''dead-man cord'' needs to be applied to the bottom of the throttle body, should snap in place magnetically&lt;br /&gt;
# The ''throttle lever'' Should be in its neutral position, pointing straight up with a noticeable tactile bump&lt;br /&gt;
# The CAN bus need to be actively acknowledging packets, which means other devices need to be active on the bus&lt;br /&gt;
# No other error should have occurred inside the electronics&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If one of these conditions is not met, the throttle will beep the number of times indicated above. &lt;br /&gt;
&lt;br /&gt;
== Programming Throttle Position ==&lt;br /&gt;
The throttle position is read out by a magnet attached tot the ''throttle lever'', because the orientation of this magnet is not know in the firmware, this position can be programmed into the EEPROM. To enter programming mode hold down the arm button during power-on. A four beep descending tone should be played, and the LED should do a double blink in red continuously. To program the throttle push lever as far forward as possible and press the button, a single beep be heard. Repeat this twice with the lever in the center and finally with the lever all the way backwards. After three beeps the throttle is reprogrammed and normal operation is resumed. To summarize:  &lt;br /&gt;
&lt;br /&gt;
# Lever in the forward position  &lt;br /&gt;
# Lever in the center position &lt;br /&gt;
# Lever in de backward position &lt;br /&gt;
#  &lt;br /&gt;
&lt;br /&gt;
If no programming is desired leave the lever alone for 10 seconds and the lever will reboot into normal mode.&lt;br /&gt;
&lt;br /&gt;
== Setting the Control Mode over CAN ==&lt;br /&gt;
The Throttle controls the VESC motodriver at 10Hz messaging rate with the default CAN format implemented inside the VESC. [https://dongilc.gitbook.io/openrobot-inc/tutorials/control-with-can More info on the format.] The throttle supports four modes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Control Mode !! Configuration Byte Value !! Unit !! Additional data required&lt;br /&gt;
|-&lt;br /&gt;
| Duty Cycle|| 0x01 || Percentage || None lever in the maximum forward position is 100%&lt;br /&gt;
|-&lt;br /&gt;
|Filtered Duty Cycle|| 0x02 || Percentage  || None lever in the maximum forward position is 100% &lt;br /&gt;
|-&lt;br /&gt;
|Current Control || 0x03 || 100mA  || Specify the max current for forward and backwards in two int16_t's&lt;br /&gt;
|-&lt;br /&gt;
|RPM Control || 0x04 || RPM  || Specify the rpm for forward and backwards in two int16_t's &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These modes can be send to the throttle when the throttle is off. If the throttle is on the configuration will be ignored. A sound will play when a message is received. The message has to be send to the Throttle address 0x1337, same as the reboot command. the format is as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message for Setting the control mode&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA || Control type || MSB int16_t  || LSB int16_t|| MSB int16_t  || LSB int16_t&lt;br /&gt;
|-&lt;br /&gt;
| Hardcoded command|| See Table Above || colspan=2 | Max value for lever completely forward || colspan=2 | Same but for backward (Positive for reverse)&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CAN Diagnostics messages ==&lt;br /&gt;
The throttle also send out messages to help debugging every 200 ms. It is send on address 0x337 and has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message for Diagnostic Purposes&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5 !! Byte 6 !! Byte 7&lt;br /&gt;
|-&lt;br /&gt;
| MSB int16_t  || LSB int16_t || MSB int16_t  || LSB int16_t || MSB int16_t  || LSB int16_t || uint8_t || Error status&lt;br /&gt;
|-&lt;br /&gt;
| colspan=2 | Filtered lever position, from +512 to -512 || colspan=2 | Raw position reported by the magnetic encoder || colspan=2 | Raw data from the deadmanswitch ADC || Gain that is required to readout the lever position || Enum of current error state. 0x00 is good&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If any of the error status bits are set, the throttle is set into IDLE mode and will shut off the motor. The following table shows what the bitfield represents:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Bit !! Enum Name !! Explanation&lt;br /&gt;
|-&lt;br /&gt;
| 0 to 2 || twiError || See next table for possible values&lt;br /&gt;
|-&lt;br /&gt;
| 3      || noLimitsLoaded || Reading of EEPROM for throttle limits failed&lt;br /&gt;
|-&lt;br /&gt;
| 4      || gainClipping || The Magnetic encoder detected no good magnetic field present&lt;br /&gt;
|-&lt;br /&gt;
| 5      || gainInvalid || The gain value read from the magnetic encoder is beyond the range specified in software&lt;br /&gt;
|-&lt;br /&gt;
| 6      || deadmanMissing || The hall sensor of the deadman-switch doesn't detect a strong enough magnet&lt;br /&gt;
|-&lt;br /&gt;
| 7      || impeadanceHigh || The impeadance of the deadman signal is too high, indicating a bad connection&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ TWI error states&lt;br /&gt;
|-&lt;br /&gt;
! Value !! Error name !! Error Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 ||	TWI_ERROR_NoError              || Indicates that the command completed successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||	TWI_ERROR_BusFault             || A TWI bus fault occurred while attempting to capture the bus. &lt;br /&gt;
|-&lt;br /&gt;
| 2 ||	TWI_ERROR_BusCaptureTimeout    || A timeout occurred whilst waiting for the bus to be ready. &lt;br /&gt;
|-&lt;br /&gt;
| 3 ||	TWI_ERROR_SlaveResponseTimeout || No ACK received at the nominated slave address within the timeout period.&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||	TWI_ERROR_SlaveNotReady        || Slave NAKed the TWI bus START condition. &lt;br /&gt;
|-&lt;br /&gt;
| 5 ||	TWI_ERROR_SlaveNAK             || Slave NAKed whilst attempting to send data to the device. &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=214</id>
		<title>Throttle</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=214"/>
		<updated>2024-03-23T11:29:14Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* CAN Diagnostics messages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The throttle controls the motor and is operated by the pilot during sailing. It controls the duty cycle of the motor via the CAN bus using the standard VESC message format. &lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
[[File:Throttle Schematic.png|thumb|Throttle shown in the inactive (green led) neutral position]]&lt;br /&gt;
To use the throttle to control the motor the green illuminated ''arm-button'' will have to be pressed for a few seconds, however some conditions need to be met to ensure a safe start of the motor. &lt;br /&gt;
&lt;br /&gt;
# The ''dead-man cord'' needs to be applied to the bottom of the throttle body, should snap in place magnetically&lt;br /&gt;
# The ''throttle lever'' Should be in its neutral position, pointing straight up with a noticeable tactile bump&lt;br /&gt;
# The CAN bus need to be actively acknowledging packets, which means other devices need to be active on the bus&lt;br /&gt;
# No other error should have occurred inside the electronics&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If one of these conditions is not met, the throttle will beep the number of times indicated above. &lt;br /&gt;
&lt;br /&gt;
== Programming Throttle Position ==&lt;br /&gt;
The throttle position is read out by a magnet attached tot the ''throttle lever'', because the orientation of this magnet is not know in the firmware, this position can be programmed into the EEPROM. To enter programming mode hold down the arm button during power-on. A four beep descending tone should be played, and the LED should do a double blink in red continuously. To program the throttle push lever as far forward as possible and press the button, a single beep be heard. Repeat this twice with the lever in the center and finally with the lever all the way backwards. After three beeps the throttle is reprogrammed and normal operation is resumed. &lt;br /&gt;
&lt;br /&gt;
If no programming is desired leave the lever alone for 10 seconds and the lever will reboot into normal mode.&lt;br /&gt;
&lt;br /&gt;
== Setting the Control Mode over CAN ==&lt;br /&gt;
The Throttle controls the VESC motodriver at 10Hz messaging rate with the default CAN format implemented inside the VESC. [https://dongilc.gitbook.io/openrobot-inc/tutorials/control-with-can More info on the format.] The throttle supports four modes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Control Mode !! Configuration Byte Value !! Unit !! Additional data required&lt;br /&gt;
|-&lt;br /&gt;
| Duty Cycle|| 0x01 || Percentage || None lever in the maximum forward position is 100%&lt;br /&gt;
|-&lt;br /&gt;
|Filtered Duty Cycle|| 0x02 || Percentage  || None lever in the maximum forward position is 100% &lt;br /&gt;
|-&lt;br /&gt;
|Current Control || 0x03 || 100mA  || Specify the max current for forward and backwards in two int16_t's&lt;br /&gt;
|-&lt;br /&gt;
|RPM Control || 0x04 || RPM  || Specify the rpm for forward and backwards in two int16_t's &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These modes can be send to the throttle when the throttle is off. If the throttle is on the configuration will be ignored. A sound will play when a message is received. The message has to be send to the Throttle address 0x1337, same as the reboot command. the format is as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message for Setting the control mode&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA || Control type || MSB int16_t  || LSB int16_t|| MSB int16_t  || LSB int16_t&lt;br /&gt;
|-&lt;br /&gt;
| Hardcoded command|| See Table Above || colspan=2 | Max value for lever completely forward || colspan=2 | Same but for backward (Positive for reverse)&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CAN Diagnostics messages ==&lt;br /&gt;
The throttle also send out messages to help debugging every 200 ms. It is send on address 0x337 and has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message for Diagnostic Purposes&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5 !! Byte 6 !! Byte 7&lt;br /&gt;
|-&lt;br /&gt;
| MSB int16_t  || LSB int16_t || MSB int16_t  || LSB int16_t || MSB int16_t  || LSB int16_t || uint8_t || Error status&lt;br /&gt;
|-&lt;br /&gt;
| colspan=2 | Filtered lever position, from +512 to -512 || colspan=2 | Raw position reported by the magnetic encoder || colspan=2 | Raw data from the deadmanswitch ADC || Gain that is required to readout the lever position || Enum of current error state. 0x00 is good&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If any of the error status bits are set, the throttle is set into IDLE mode and will shut off the motor. The following table shows what the bitfield represents:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Bit !! Enum Name !! Explanation&lt;br /&gt;
|-&lt;br /&gt;
| 0 to 2 || twiError || See next table for possible values&lt;br /&gt;
|-&lt;br /&gt;
| 3      || noLimitsLoaded || Reading of EEPROM for throttle limits failed&lt;br /&gt;
|-&lt;br /&gt;
| 4      || gainClipping || The Magnetic encoder detected no good magnetic field present&lt;br /&gt;
|-&lt;br /&gt;
| 5      || gainInvalid || The gain value read from the magnetic encoder is beyond the range specified in software&lt;br /&gt;
|-&lt;br /&gt;
| 6      || deadmanMissing || The hall sensor of the deadman-switch doesn't detect a strong enough magnet&lt;br /&gt;
|-&lt;br /&gt;
| 7      || impeadanceHigh || The impeadance of the deadman signal is too high, indicating a bad connection&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ TWI error states&lt;br /&gt;
|-&lt;br /&gt;
! Value !! Error name !! Error Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 ||	TWI_ERROR_NoError              || Indicates that the command completed successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||	TWI_ERROR_BusFault             || A TWI bus fault occurred while attempting to capture the bus. &lt;br /&gt;
|-&lt;br /&gt;
| 2 ||	TWI_ERROR_BusCaptureTimeout    || A timeout occurred whilst waiting for the bus to be ready. &lt;br /&gt;
|-&lt;br /&gt;
| 3 ||	TWI_ERROR_SlaveResponseTimeout || No ACK received at the nominated slave address within the timeout period.&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||	TWI_ERROR_SlaveNotReady        || Slave NAKed the TWI bus START condition. &lt;br /&gt;
|-&lt;br /&gt;
| 5 ||	TWI_ERROR_SlaveNAK             || Slave NAKed whilst attempting to send data to the device. &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=213</id>
		<title>Throttle</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=213"/>
		<updated>2024-03-20T09:30:00Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The throttle controls the motor and is operated by the pilot during sailing. It controls the duty cycle of the motor via the CAN bus using the standard VESC message format. &lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
[[File:Throttle Schematic.png|thumb|Throttle shown in the inactive (green led) neutral position]]&lt;br /&gt;
To use the throttle to control the motor the green illuminated ''arm-button'' will have to be pressed for a few seconds, however some conditions need to be met to ensure a safe start of the motor. &lt;br /&gt;
&lt;br /&gt;
# The ''dead-man cord'' needs to be applied to the bottom of the throttle body, should snap in place magnetically&lt;br /&gt;
# The ''throttle lever'' Should be in its neutral position, pointing straight up with a noticeable tactile bump&lt;br /&gt;
# The CAN bus need to be actively acknowledging packets, which means other devices need to be active on the bus&lt;br /&gt;
# No other error should have occurred inside the electronics&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If one of these conditions is not met, the throttle will beep the number of times indicated above. &lt;br /&gt;
&lt;br /&gt;
== Programming Throttle Position ==&lt;br /&gt;
The throttle position is read out by a magnet attached tot the ''throttle lever'', because the orientation of this magnet is not know in the firmware, this position can be programmed into the EEPROM. To enter programming mode hold down the arm button during power-on. A four beep descending tone should be played, and the LED should do a double blink in red continuously. To program the throttle push lever as far forward as possible and press the button, a single beep be heard. Repeat this twice with the lever in the center and finally with the lever all the way backwards. After three beeps the throttle is reprogrammed and normal operation is resumed. &lt;br /&gt;
&lt;br /&gt;
If no programming is desired leave the lever alone for 10 seconds and the lever will reboot into normal mode.&lt;br /&gt;
&lt;br /&gt;
== Setting the Control Mode over CAN ==&lt;br /&gt;
The Throttle controls the VESC motodriver at 10Hz messaging rate with the default CAN format implemented inside the VESC. [https://dongilc.gitbook.io/openrobot-inc/tutorials/control-with-can More info on the format.] The throttle supports four modes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Control Mode !! Configuration Byte Value !! Unit !! Additional data required&lt;br /&gt;
|-&lt;br /&gt;
| Duty Cycle|| 0x01 || Percentage || None lever in the maximum forward position is 100%&lt;br /&gt;
|-&lt;br /&gt;
|Filtered Duty Cycle|| 0x02 || Percentage  || None lever in the maximum forward position is 100% &lt;br /&gt;
|-&lt;br /&gt;
|Current Control || 0x03 || 100mA  || Specify the max current for forward and backwards in two int16_t's&lt;br /&gt;
|-&lt;br /&gt;
|RPM Control || 0x04 || RPM  || Specify the rpm for forward and backwards in two int16_t's &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These modes can be send to the throttle when the throttle is off. If the throttle is on the configuration will be ignored. A sound will play when a message is received. The message has to be send to the Throttle address 0x1337, same as the reboot command. the format is as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message for Setting the control mode&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA || Control type || MSB int16_t  || LSB int16_t|| MSB int16_t  || LSB int16_t&lt;br /&gt;
|-&lt;br /&gt;
| Hardcoded command|| See Table Above || colspan=2 | Max value for lever completely forward || colspan=2 | Same but for backward (Positive for reverse)&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CAN Diagnostics messages ==&lt;br /&gt;
The throttle also send out messages to help debugging every 200 ms. It is send on address 0x1337 and has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message for Diagnostic Purposes&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5 !! Byte 6 !! Byte 7&lt;br /&gt;
|-&lt;br /&gt;
| MSB int16_t  || LSB int16_t || MSB int16_t  || LSB int16_t || MSB int16_t  || LSB int16_t || uint8_t || Error status&lt;br /&gt;
|-&lt;br /&gt;
| colspan=2 | Filtered lever position, from +512 to -512 || colspan=2 | Raw position reported by the magnetic encoder || colspan=2 | Raw data from the deadmanswitch ADC || Gain that is required to readout the lever position || Enum of current error state. 0x00 is good&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If any of the error status bits are set, the throttle is set into IDLE mode and will shut off the motor. The following table shows what the bitfield represents:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Bit !! Enum Name !! Explanation&lt;br /&gt;
|-&lt;br /&gt;
| 0 to 2 || twiError || See next table for possible values&lt;br /&gt;
|-&lt;br /&gt;
| 3      || noLimitsLoaded || Reading of EEPROM for throttle limits failed&lt;br /&gt;
|-&lt;br /&gt;
| 4      || gainClipping || The Magnetic encoder detected no good magnetic field present&lt;br /&gt;
|-&lt;br /&gt;
| 5      || gainInvalid || The gain value read from the magnetic encoder is beyond the range specified in software&lt;br /&gt;
|-&lt;br /&gt;
| 6      || deadmanMissing || The hall sensor of the deadman-switch doesn't detect a strong enough magnet&lt;br /&gt;
|-&lt;br /&gt;
| 7      || impeadanceHigh || The impeadance of the deadman signal is too high, indicating a bad connection&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ TWI error states&lt;br /&gt;
|-&lt;br /&gt;
! Value !! Error name !! Error Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 ||	TWI_ERROR_NoError              || Indicates that the command completed successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||	TWI_ERROR_BusFault             || A TWI bus fault occurred while attempting to capture the bus. &lt;br /&gt;
|-&lt;br /&gt;
| 2 ||	TWI_ERROR_BusCaptureTimeout    || A timeout occurred whilst waiting for the bus to be ready. &lt;br /&gt;
|-&lt;br /&gt;
| 3 ||	TWI_ERROR_SlaveResponseTimeout || No ACK received at the nominated slave address within the timeout period.&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||	TWI_ERROR_SlaveNotReady        || Slave NAKed the TWI bus START condition. &lt;br /&gt;
|-&lt;br /&gt;
| 5 ||	TWI_ERROR_SlaveNAK             || Slave NAKed whilst attempting to send data to the device. &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=212</id>
		<title>Throttle</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=212"/>
		<updated>2024-03-20T08:48:33Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* CAN Diagnostics messages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The throttle controls the motor and is operated by the pilot during sailing. It controls the duty cycle of the motor via the CAN bus using the standard VESC message format. &lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
[[File:Throttle Schematic.png|thumb|Throttle shown in the inactive (green led) neutral position]]&lt;br /&gt;
To use the throttle to control the motor the green illuminated ''arm-button'' will have to be pressed for a few seconds, however some conditions need to be met to ensure a safe start of the motor. &lt;br /&gt;
&lt;br /&gt;
# The ''dead-man cord'' needs to be applied to the bottom of the throttle body, should snap in place magnetically&lt;br /&gt;
# The ''throttle lever'' Should be in its neutral position, pointing straight up with a noticeable tactile bump&lt;br /&gt;
# The CAN bus need to be actively acknowledging packets, which means other devices need to be active on the bus&lt;br /&gt;
# No other error should have occurred inside the electronics&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If one of these conditions is not met, the throttle will beep the number of times indicated above. &lt;br /&gt;
&lt;br /&gt;
== Programming Throttle Position ==&lt;br /&gt;
The throttle position is read out by a magnet attached tot the ''throttle lever'', because the orientation of this magnet is not know in the firmware, this position can be programmed into the EEPROM. To enter programming mode hold down the arm button during power-on. A four beep descending tone should be played, and the LED should do a double blink in red continuously. To program the throttle push lever as far forward as possible and press the button, a single beep be heard. Repeat this twice with the lever in the center and finally with the lever all the way backwards. After three beeps the throttle is reprogrammed and normal operation is resumed. &lt;br /&gt;
&lt;br /&gt;
If no programming is desired leave the lever alone for 10 seconds and the lever will reboot into normal mode.&lt;br /&gt;
&lt;br /&gt;
== Setting the Control Mode over CAN ==&lt;br /&gt;
The Throttle controls the VESC motodriver at 10Hz messaging rate with the default CAN format implemented inside the VESC. [https://dongilc.gitbook.io/openrobot-inc/tutorials/control-with-can More info on the format.] The throttle supports four modes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Control Mode !! Configuration Byte Value !! Unit !! Additional data required&lt;br /&gt;
|-&lt;br /&gt;
| Duty Cycle|| 0x01 || Percentage || None lever in the maximum forward position is 100%&lt;br /&gt;
|-&lt;br /&gt;
|Filtered Duty Cycle|| 0x02 || Percentage  || None lever in the maximum forward position is 100% &lt;br /&gt;
|-&lt;br /&gt;
|Current Control || 0x03 || 100mA  || Specify the max current for forward and backwards in two int16_t's&lt;br /&gt;
|-&lt;br /&gt;
|RPM Control || 0x04 || RPM  || Specify the rpm for forward and backwards in two int16_t's &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These modes can be send to the throttle when the throttle is off. If the throttle is on the configuration will be ignored. A sound will play when a message is received. The message has to be send to the Throttle address 0x1337, same as the reboot command. the format is as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message for Setting the control mode&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA || Control type || MSB int16_t  || LSB int16_t|| MSB int16_t  || LSB int16_t&lt;br /&gt;
|-&lt;br /&gt;
| Hardcoded command|| See Table Above || colspan=2 | Max value for lever completely forward || colspan=2 | Same but for backward (Positive for reverse)&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CAN Diagnostics messages ==&lt;br /&gt;
The throttle also send out messages to help debugging every 200 ms. It is send on address 0x1337 and has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5 !! Byte 6 !! Byte 7&lt;br /&gt;
|-&lt;br /&gt;
| MSB int16_t  || LSB int16_t || MSB int16_t  || LSB int16_t || MSB int16_t  || LSB int16_t || uint8_t || Error status&lt;br /&gt;
|-&lt;br /&gt;
| colspan=2 | Filtered lever position, from +512 to -512 || colspan=2 | Raw position reported by the magnetic encoder || colspan=2 | Raw data from the deadmanswitch ADC || Gain that is required to readout the lever position || Enum of current error state. 0x00 is good&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=211</id>
		<title>Throttle</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=211"/>
		<updated>2024-03-20T08:43:54Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The throttle controls the motor and is operated by the pilot during sailing. It controls the duty cycle of the motor via the CAN bus using the standard VESC message format. &lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
[[File:Throttle Schematic.png|thumb|Throttle shown in the inactive (green led) neutral position]]&lt;br /&gt;
To use the throttle to control the motor the green illuminated ''arm-button'' will have to be pressed for a few seconds, however some conditions need to be met to ensure a safe start of the motor. &lt;br /&gt;
&lt;br /&gt;
# The ''dead-man cord'' needs to be applied to the bottom of the throttle body, should snap in place magnetically&lt;br /&gt;
# The ''throttle lever'' Should be in its neutral position, pointing straight up with a noticeable tactile bump&lt;br /&gt;
# The CAN bus need to be actively acknowledging packets, which means other devices need to be active on the bus&lt;br /&gt;
# No other error should have occurred inside the electronics&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If one of these conditions is not met, the throttle will beep the number of times indicated above. &lt;br /&gt;
&lt;br /&gt;
== Programming Throttle Position ==&lt;br /&gt;
The throttle position is read out by a magnet attached tot the ''throttle lever'', because the orientation of this magnet is not know in the firmware, this position can be programmed into the EEPROM. To enter programming mode hold down the arm button during power-on. A four beep descending tone should be played, and the LED should do a double blink in red continuously. To program the throttle push lever as far forward as possible and press the button, a single beep be heard. Repeat this twice with the lever in the center and finally with the lever all the way backwards. After three beeps the throttle is reprogrammed and normal operation is resumed. &lt;br /&gt;
&lt;br /&gt;
If no programming is desired leave the lever alone for 10 seconds and the lever will reboot into normal mode.&lt;br /&gt;
&lt;br /&gt;
== Setting the Control Mode over CAN ==&lt;br /&gt;
The Throttle controls the VESC motodriver at 10Hz messaging rate with the default CAN format implemented inside the VESC. [https://dongilc.gitbook.io/openrobot-inc/tutorials/control-with-can More info on the format.] The throttle supports four modes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Control Mode !! Configuration Byte Value !! Unit !! Additional data required&lt;br /&gt;
|-&lt;br /&gt;
| Duty Cycle|| 0x01 || Percentage || None lever in the maximum forward position is 100%&lt;br /&gt;
|-&lt;br /&gt;
|Filtered Duty Cycle|| 0x02 || Percentage  || None lever in the maximum forward position is 100% &lt;br /&gt;
|-&lt;br /&gt;
|Current Control || 0x03 || 100mA  || Specify the max current for forward and backwards in two int16_t's&lt;br /&gt;
|-&lt;br /&gt;
|RPM Control || 0x04 || RPM  || Specify the rpm for forward and backwards in two int16_t's &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These modes can be send to the throttle when the throttle is off. If the throttle is on the configuration will be ignored. A sound will play when a message is received. The message has to be send to the Throttle address 0x1337, same as the reboot command. the format is as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message for Setting the control mode&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA || Control type || MSB int16_t  || LSB int16_t|| MSB int16_t  || LSB int16_t&lt;br /&gt;
|-&lt;br /&gt;
| Hardcoded command|| See Table Above || colspan=2 | Max value for lever completely forward || colspan=2 | Same but for backward (Positive for reverse)&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CAN Diagnostics messages ==&lt;br /&gt;
The throttle also send out messages to help debugging every 200 ms. It is send on address 0x1337 and has the following format:&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=210</id>
		<title>Throttle</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=Throttle&amp;diff=210"/>
		<updated>2024-03-20T08:43:19Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: /* Can Protocol */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The throttle controls the motor and is operated by the pilot during sailing. It controls the duty cycle of the motor via the CAN bus using the standard VESC message format. &lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
[[File:Throttle Schematic.png|thumb|Throttle shown in the inactive (green led) neutral position]]&lt;br /&gt;
To use the throttle to control the motor the green illuminated ''arm-button'' will have to be pressed for a few seconds, however some conditions need to be met to ensure a safe start of the motor. &lt;br /&gt;
&lt;br /&gt;
# The ''dead-man cord'' needs to be applied to the bottom of the throttle body, should snap in place magnetically&lt;br /&gt;
# The ''throttle lever'' Should be in its neutral position, pointing straight up with a noticeable tactile bump&lt;br /&gt;
# The CAN bus need to be actively acknowledging packets, which means other devices need to be active on the bus&lt;br /&gt;
# No other error should have occurred inside the electronics&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If one of these conditions is not met, the throttle will beep the number of times indicated above. &lt;br /&gt;
&lt;br /&gt;
== Programming Throttle Position ==&lt;br /&gt;
The throttle position is read out by a magnet attached tot the ''throttle lever'', because the orientation of this magnet is not know in the firmware, this position can be programmed into the EEPROM. To enter programming mode hold down the arm button during power-on. A four beep descending tone should be played, and the LED should do a double blink in red continuously. To program the throttle push lever as far forward as possible and press the button, a single beep be heard. Repeat this twice with the lever in the center and finally with the lever all the way backwards. After three beeps the throttle is reprogrammed and normal operation is resumed. &lt;br /&gt;
&lt;br /&gt;
If no programming is desired leave the lever alone for 10 seconds and the lever will reboot into normal mode.&lt;br /&gt;
&lt;br /&gt;
== Setting the Control Mode over CAN ==&lt;br /&gt;
The Throttle controls the VESC motodriver at 10Hz messaging rate with the default CAN format implemented inside the VESC. [https://dongilc.gitbook.io/openrobot-inc/tutorials/control-with-can More info on the format.] The throttle supports four modes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Different control modes of the throttle&lt;br /&gt;
|-&lt;br /&gt;
! Control Mode !! Configuration Byte Value !! Unit !! Additional data required&lt;br /&gt;
|-&lt;br /&gt;
| Duty Cycle|| 0x01 || Percentage || None lever in the maximum forward position is 100%&lt;br /&gt;
|-&lt;br /&gt;
|Filtered Duty Cycle|| 0x02 || Percentage  || None lever in the maximum forward position is 100% &lt;br /&gt;
|-&lt;br /&gt;
|Current Control || 0x03 || 100mA  || Specify the max current for forward and backwards in two int16_t's&lt;br /&gt;
|-&lt;br /&gt;
|RPM Control || 0x04 || RPM  || Specify the rpm for forward and backwards in two int16_t's &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These modes can be send to the throttle when the throttle is off. If the throttle is on the configuration will be ignored. A sound will play when a message is received. The message has to be send to the Throttle address 0x1337, same as the reboot command. the format is as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Can Message&lt;br /&gt;
|-&lt;br /&gt;
! Byte 0 !! Byte 1 !! Byte 2 !! Byte 3 !! Byte 4 !! Byte 5&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA || Control type || MSB int16_t  || LSB int16_t|| MSB int16_t  || LSB int16_t&lt;br /&gt;
|-&lt;br /&gt;
| Hardcoded command|| See Table Above || colspan=2 | Max value for lever completely forward || colspan=2 | Same but for backward (Positive for reverse)&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CAN Diagnostics messages ==&lt;br /&gt;
The throttle also send out messages to help debugging every 200 ms. It is send on address 0x1337 and has the following format:&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
	<entry>
		<id>https://wiki.engineersofinnovation.nl/index.php?title=CAN-bus&amp;diff=209</id>
		<title>CAN-bus</title>
		<link rel="alternate" type="text/html" href="https://wiki.engineersofinnovation.nl/index.php?title=CAN-bus&amp;diff=209"/>
		<updated>2024-03-19T15:33:37Z</updated>

		<summary type="html">&lt;p&gt;Aran Dokoupil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The communication between the electronics within the [[Solar boat (boii)|solar boat]] is build upon the CAN-bus protocol, where the [[datalogger]] logs the CAN messages. Pinout of our Binder connectors are: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Colours of the Standard Binder CAN Cable and its pinout&lt;br /&gt;
|-&lt;br /&gt;
! Binder Connector pin Number !! Wire Colour !! Signal on wire&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||style=&amp;quot;background: #83603A;&amp;quot;| Brown || 24v Power&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||style=&amp;quot;background: #FFFFFF;&amp;quot;| White || CAN H&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||style=&amp;quot;background: #0065B2;&amp;quot;| Blue  || CAN L&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||style=&amp;quot;background: #241F21;color:white;&amp;quot;| Black || Ground&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||style=&amp;quot;background: #B2B3B7;&amp;quot;| Gray  || Safety&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that the M12 connectors have a different pinout and thus different colour wires. To make compatibility between systems easier the binder connectors are soldered with the wrong colored wires so that plugging in a M12 device results in the right signals being passed to the Binder connector. This Compatibility pinout is shown below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ NON-STANDARD!! Colours when connecting an M12 cable to a binder connector NON-STANDARD!!&lt;br /&gt;
|-&lt;br /&gt;
! Binder Connector pin Number !! Wire Colour !! Signal on wire&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||style=&amp;quot;background: #FFFFFF;&amp;quot;| White || 24v Power&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||style=&amp;quot;background: #241F21;color:white;&amp;quot;| Black || CAN H&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||style=&amp;quot;background: #B2B3B7;&amp;quot;| Gray  || CAN L&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||style=&amp;quot;background: #0065B2;&amp;quot;| Blue  || Ground&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||style=&amp;quot;background: #83603A;&amp;quot;| Brown || Safety&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Battery (MG) CAN-format (No longer used) ==&lt;br /&gt;
As of now the MG electronics [[battery]] is used in the [[Solar boat (boii)|solar boat]]. Although a new battery is being developed, this MG battery is still in use (as of September '22). Therefore the battery format is given here below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Node-ID&lt;br /&gt;
!Index&lt;br /&gt;
!Subindex&lt;br /&gt;
!Data&lt;br /&gt;
!Type&lt;br /&gt;
!Resolution&lt;br /&gt;
|-&lt;br /&gt;
|0x302&lt;br /&gt;
|0x2005&lt;br /&gt;
|0x01&lt;br /&gt;
|Voltage &amp;lt;code&amp;gt;[V]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[mV/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x02&lt;br /&gt;
|Current &amp;lt;code&amp;gt;[A]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int16_t&lt;br /&gt;
|10 &amp;lt;code&amp;gt;[mA/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x03&lt;br /&gt;
|Current Discharge &amp;lt;code&amp;gt;[A]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int16_t&lt;br /&gt;
|10 &amp;lt;code&amp;gt;[mA/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x04&lt;br /&gt;
|Current Charge &amp;lt;code&amp;gt;[A]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int16_t&lt;br /&gt;
|10 &amp;lt;code&amp;gt;[mA/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x05&lt;br /&gt;
|State-of-Charge &amp;lt;code&amp;gt;[%]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[%/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x06&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x07&lt;br /&gt;
|Time to Go &amp;lt;code&amp;gt;[min]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[min/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|0x402&lt;br /&gt;
|0x2005&lt;br /&gt;
|0x09&lt;br /&gt;
|Cell Temperature High &amp;lt;code&amp;gt;[°C]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[°C/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0A&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0B&lt;br /&gt;
|Cell Temperature Low &amp;lt;code&amp;gt;[°C]&amp;lt;/code&amp;gt;&lt;br /&gt;
|int8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[°C/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0C&lt;br /&gt;
|Cell Voltage High &amp;lt;code&amp;gt;[V]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[mV/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0D&lt;br /&gt;
|Cell Voltage Low &amp;lt;code&amp;gt;[V]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[mV/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0E&lt;br /&gt;
|BMS State&lt;br /&gt;
|uint32_t&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|0x0F&lt;br /&gt;
|Temperature Collection &amp;lt;code&amp;gt;[°C]&amp;lt;/code&amp;gt;&lt;br /&gt;
|4x uint8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[°C/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|0x482&lt;br /&gt;
|0x2000&lt;br /&gt;
|Cell nr&lt;br /&gt;
|Cell &amp;lt;code&amp;gt;[Cell_nr]&amp;lt;/code&amp;gt; Voltage &amp;lt;code&amp;gt;[V]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint16_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[mV/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|0x202&lt;br /&gt;
|Don't Care&lt;br /&gt;
|Don't Care&lt;br /&gt;
|Power Level &amp;lt;code&amp;gt;[%]&amp;lt;/code&amp;gt;&lt;br /&gt;
|uint8_t&lt;br /&gt;
|1  &amp;lt;code&amp;gt;[%/LSB]&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Aran Dokoupil</name></author>
	</entry>
</feed>