Just out of curiosity who here has been using the AS5047P variant mag encoder and have you had any luck with it? Or anything special I might need todo. It seems to have the same angle read register setting so I thought it would be just good to go
I’ve mounted one up today with the same setup board I use the U variant but its not seeming quite happy yet.
With the U I get consistent results but with the P I get fluctuations in the output in the serial monitor of 6.28/6.29
9.03
9.03
9.03
15.31
9.03
9.03
9.03
15.31
15.31
15.31
9.03
9.03
@Antun_Skuric@David_Gonzalez@Owen_Williams Were you guys using the P variant? I sourced mine from Aliexpress as I found them for 3 euros each for 10 and couldn’t help try my luck.
But as you can see the output is crap. I am using the same MCU and swapping out the mag encoder on the back with the same code. The AS5047U runs great and is stable. I have tried 2 of the AS5047Ps I got and either they are factory seconds that are rejected because of instability or the P variant needs something a little additionally to get it to run.
Are you saying it jumps 2pi? I would guess that is fixable and or is a software bug. These sensors are 14bit (16384). I wonder if the code that spots the rollover (from 0 to 16383 or vice versus) is doing something weird.
Maybe you can print out what the raw values are doing from the read register when it’s misbehaving.
@Owen_Williams 2pi…yes your right:) and yes I am using SPI. I could print out raw values…Im a bit rusty to find where todo that so any hints would help and I can report back here with the data:)
The raw results look good - it seems to be fluctuating ± 0.1 degrees (which could be easily smoothed further). It doesn’t explain the ± 2PI jumps. Can you print raw_data next to angle - so we can see when the jumps happen in relation to the raw_data.
It might also be worth spinning the motor 360 and looking to see what the raw_data does. It’s possible they’ve done something weird like change it to 12bit or the bits are coming back with a different endian.
@Owen_Williams - 2.1 library resolves my problem…cheap chips means $$$$ saved yay.
By cheap I mean around €3.5 each. The same version from mouser when you buy ten is 6,46 € plus VAT.
Anyway thanks again