Skip to content

Magnetic Sensor find the wrong sensor direction bug #173

Closed
@lordary

Description

@lordary

During the initialization of magnetic sensor, if the direction of rotation is not set, the program will execute to find the direction of rotation.
When I use this feature, the AS5600 magnetic sensor sometimes find the wrong direction.
The code rotate the motor and check the data of magnetic sensor during the rotation to find the rihgt direction.
Maybe the wrong direction because the initial data of magnetic sensor is not correct, so I add sensor.update() during the rotate of the motor:

  for (int i = 0; i <=500; i++ ) {
      float angle = _3PI_2 + _2PI * i / 500.0f;
      setPhaseVoltage(voltage_sensor_align, 0,  angle);
      sensor->update();
      _delay(2); 
     }

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