Skip to content

How to handle physical orientation of ICM20948 when calculating Roll and Pitch used for leveling #66

@Bascy

Description

@Bascy

We are creating a device based on a ESP32 and an ICM20948, using 4 actuators to physically level out platforms.

The actuators are activated based on the Roll and Pitch that is calculated from the output of the ICM20948.
For the calculation of the Roll and Pitch, we "borrowed" code from the internet (https://en.wikipedia.org/w/index.php?title=Conversion_between_quaternions_and_Euler_angles&section=8#Source_code_2 ), incoorporated in the examples by @PaulZC as I understand)

We are technically schooled but no mathematicians and do not really understand what it's doing ... but its working :)

The actuators are on a well known location on the platform, so we know that if i.e. Roll = 10 that we need to extend the forward and backward actuators on the right of the platform to get the Roll to become smaller.

The problem now arrises that the way that our device is mounted on the platform can vary between installations, the ICM will not always be mounted parallel to the top surface of the platform, but can be mounted in any orientation (we can assume that it will only be 90degree rotations, so the Roll or Pitch axis can point forward, left, backwrd, right, up or down in regards to the platform.)

Our question is how can we add a configuration specifiying the mounted orientation, and (more importantly) use that configuration to get the right Roll and Pitch angles of the platform to steer the correct actuators.

Any help or reference to other sources would be welcome.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions