Skip to content

Commit

Permalink
Add Absolute Encoder and Wind-Vane-Absolute-Encoder Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidIngraham committed Dec 12, 2023
1 parent 867d241 commit b26ed51
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
31 changes: 31 additions & 0 deletions common/source/docs/common-absolute-encoder.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. _common-absolute-encoder:
[copywiki destination="rover"]

=====
Absolute Encoder
=====

This article describes how to attach an absolute encoder 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:`AENC_TYPE <AENC_TYPE>` = 1 (Enable)

After reloading parameters, set the following parameters:

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


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

=======================
Absolute Encoder Wind Vane
=======================

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

To select the absolute encoder as the win-dvane 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=AbsoluteEncoder1, 1=AbsoluteEncoder2).


Wind Vane Construction
++++++++++++++++++++++
A 3D-Printable model for an absolute encoder win-vane is available on `thingiverse <https://www.thingiverse.com/thing:4247123>`__. This example
uses an AS5048B breakout board and diametrically polarized magnet 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>
Absolute Encoder Wind Vane <wind-vane-absolute-encoder>
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>

0 comments on commit b26ed51

Please sign in to comment.