Noise in movement / Inconsistency- HT3505 BLDC with as5048A

Hello,

My name is Jan Gerrit. I have connected 2 SimpleFOC shields to a nucleo board with a f446RE.

When i am running the angle control sample with a single motor, called my Y axis, i am able to move the motor to a given position using the command for setting a target angle.

When starting up it initializes smooth and correctly, but after that is starts turning with a lot of sound.

Most of the time when i give it a certain target angle between 1 and 6 rads, it is stabilizing again and keeps its position at the given angle. When incrementing with small values (0.1) over the given angle, it is working stable and moving to the new position.

Altough, sometimes for example, when i jump for 1 rad to 6, it is jumping into a sort of continous rotation mode again, making lot of sound as of the phases are out of sync. When this happens these are some samples values form the motor.monitor() :

17:05:31.817 -> 1.0000	-0.0151	-0.0043	0.9998
17:05:31.864 -> 1.0000	-0.0124	0.0314	0.9998
17:05:31.864 -> 1.0000	0.0049	-0.0487	0.9994
17:05:31.864 -> 1.0000	-0.0305	0.0816	1.0009
17:05:31.864 -> 1.0000	-0.0177	0.0501	0.9998
17:05:31.911 -> 1.0000	-0.0122	0.0059	1.0002
17:05:31.911 -> 1.0000	-0.0211	0.0483	1.0005
17:05:31.911 -> 6.000 // targetangle set feedback
17:05:31.911 -> 6.0000	1.9895	-61.5155	1.0147
17:05:31.911 -> 6.0000	6.0000	-219.0222	-5.0230
17:05:31.957 -> 6.0000	6.0000	-101.4939	-4.4267
17:05:31.957 -> 6.0000	5.8920	-14.4028	-3.1416
17:05:31.957 -> 6.0000	-4.4678	16.2802	-2.7385
17:05:31.957 -> 6.0000	-6.0000	15.9367	-2.4904
17:05:32.003 -> 6.0000	1.1117	-13.2842	-2.7780
17:05:32.003 -> 6.0000	5.8900	-6.9901	-2.8935
17:05:32.003 -> 6.0000	3.9916	11.0340	0.0000
17:05:32.003 -> 6.0000	0.2598	13.6712	-2.1606
17:05:32.050 -> 6.0000	-3.1581	15.7335	-1.8879
17:05:32.050 -> 6.0000	0.0127	1.4171	-1.9317
17:05:32.050 -> 6.0000	2.6736	-1.7150	-1.9516
17:05:32.050 -> 6.0000	3.9599	-8.2490	-1.8047
17:05:32.050 -> 6.0000	0.0307	16.3817	-1.4956
17:05:32.097 -> 6.0000	-1.8514	16.3527	-1.2851

Does this behaviour sounds familiar to one of you?

Best regards,

Jan Gerrit

Hi @jangerrit!

Welkom tot het forum :slight_smile:

So I always say this as first suggestion because your initialisation seems to be fine and you are using a magnetic encoder: Check your magnet polarisation! Often these magnetic encoders are delivered with the wrong magnet.

Otherwise: Does everything work fine in open loop mode? Or do you also have inconsistencies there?

Hi Wittecactus,

Thanks en Bedankt for your quick reply and suggestion!

I am almost sure it is not the polarisation of the magnet, as i tested the sensors over PWM and also the sensor.getAngle() readings are relatively stable when monitoring the plain serial output over SPI by only initiating the sensor and no drivers.

PWM output (0 - 4096 us):

ezgif.com-gif-maker (2)

Open loop mode: Will check it out asap.

Thanks,

Jan Gerrit

Goodday,

I was able to try the open loop angle control mode. It performs really well. I can see that there is a small deviation in angle when making incremental full turns, but that’s of course the open loop mode result.

It seems to be that the problem lies in line of the sensor of maybe the PID params?

I did another run with just then sensor initialized, it is incrementing well but it doesn’t seems to be really stable behind 2 decimals:

