Adrien-Legrand / AS5X47

A library for Arduino boards that reads angles from AS5047 and AS5147 sensors. Also handles encoder configuration.
MIT License
17 stars 7 forks source link

why don't you use "Measured angle with dynamic angle error compensation" #3

Closed oycq closed 2 years ago

oycq commented 3 years ago

define ANGLE_REG 0x3FFE

define ANGLECOM_REG 0x3FF

and you use ANGLE_REG "Measured angle WITHOUT dynamic angle error compensation" ReadDataFrame readDataFrame = readRegister(ANGLE_REG);

jeanda25 commented 2 years ago

Hello. Thank you for this great library. I started using if for driving a motor in FOC. Another interesting register is the 0x3FFC in which the velocity is calculated by the sensor. See page 27 here fter: https://ams.com/documents/20143/36005/AS5147U_AS5247U_DS000639_4-00.pdf/1141a423-d438-ff83-df65-0adc533d6801 Best regards

Adrien-Legrand commented 2 years ago

@oycq As stated in the documentation, at low speeds (<100RPM), the noise is reduced. Depending on your use case, you can either use the standard non compensated readAngle() method, or use the readRegister() method to acceed the compensated angle.

@jeanda25 Thank you very much for your feedback, the speed is not available for AS5047 sensors, it's an upgrade with AS5247 series : this is why it is not implemented within the library. I wanted it to stay as much generic as possible, I may think in refactoring it to include these new features.