Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Angle Sensor and Wind-Vane-Angle-Sensor Docs #5650

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions common/source/docs/common-angle-sensor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. _common-angle-sensor:
[copywiki destination="rover"]

=====
Angle Sensor
=====

This article describes how to attach an angle sensor so that your vehicle can sense angular position. This is used most commonly
for :ref:`wind-vane sensors <wind-vane>` for sailing rovers.

Currently, only AS5048B Encoders are supported.

AutoPilot connection
--------------------
Connect the encoder to the autopilot's I2C Port using standard connections.

Autopilot Configuration
-----------------------

Connect to the autopilot with a ground station and set these parameters and then reload the parameters.

- :ref:`ANG_TYPE <ANG_TYPE>` = 1 (Enable)

After reloading parameters, set the following parameters:

- :ref:`ANG_BUS <ANG_BUS>` - set this to the serial bus ID for the I2C bus you've connected to.
- :ref:`ANG_ADDR <ANG_ADDR>` - set this to the I2C Address of your sensor (defaults to 64 for AS5048B).
- :ref:`ANG_OFFS <ANG_OFFS>` - set this to apply an offset in degrees to the zero position.
- :ref:`ANG_DIR <ANG_DIR>` - set this to -1 if you need to reverse the direction of rotation for the sensor.


17 changes: 17 additions & 0 deletions rover/source/docs/wind-vane-angle-sensor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. _wind-vane-angle-sensor:

=======================
Angle Sensor Wind Vane
=======================

An angle sensor can be configured as the wind-vane direction source. In order to use this option, you must first configure
the angle sensor as described in the :ref:`Angle Sensor library <common-angle-sensor>` documentation.

To select the angle sensor as the wind-vane direction source, set :ref:`WNDVN_TYPE <WNDVN_TYPE>` = 4. Then, select the absolute
encoder instance via the :ref:`WNDVN_DIR_PIN <WNDVN_DIR_PIN>` parameter (0=AngleSensor1, 1=AngleSensor2).


Wind Vane Construction
++++++++++++++++++++++
A 3D-Printable model for an angle sensor wind-vane is available on `thingiverse <https://www.thingiverse.com/thing:4247123>`__. This example
uses an AS5048B breakout board available `here <https://www.digikey.com/en/products/detail/ams/AS5048A-TS_EK_AB/3188612>`__.
6 changes: 4 additions & 2 deletions rover/source/docs/wind-vane.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ to a alternative sensor. Note that any change to the _TYPE parameters will requi

Wind Direction
----------------------
Wind direction can be directly sensed through the use of an analogue voltage input. However it is also possible to use a fixed wind direction,
Wind direction can be directly sensed through the use of a directional sensor. However it is also possible to use a fixed wind direction,
this is not recommended for long term use, but will allow testing of sailboats without the need for specialist sensors. The wind vane type can be
selected with :ref:`WNDVN_TYPE <WNDVN_TYPE>`. The wind direction is filtered using a low pass filter, the frequency of this filter can be set
using :ref:`WNDVN_DIR_FILT <WNDVN_DIR_FILT>`. If the wind direction is oscillating this frequency can be reduced. This will reduce the effect
Expand All @@ -42,6 +42,8 @@ the vehicle will have no new information about wind direction.

Analogue Wind Vane <wind-vane-analogue>
Home Heading <wind-vane-home-heading>
Angle Sensor Wind Vane <wind-vane-angle-sensor>
NMEA <wind-vane-NMEA>


Wind Speed
Expand All @@ -59,4 +61,4 @@ speed is filtered using a low pass filter, the frequency of this filter can be s
RPM <wind-vane-rpm>
Modern Devices rev-p <wind-vane-MD-rev-p>
Connecting Bluetooth Windvane to ArduPilot <https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_WindVane/Tools/Bluetooth%20NMEA%20receiver/Bluetooth%20NMEA%20receiver.md>

NMEA <wind-vane-NMEA>
Loading