9:47:43.104 -> 0.3866
09:47:43.104 -> 0.3885
09:47:43.104 -> 0.3862
09:47:43.104 -> 0.3866
09:47:43.104 -> 0.3881
09:47:43.104 -> 0.3885
09:47:43.104 -> 0.3908
09:47:43.104 -> 0.3900
09:47:43.104 -> 0.3915
09:47:43.104 -> 0.3912
09:47:43.104 -> 0.3915
09:47:43.104 -> 0.3927
09:47:43.104 -> 0.3923
09:47:43.104 -> 0.3927
09:47:43.104 -> 0.3927
09:47:43.104 -> 0.3942
09:47:43.104 -> 0.3950
09:47:43.104 -> 0.3962
09:47:43.104 -> 0.3958
09:47:43.104 -> 0.3969
09:47:43.104 -> 0.3965
09:47:43.104 -> 0.3965
09:47:43.104 -> 0.3985
09:47:43.104 -> 0.3985
09:47:43.104 -> 0.3996
09:47:43.104 -> 0.4015
09:47:43.104 -> 0.4008
09:47:43.104 -> 0.4019
09:47:43.104 -> 0.4023
09:47:43.104 -> 0.4015
09:47:43.104 -> 0.4027
09:47:43.104 -> 0.4034
09:47:43.104 -> 0.4038
09:47:43.104 -> 0.4031
09:47:43.104 -> 0.4050
09:47:43.104 -> 0.4046
09:47:43.104 -> 0.4065
09:47:43.104 -> 0.4065
09:47:43.104 -> 0.4069
09:47:43.104 -> 0.4080
09:47:43.104 -> 0.4080
09:47:43.153 -> 0.4080
09:47:43.153 -> 0.4088
09:47:43.153 -> 0.4096
09:47:43.153 -> 0.4092
09:47:43.153 -> 0.4107
09:47:43.153 -> 0.4103
09:47:43.153 -> 0.4115
09:47:43.153 -> 0.4103
09:47:43.153 -> 0.4119
09:47:43.153 -> 0.4123
09:47:43.153 -> 0.4126
09:47:43.153 -> 0.4126
09:47:43.153 -> 0.4138
09:47:43.153 -> 0.4126
09:47:43.153 -> 0.4142
09:47:43.153 -> 0.4138
09:47:43.153 -> 0.4153
09:47:43.153 -> 0.4146
09:47:43.153 -> 0.4157
09:47:43.153 -> 0.4153
09:47:43.153 -> 0.4161
09:47:43.153 -> 0.4157
09:47:43.153 -> 0.4149
09:47:43.153 -> 0.4161
09:47:43.153 -> 0.4157
09:47:43.153 -> 0.4165
09:47:43.153 -> 0.4153
09:47:43.153 -> 0.4157
09:47:43.153 -> 0.4161
09:47:43.153 -> 0.4161
09:47:43.153 -> 0.4157
09:47:43.153 -> 0.4165
09:47:43.153 -> 0.4153
09:47:43.153 -> 0.4165
09:47:43.153 -> 0.4146
09:47:43.153 -> 0.4161
09:47:43.153 -> 0.4149
09:47:43.153 -> 0.4172
09:47:43.153 -> 0.4165
09:47:43.153 -> 0.4149
09:47:43.153 -> 0.4153
09:47:43.153 -> 0.4157
09:47:43.153 -> 0.4138
09:47:43.153 -> 0.4146
09:47:43.153 -> 0.4138
09:47:43.153 -> 0.4142
09:47:43.153 -> 0.4146
09:47:43.153 -> 0.4142
09:47:43.153 -> 0.4134
09:47:43.153 -> 0.4130
09:47:43.153 -> 0.4134
09:47:43.153 -> 0.4130
09:47:43.153 -> 0.4126
09:47:43.153 -> 0.4126
09:47:43.153 -> 0.4123
09:47:43.153 -> 0.4126
09:47:43.153 -> 0.4126
09:47:43.153 -> 0.4126
09:47:43.153 -> 0.4126
09:47:43.153 -> 0.4126
09:47:43.153 -> 0.4119
09:47:43.153 -> 0.4115
09:47:43.153 -> 0.4119
09:47:43.198 -> 0.4123
09:47:43.198 -> 0.4107
09:47:43.198 -> 0.4115
09:47:43.198 -> 0.4123
09:47:43.198 -> 0.4119
09:47:43.198 -> 0.4123
09:47:43.198 -> 0.4119
09:47:43.198 -> 0.4119
09:47:43.198 -> 0.4130
09:47:43.198 -> 0.4111
09:47:43.198 -> 0.4115
09:47:43.198 -> 0.4119
09:47:43.198 -> 0.4111
09:47:43.198 -> 0.4123
09:47:43.198 -> 0.4126
09:47:43.198 -> 0.4130
09:47:43.198 -> 0.4123
09:47:43.198 -> 0.4123
09:47:43.198 -> 0.4126

Am i correct, thinking that the calculation for a 12 (14 over spi) bit absolute position result, should give a stable value of at least one thousand in the decimal notation? (stepAngle = (6/(2^12)) = (6/4096) = 0.00146)

Kind Regards,

Jan Gerrit

Hi @jangerrit,

That open loops works is a great sign! Then I also agree that it can be related to the sensor or the PID values.

I also had a correcty working sensor data even with a wrong magnet… So the values were great, only in closed mode mode the motor still acted strangely. You can check the magnet easily with a compass. Just to be sure to excluse this problem!

I am not totally sure but looking at this site. A 12 bit encoder gives a precision 0.09 degrees of rotation per position. So that is indeed around 0.00157 radians.

You are using a quite standard motor and hardware setup. Closed loop and the sensor are both working. So I also am not sure what exactly goes wrong? Maybe that some others on the forum have extra suggestions!