AS5600 Angle sensor support?

My bad I think I misunderstood that.

BTW I have something helpful at least to say about the as5600 white boards. As it turns out the reason for not being able to program them was that the PGO pin was tied to ground with a 1k resistor. I removed R4 and then bingo I have analog out now I am also tryin to play with the internal filter settings of the chip

2 Likes

Hi,

Thank you for this !
I also have PGO pin pulled down to ground via R4.

I discovered also that pin1 and 2 are shorted, that is 3.3V setup for power. (which is nice for ESP32).

Something that I don’t understand : when you say “I removed R4 and then bingo I have analog out now”

I thought from the datasheet (as not yet tested my board) that in option B mode (with R4 to ground) we should have this behavior : “Analog Output Mode”
By default, the AS5600 output stage is configured as analog
ratiometric output. The Digital to Analog Converter (DAC) has
12-bit resolution. In default mode, the lower reference voltage
for the DAC is GND, while the upper reference voltage is VDD.

So R4 should only prevent to program the chip via I2C ? Am I wrong ?

I also removed the 10uf capacitor. The 1k resistor to ground is only for programming the chip over the out pin. You can safely remove it

1 Like

please could you tell me which one is the 10µF ? C1 or C2 ?

I don’t succeed in measuring them while soldered !

I tried to unsolder the bigest one !
And it worked : C2 is 10µF

Was my plan today to see how tuning the filters go in reducing noise fingers crossed

@Adam_Donovan regarding your noisy motor. Often the motor is only producing 10% of the total noise and what it’s touching is making the 90% of the noise. e.g. the table or chassis it is touching is vibrating. If you hold the motor in your hand is it quieter? If so then mechanical sound damping such as rubber washers may help.

Hey Owen, same noise if I hold it or not:). These are the same motors we always use in the swarm. I will make some new videos to help describe what I am hoping to achieve so stay tuned

@Adam_Donovan, if you are searching for a frequency analyser, go to the play store and load the app “Specroid”. It is really professional, handy and free. Mic and CODEC of most cell phones are pretty high sophisticated.
Probably this brings you an idea what causes the noise. If you have stacked metal sheets in your motor I would look on this usual suspect at first.

thank you for this App. You are right : really good.
Exact name is “Spectroid

1 Like

Hey guys,

I a very interested to find out what is causing the noise too :smiley:

It would maybe be a good idea to introduce a low pass filter for the position measurement as well as for the velocity.
At the moment it is not included, but this would definitely make sense.

if you would like to try to implement it @Adam_Donovan you could add line:

    LowPassFilter LPF_position{0.001}; // time constant 0.001 s 

to line 122 of the common/FOCMotor.h and replace line 47 in the file common/FOCMotor.cpp with:

  return LPF_position(sensor->getAngle());

Then in your arduino code you can test what is the good value to set to:

void setup(){
...
   LPF_position.Tf = 0.0001; // try different values
...
}

Basically the higher tha value the more filtered the angle will be. If you put 0 then there will be no filtering.
So raising this value will start by improving performance and after some value will start degrading it. So there is a sweet spot to hit :smiley:

1 Like

Hi all,

I have installed the AS5600 sensor on my motor and tried to run position control code.

My motor is a quite big 14 poles pairs gimbal motor
I power it at 12V
I use an ESP32 (lolin32 lite). This ESP does not have pin 21 exposed. So I have modified wire begin like this

void MagneticSensorI2C::init(){
  
	//I2C communication begin
	//Wire.begin(I2C_SDA, I2C_SCL);
	Wire.begin(23, 19);

It works and keeps its position quite strongly. I can see the current rising if I try to move the motor. But I do have oscillations.

here is a video showing boot, motion and the oscillations I still have.

I have twiked a little PI parameters more or less efficiently…
I don’t know yet if it is noise on the magnetic sensor position or a bad PID setup ? (or both)

current settings :

 // velocity PI controller parameters
  motor.PID_velocity.P = 0.5;
  motor.PID_velocity.I = 20;
  // maximal voltage to be set to the motor
  motor.voltage_limit = 6;
  
  // velocity low pass filtering time constant
  // the lower the less filtered
  motor.LPF_velocity.Tf = 0.01;

  // angle P controller 
  motor.P_angle.P = 1;
  // maximal velocity of the position control
  motor.velocity_limit = 30;

Hey @freedom2000,

Is this behavior at the beginning something you expect to have or are these oscillations as well?
This initial movement in steps?

Is the velocity loop more smooth?

You can try removing the interval gain completely PID_velocity.I = 0 and than rising it slowly.
I would certainly suggest you to use the motor commands for this so that you can iterate faster.

You have the library examples with motor commands integrated already.

thanks Antun,

I totaly forgot that motor commands existed…
The initial movement in steps is directly what I get when running the position control example.

I will try to play with the parameters and the velocity loop

Huh, it sounds pretty bad then :smiley:
Honestly, to me it looks like one of the motor phases is unconnected.

I would suggest you to try the velocity and voltage mode first, and make sure that they work well.
You can enable them with motor commands C0 - voltage and C1 velocity mode.

I believe I found my mistake…

The magnet is mounted too far from the sensor and only works from time to times
i have pushed on it to be closer and the oscillations have disapeared.

I have now a much better result.
NIce to see how the current is rising when I apply counter torque on the shaft

1 Like

BTW, the velocity was working much better but a kind of wobbling was noticable (not constant speed).
I found the magnet bug with this mode :slight_smile:
Thanks for your help

This might be of interest for you guys running multiple AS5600 sensors:
serial - How to resolve I2C address clashes? - Electrical Engineering Stack Exchange

2 Likes

I stumbled upon this message looking for clues as to why my AS5600 on a white board from Ali Express is not giving me any analog or PWM output. If anyone else is struggling with the same issue: It’s because the GPO pin is pulled to ground by R1. Remove it and the analog and PWM outputs should work normally.

2 Likes

Same problem with wrong magnet here with this link. I also had another problem with this board that I want to share. I could not have any stable readings until I fixed the pin DIR to GND, if you leave it floating, you will have a bad time.