Git Product home page Git Product logo

as5x47's Introduction

AS5X47 Library for Arduino

AS5047P Encoder with Arduino MegaAS5047P Encoder Mount

AS5X47 is a library for connecting AS5047 and AS5147 magnetic encoders to Arduino boards. It allows to easily read the angle measured from the sensor and also advanced features to reconfigure the encoder.

Hardware support

This library has been tested with the following encoders:

  • AS5047P
  • AS5047D
  • AS5147P

Supported Features

  • SPI Communication with encoders
  • Abstraction of SPI Communication
  • Read and Write operations for all registers
  • Abstraction of angle measure
  • Debug string to read the state of all registers at once
  • One Time Programation (OTP) Abstraction

Please let me know if you tested it with other encoders.

Installation

Using the Arduino Library Manager (recommended): Use the Arduino Library Manager and search for AS5X47 library. Select the most recent version and click 'Install'. That's it, the library is installed!

Installing manually: For more information or manually install the library, please refer to the Arduino official page : https://www.arduino.cc/en/guide/libraries

Usage

Examples

Two examples are provided within the library :

  • ReadAngle.ino shows how to connect the sensor and how to read the measured angle.
  • ConfigureSensor.ino shows how to use advanced features of this library in order to manipulate the encoder registers according to the manufacturer datasheet.

Wiring

The encoder board must be connected to the SPI Pins of the Arduino Board. In the case of an Arduino Uno, connect as following: AS5X47 encoder connection

For other boards, please refer to official Arduino page.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

as5x47's People

Contributors

adrien-legrand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

as5x47's Issues

SPI issues on Teensy series Arduino

Unfortunately it seems as though the teensy series controllers do not have the ability to use this library properly or the library does not use the teensy SPI system properly.

while using the readangle example files on both teensy 4.0 and 3.6, for a variety of CPU speeds, the output is 0 for any values of rotation. SPI bus is plugged in correctly with all pins in the correct ports.

If purchasing components is necessary to fix this issue, please write me a bill.

OTP programming - ABIRES and Zero Position

Hi Adrien,
I got a request at a project job to write code for sensor AS5047P, the code, for now, runs on Arduino Uno.
They wish to configure the sensor and make it permanent, I ask for your help to make it work.
They need to write ABIRES and Zero Position to the sensor and program the OTP, so the sensor remembers the settings.

I used your library to configure sensor settings which worked fine, but I was unable to program OTP register.
I also tried to pass raw commands to the sensor, it looked like it worked, but it seems like the sensor didn't remember its settings after the power cycle.
I followed this datasheet for programming OTP https://ams.com/documents/20143/36005/AS5047P_DS000324_3-00.pdf
It looks like I got something wrong, but I can't figure out what the bug is.

It would be awesome if you would be able to test this code and maybe find out the bug by next week's Thursday 2.2.23.
If possible you can tweak my code to make it work.

It would be great if your library could support OTP programming natively but it seems like the commands for the PROG register refused to pass into the sensor.

Here is the code I wrote, it has a serial interface for some configuration.

ConfigureSensor_AS5074_MK_V1.10.zip

Thanks a lot, in advance.

CAD file request

First of all, thanks a lot for your contribution.

Is it possible to have the CAD file to print it out?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.