Dear community,
I have some problems, getting the AS5600 to work for me on the Nucleo 64 (F401RE) platform. On a Arduino Uno everthing works fine.
The first thing I learned was, to move the SDA and the SCL from A4 & A5 (arduino) to D14 & D15 (Nucleo 64). Using the Seeedstudio AS5600 library, I get plausible values (https://wiki.seeedstudio.com/Grove-12-bit-Magnetic-Rotary-Position-Sensor-AS5600/). So I imagine, it has nothing to do with the still missing pull-ups.
But the angle control sketch results in the following serial output:
MOT: Monitor enabled!
MOT: Init
MOT: Enable driver.
MOT: Align sensor.
MOT: Failed to notice movement
MOT: Init FOC failed.
Motor ready.
Set the target angle using serial terminal:
Sniplet of my code:
#include <Wire.h>
#include <SimpleFOC.h>
//MagneticSensorI2C(chip_address,bit_resolution, angle_register_msb, bits_used_msb)
MagneticSensorI2C sensor = MagneticSensorI2C(0x36, 12, 0x0E, 4);
StepperMotor motor = StepperMotor(50);
// Stepper driver instance (IN1, IN2, IN3, IN4, ENA, ENB)
StepperDriver4PWM driver = StepperDriver4PWM(5, 6, 9, 10, 8, 7);
// angle set point variable
float target_angle = 0;
// instantiate the commander
Commander command = Commander(Serial);
void doTarget(char* cmd) { command.scalar(&target_angle, cmd); }
void setup() {
// initialise magnetic sensor hardware
Wire.setSDA(PB9);
Wire.setSCL(PB8);
sensor.init(&Wire);
Wire.setClock(400000);
// link the motor to the sensor
motor.linkSensor(&sensor);
</ code>
Has anybody any ideas what else I could try to make this work?