Skip to content

[FEATURE] AS5600 I2C optimization #486

@HoeckDK

Description

@HoeckDK

To optimize the time spend on reading the I2C sensor, I remove the following from MagneticSensorI2C::getRawCount():

wire->beginTransmission(_conf.chip_address);
wire->write(_conf.angle_register);

currWireError = wire->endTransmission(false);

It seems the AS5600 happily responds without being directed repeatedly.

Instead of it I run the above lines on setup and when the motor is idle (I do not execute FOC at that point)

Seems to work reliable.

Describe the solution you'd like
An option to only run the above 3 lines at startup. And have a call specific function to call to replace the above actions, when desired/required.

Describe alternatives you've considered
Modify MagneticSensorI2C::getRawCount()

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions