2208 80kv motor testing and AS5048A SPI settings

Hi everyone,

Excellent documentation and community going on here.
I though I would share my testing of the cheap 2208 80kv gimbal motors from Ali and some details getting a AS5048A magnetic encoder to play ball.

Firstly testing the stall torque of the motor. My testing scales and setup for this was quite awful so please take it as a loose guide. The setup was a simplefoc mini v1.0, arduino nano and bench power supply

22v supply, driver volt limit 22, 6s lipo nominal, V in each line is motor voltage limit
20mm arm, hold and return weight, quite approximate
V A Weight @ 2cm kg/cm Nm
4v 0.13A 40g 0.08 0.007845
5v 0.18A 90g 0.18 0.01765
6v 0.26A 100g 0.2 0.0196 700ish rpm no load - Gets warm but probs ok
8v 0.45A 150g 0.3 0.0294
10v 0.7A 220g 0.44 0.04315
12.7v 1.1A 250g 0.5 0.049 1000ish rpm - 5 second burst, gets hot quick

30v supply, driver volt limit 30
20mm arm, hold and return weight, quite approximate
V A Weight @ 2cm kg/cm
17.4v 1.4A 400g 0.8 very much not sustainable

I couldn’t find any resources with actual motor testing like this so it could be a cool website feature.

For setting up the AS5048A with SPI interface I required the following Config:
MagneticSensorSPIConfig_s AS5048A_SPI = {
.spi_mode = SPI_MODE1,
.clock_speed = 3000000,
.bit_resolution = 14,
.angle_register = 0xFFFF,
.data_start_bit = 13,
.command_rw_bit = 0,
.command_parity_bit = 0
};

This involved having to change the angle_register to Uint. By the looks of it you might be able to avoid this with the rw and parity bits but ill leave that up to someone who knows what theyre doing.

As I had to use the nanos SPI pins it took longer than it should have to realize I had to use PWM pins for the mini PWM inputs and then more confusion when trying to debug with millis() was broken and I needed to use _micros() after using pins that required timer 0.

Maybe having hookup guides with different encoder types would be helpful, A/B, i2c and SPI connections.

Hopefully this is helpful for someone in future as the forum has been for myself getting started.

1 Like

Hi @Dusty , welcome to SimpleFOC!

You’re absolutely right, it would be cool to have that. But in the meantime if people share results here in the forum, like you have generously done, then that is cool too!

I’m a bit confused what you’re saying here? Are you saying the default settings for AS5048A did not work for you on the Arduino Nano?
Did you also try the dedicated driver for the AS5048A we have in the drivers library? Arduino-FOC-drivers/src/encoders/as5048a at master · simplefoc/Arduino-FOC-drivers · GitHub

Either way, the AS5048A has been supported for a long time, and is widely used, so I’m surprised to hear you had troubles there…

I didn’t know there was a dedicated library for the AS5048A, I was trying to use MagneticSensorSPI with AS5048_SPI which didn’t work. I had to change the angle_register as the value (0xFFFF) the AS5048A needed to be sent to read the data put was too large for a int apparently.

I will give the library a go next round and update with some more motor tests.

How interesting! Yes, the 8 bit MCUs can have these kind of issues. I will look into it, and thanks for letting me know!