Hi everyone.
I am using AS5600 with some cheap drone motors and Nucleo-F411RE. But the output of magnetic sensors seems odd.
When using the sensor alone(magnetic_sensor_i2c_example) the angle is regular, 6.28 per round.
But in the close loop control mode the sensor will jammed in fer seconds after motor.init() everytime. More detailed is the angle is freezed at a value like this:
I find it best to call the above immediately after sensor.init();
It feels like a noise or pullup problem on sda or scl. 3.3K pullups seem sensible - you might want to go a bit lower if choosing 1M clock speed. Can you shorten these wires or move them away from other wires (including each other).
I fix the problem after replaced the cable. Thanks for all your help!
Now I wonder how to change i2c pins.
eg:PB7 to PB9.
I have tried like this, but it doesnt work.
Good to hear you’ve got it working. With stm32, typically each i2c bus has a choice of two pin maps. You need to check what alternate pins can be used using datasheet or device config tool that comes with stm cube ide.
Im also experiencing a problem like this on my Nucleo-F411RE with the MPU6050. It sometimes just stops the main loop. I have heard that Wire.h is causing that problem if the SCL pin is disconnected for a brief moment. Do you think that there might be a disconnect because of interference in the wires? If so would a shielded wire help? Im also using the SimpleFOCShields pullup resistors for I2C.
I regularly shove an additional 1 or 2k pullup resistor between sda and v3.3 (or 5v). You can usually find somewhere to shove it in without soldering e.g. into the back of the 2.54mm connector near the i2c device. Sda seems to cause me more issues but I’ve occasionally done sda and scl. I’ve also done this with hall sensors.
Faster i2c (400k and 1M) typically require lower (more powerful) pullups.
Hello, I am new to this forum and I hope to stay here for a long, I think its a very interesting idea! But I have my first problem, on an reaction wheel pendulum that I would like to implement! I have an simplefocshield and an AS5600 sensor when I connect the sensor direct to the arduino uno, I read the proper values of the angle with the “magnetic_sensor_i2c_example”