mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.6.1 AS5600
This commit is contained in:
parent
3f664c4ed3
commit
6e9bee2b79
3
libraries/AS5600/.github/FUNDING.yml
vendored
3
libraries/AS5600/.github/FUNDING.yml
vendored
@ -1,4 +1,5 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: RobTillaart
|
||||
github: RobTillaart
|
||||
custom: "https://www.paypal.me/robtillaart"
|
||||
|
||||
|
@ -5,8 +5,9 @@ on: [push, pull_request]
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: arduino/arduino-lint-action@v1
|
||||
with:
|
||||
library-manager: update
|
||||
|
@ -6,12 +6,14 @@ on: [push, pull_request]
|
||||
jobs:
|
||||
runTest:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
- run: |
|
||||
# sudo sysctl vm.mmap_rnd_bits=28
|
||||
gem install arduino_ci
|
||||
arduino_ci.rb
|
||||
|
@ -9,10 +9,11 @@ on:
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: json-syntax-check
|
||||
uses: limitusus/json-syntax-check@v1
|
||||
uses: limitusus/json-syntax-check@v2
|
||||
with:
|
||||
pattern: "\\.json$"
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// FILE: AS56000.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.6.0
|
||||
// VERSION: 0.6.1
|
||||
// PURPOSE: Arduino library for AS5600 magnetic rotation meter
|
||||
// DATE: 2022-05-28
|
||||
// URL: https://github.com/RobTillaart/AS5600
|
||||
@ -463,6 +463,7 @@ float AS5600::getAngularSpeed(uint8_t mode)
|
||||
int32_t AS5600::getCumulativePosition()
|
||||
{
|
||||
int16_t value = readReg2(AS5600_ANGLE) & 0x0FFF;
|
||||
if (_error != AS5600_OK) return _position;
|
||||
|
||||
// whole rotation CW?
|
||||
// less than half a circle
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// FILE: AS5600.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.6.0
|
||||
// VERSION: 0.6.1
|
||||
// PURPOSE: Arduino library for AS5600 magnetic rotation meter
|
||||
// DATE: 2022-05-28
|
||||
// URL: https://github.com/RobTillaart/AS5600
|
||||
@ -12,7 +12,7 @@
|
||||
#include "Wire.h"
|
||||
|
||||
|
||||
#define AS5600_LIB_VERSION (F("0.6.0"))
|
||||
#define AS5600_LIB_VERSION (F("0.6.1"))
|
||||
|
||||
|
||||
// default addresses
|
||||
|
@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
## [0.6.1] - 2024-03-31
|
||||
- improve **getCumulativePosition()**, catch I2C error, see #62
|
||||
- update readme.md (incl reorder future work).
|
||||
- update GitHub actions
|
||||
- minor edits
|
||||
|
||||
|
||||
## [0.6.0] - 2024-01-25
|
||||
- add experimental error handling
|
||||
- add **int lastError()** so user can check the status of last I2C actions.
|
||||
|
@ -20,9 +20,9 @@ Arduino library for AS5600 and AS5600L magnetic rotation meter.
|
||||
|
||||
**AS5600** is a library for an AS5600 / AS5600L based magnetic **rotation** meter.
|
||||
More exact, it measures the angle (rotation w.r.t. reference) and not RPM.
|
||||
Multiple angle measurements allows one to calculate / estimate the RPM.
|
||||
Multiple angle measurements allows one to calculate or estimate the RPM.
|
||||
|
||||
The AS5600 and AS5600L sensors are pin compatible (always check datasheet).
|
||||
The AS5600 and AS5600L sensors are pin compatible (always check your model's datasheet).
|
||||
|
||||
**Warning: experimental**
|
||||
|
||||
@ -39,10 +39,10 @@ Please share your experiences.
|
||||
#### 0.5.0 Breaking change
|
||||
|
||||
Version 0.5.0 introduced a breaking change.
|
||||
You cannot set the pins in **begin()** any more.
|
||||
You cannot set the SDA and SCL pins in **begin()** any more.
|
||||
This reduces the dependency of processor dependent Wire implementations.
|
||||
The user has to call **Wire.begin()** and can optionally set the Wire pins
|
||||
before calling **begin()**.
|
||||
The user has to call **Wire.begin()** and can optionally set the I2C pins
|
||||
before calling **AS5600.begin()**.
|
||||
|
||||
|
||||
#### Related libraries
|
||||
@ -64,6 +64,7 @@ Do not forget to add the pull up resistors to improve the I2C signals.
|
||||
The AS5600 datasheet states it supports Fast-Mode == 400 KHz
|
||||
and Fast-Mode-Plus == 1000 KHz.
|
||||
|
||||
|
||||
#### Pull ups
|
||||
|
||||
I2C performance tests with an AS5600L with an UNO failed at 400 KHz.
|
||||
@ -128,7 +129,7 @@ This resistor needs to be removed to use the **OUT** pin.
|
||||
|
||||
Not tested. ==> Read the datasheet!
|
||||
|
||||
PGO stands for Programming Option, it is used to calibrate / program the sensor.
|
||||
PGO stands for ProGramming Option, it is used to calibrate and program the sensor.
|
||||
As the sensor can be programmed only a few times one should
|
||||
use this functionality with extreme care.
|
||||
See datasheet for a detailed list of steps to be done.
|
||||
@ -731,38 +732,37 @@ priority is relative.
|
||||
|
||||
#### Should
|
||||
|
||||
- implement extended error handling in public functions.
|
||||
- will increase footprint !! how much?
|
||||
- **call writeReg() only if readReg() is OK** ==> prevent incorrect writes
|
||||
- ```if (_error != 0) return false;```
|
||||
- idem readReg2()
|
||||
- set AS5600_ERROR_PARAMETER e.g. setZPosition()
|
||||
- a derived class with extended error handling?
|
||||
- investigate **readMagnitude()**
|
||||
- combination of AGC and MD, ML and MH flags?
|
||||
- investigate OUT behaviour in practice
|
||||
- investigate **OUT** behaviour in practice
|
||||
- analogue
|
||||
- PWM
|
||||
- need AS5600 on breakout with support
|
||||
- write examples:
|
||||
- as5600_calibration.ino (needs HW and lots of time)
|
||||
- different configuration options
|
||||
- check / verify Power-up time
|
||||
- 1 minute (need HW)
|
||||
- check Timing Characteristics (datasheet)
|
||||
- is there improvement possible.
|
||||
|
||||
|
||||
|
||||
#### Could
|
||||
|
||||
- investigate PGO programming pin.
|
||||
- investigate **PGO** programming pin.
|
||||
- check for compatible devices
|
||||
- AS5200 ?
|
||||
- investigate performance
|
||||
- basic performance per function
|
||||
- I2C improvements
|
||||
- software direction
|
||||
- implement extended error handling in public functions.
|
||||
- will increase footprint !! how much?
|
||||
- writeReg() only if readReg() is OK ==> prevent incorrect writes
|
||||
- ```if (_error != 0) return false;```
|
||||
- set AS5600_ERROR_PARAMETER e.g. setZPosition()
|
||||
- a derived class with extended error handling?
|
||||
|
||||
- write examples:
|
||||
- as5600_calibration.ino (needs HW and lots of time)
|
||||
- different configuration options
|
||||
|
||||
#### Wont (unless)
|
||||
|
||||
|
@ -88,7 +88,7 @@ void burn_mang()
|
||||
const uint16_t FASTFILTER = 0;
|
||||
const uint16_t WATCHDOG = 0;
|
||||
const uint16_t MAXANGLE = 0;
|
||||
|
||||
|
||||
bool OK = true;
|
||||
OK = OK && as5600.setPowerMode(POWERMODE);
|
||||
OK = OK && (POWERMODE == as5600.getPowerMode());
|
||||
|
@ -21,7 +21,7 @@ void setup()
|
||||
Serial.println(__FILE__);
|
||||
Serial.print("AS5600_LIB_VERSION: ");
|
||||
Serial.println(AS5600_LIB_VERSION);
|
||||
|
||||
|
||||
Wire.begin();
|
||||
|
||||
as5600.begin(4); // set direction pin.
|
||||
|
@ -23,7 +23,7 @@ void setup()
|
||||
Serial.println(AS5600_LIB_VERSION);
|
||||
|
||||
Wire.begin(14, 15);
|
||||
|
||||
|
||||
as5600.begin(4); // set direction pin.
|
||||
as5600.setDirection(AS5600_CLOCK_WISE); // default, just be explicit.
|
||||
int b = as5600.isConnected();
|
||||
|
@ -27,7 +27,7 @@ void setup()
|
||||
|
||||
Wire.begin();
|
||||
|
||||
as5600.begin(); // set software direction control. default param = 255
|
||||
as5600.begin(); // set software direction control. default parameter == 255
|
||||
as5600.setDirection(AS5600_CLOCK_WISE); // default, just be explicit.
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ void loop()
|
||||
if (counter < 10) as5600.setDirection(AS5600_CLOCK_WISE);
|
||||
else as5600.setDirection(AS5600_COUNTERCLOCK_WISE);
|
||||
if (counter >= 20) counter = 0;
|
||||
|
||||
|
||||
Serial.print(millis());
|
||||
Serial.print("\t");
|
||||
Serial.print(as5600.getDirection());
|
||||
|
@ -36,7 +36,7 @@ void setup()
|
||||
Serial.print("Connect device 0: ");
|
||||
Serial.println(as5600_0.isConnected() ? "true" : "false");
|
||||
delay(1000);
|
||||
|
||||
|
||||
as5600_1.begin(5); // set direction pin.
|
||||
as5600_1.setDirection(AS5600_COUNTERCLOCK_WISE);
|
||||
Serial.print("Connect device 1: ");
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// FILE: AS5600_resetCumulativeCounter.ino
|
||||
// AUTHOR: Daniel-Frenkel, (slightly by Rob Tillaart)
|
||||
// AUTHOR: Daniel-Frenkel, (slightly modified by Rob Tillaart)
|
||||
// PURPOSE: demo - see issue #30
|
||||
// URL: https://github.com/RobTillaart/AS5600
|
||||
//
|
||||
@ -21,7 +21,7 @@ void setup()
|
||||
Serial.println(__FILE__);
|
||||
Serial.print("AS5600_LIB_VERSION: ");
|
||||
Serial.println(AS5600_LIB_VERSION);
|
||||
|
||||
|
||||
Wire.begin(14, 15); // ESP32
|
||||
|
||||
as5600.begin();
|
||||
|
@ -15,7 +15,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/AS5600.git"
|
||||
},
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.1",
|
||||
"license": "MIT",
|
||||
"frameworks": "*",
|
||||
"platforms": "*",
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=AS5600
|
||||
version=0.6.0
|
||||
version=0.6.1
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino library for AS5600 and AS5600L magnetic rotation meter.
|
||||
|
Loading…
Reference in New Issue
Block a user