Difference between revisions of "Autopilot"

From 'Engineers of Innovation Wiki'
Jump to navigation Jump to search
(Added ardupilot settings of mission planner)
Line 1: Line 1:
== Platform ==
== Platform ==
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 Beaglebone blue.  
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].
 
To make use for our application a PCB has been designed to integrate into the hydrofoil design. 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.


== Setup ==
== Setup ==
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.
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.
== Ardupilot settings ==
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.


For the beagle bone setup follow [https://ardupilot.org/copter/docs/common-beagle-bone-blue.html this] tutorial. The versions of Debian and Ardupilot used in this tutorial are old. The Debian image used on the beaglebone is the [https://rcn-ee.net/rootfs/bb.org/testing/2022-11-01/buster-console-armhf/am57xx-eMMC-flasher-debian-10.13-console-armhf-2022-11-01-1gb.img.xz 10.13 eMMC flasher]. The procedure to flash Debian to the onboard eMMC can be found [https://beagleboard.org/static/librobotcontrol/flashing.html here]. Also make sure to use version 4.3.1 of ardupilot by using the command bellow during the Ardupilot tutorial.
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.
{| class="wikitable sortable"
|+
Configuration of ardupilot
!Setting
!Value
!Description
!Reason
|-
|INS_GYR_CAL
|0
|Controls the automatic gyro calibration.
|Gyro calibration requires that the unit should be held as still as possible.
|-
|SERVO1_FUNCTION
|78
|ElevonRight
|Controls the right foil assembly.
|-
|SERVO2_FUNCTION
|77
|ElevonLeft
|Controls the left foil assembly.
|-
|INITIAL_MODE
|5
|FBWA
|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].
|-
|GPS_TYPE2
|5
|NMEA
|This sets the GPS data that is sent onto the serial data port.
|-
|SERIAL1_PROTOCOL
|2
|MAVLINK2
|Controls what protocol to use on the serial port
|-
|SERIAL1_BAUD
|57
|57600
|Specifies the baudrate of the serial port.
|-
|SERIAL4_PROTOCOL
|5
|GPS
|Controls what protocol to use on the serial port
|-
|SERIAL4_BAUD
|9
|9600
|Specifies the baudrate of the serial port.
|}


== Future plans ==
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.


<code>sudo wget -O /usr/bin/ardupilot/arduplane https://firmware.ardupilot.org/Plane/stable-4.3.1/blue/arduplane</code>
This mode supports "Automatic Altitude Holding", that makes sure that the same level of altitude is automatically kept. Further testing is needed for determining the control loops and their coefficients.


== Relevant links for configuring Ardupilot ==
== Relevant links for configuring Ardupilot ==

Revision as of 22:02, 21 March 2023

Platform

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 orange cube.

To make use for our application a PCB has been designed to integrate into the hydrofoil design. To connect to the ardupilot on the cube for tweaking settings and tuning control loops, Mission Planner will be used. The following section have tweaked settings found in Mission Planner.

Setup

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.

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.

Ardupilot settings

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.

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.

Configuration of ardupilot
Setting Value Description Reason
INS_GYR_CAL 0 Controls the automatic gyro calibration. Gyro calibration requires that the unit should be held as still as possible.
SERVO1_FUNCTION 78 ElevonRight Controls the right foil assembly.
SERVO2_FUNCTION 77 ElevonLeft Controls the left foil assembly.
INITIAL_MODE 5 FBWA Fly By Wire A this is a fly mode for the control unit. More can be found here.
GPS_TYPE2 5 NMEA This sets the GPS data that is sent onto the serial data port.
SERIAL1_PROTOCOL 2 MAVLINK2 Controls what protocol to use on the serial port
SERIAL1_BAUD 57 57600 Specifies the baudrate of the serial port.
SERIAL4_PROTOCOL 5 GPS Controls what protocol to use on the serial port
SERIAL4_BAUD 9 9600 Specifies the baudrate of the serial port.

Future plans

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.

This mode supports "Automatic Altitude Holding", that makes sure that the same level of altitude is automatically kept. Further testing is needed for determining the control loops and their coefficients.

Relevant links for configuring Ardupilot

https://ardupilot.org/copter/docs/common-gcs-only-operation.html

https://ardupilot.org/copter/docs/common-rangefinder-landingpage.html

https://ardupilot.org/copter/docs/setting-up-for-tuning.html

https://ardupilot.org/copter/docs/terrain-following-manual-modes.html

https://ardupilot.org/copter/docs/common-sensor-offset-compensation.html

https://ardupilot.org/copter/docs/crash_check.html

https://ardupilot.org/copter/docs/flight-modes.html --FBW-A mode seems best fit for front only, FBW-B for finalized system

https://ardupilot.org/plane/docs/fbwb-mode.html

https://ardupilot.org/copter/docs/stabilize-mode.html

https://ardupilot.org/plane/docs/fixed-wing-faq.html --Disable Gyro calibration on start-up

https://ardupilot.org/rover/docs/sonar-sensors.html --Two sonar sensors

https://ardupilot.org/dev/docs/plane-architecture.html --Plane architecture and files