Motor doesn't spin, only squeaks (FOC with encoder)

Discussions regarding the Field Oriented Control (FOC) implementation on the VESC.
Cristian
Posts: 10
Joined: 06 Jul 2017, 00:29
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Motor doesn't spin, only squeaks (FOC with encoder)

Postby Cristian » 13 Sep 2017, 03:01

Hi all,
I'm trying to use the VESC for a robotics project, my main use cases are position control and RPM control (need high torque at low RPM)
I'm using brushless motors with AS5047P encoder in ABI mode
What I did so far:
- configured currents and voltages (6S battery) and FOC mode in Motor tab
- set encoder to ABI and encoder counts to 8192 in Advanced tab
- did the measurements and applied values in FOC tab, also changed the sensor mode to Encoder
- detected the encoder using 10A current, checked that it works ok in the Rotor Position tab (it's smooth)
- apply and save after every step

Now the problem is that the motor doesn't really spin in any mode I try from the Control group on the right, it just squeaks and that's about it
I tried to tune PID settings in the advanced tab for Speed control. When looking and the Realtime data tab at the current graph it goes over 10A which I used to detect the encoder but it doesn't spin. The motor turns smoothly and then in steps while detecting the encoder as I've seen in videos so I'm quite sure the motor is fine and so is the VESC

This is how the current graph looks like when using RPM control at 1500 RPM, motor doesn't spin
current.jpg
current.jpg (224.65 KiB) Viewed 2140 times


I'm missing something and I'm out of ideas as to what to try, please help!

pf26
Posts: 310
Joined: 28 Mar 2016, 14:37
Location: FR Valence
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Motor doesn't spin, only squeaks (FOC with encoder)

Postby pf26 » 13 Sep 2017, 07:58

Did you try to make the motor spin in sensorless FOC mode ?
It seems like it works in BLDC mode (so using Bemf).
Most likely there is an issue with your current measurements (see Bemf Plot, Currents tab.) to check.
What motor do you use ? What were the detected parameters in FOC (R and H) ?

rew
Posts: 943
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Motor doesn't spin, only squeaks (FOC with encoder)

Postby rew » 13 Sep 2017, 09:50

Even I have been able to mess things up so that a "read default configuration" followed by "write configuration" would revive hardware that I thought had died....

Cristian
Posts: 10
Joined: 06 Jul 2017, 00:29
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Motor doesn't spin, only squeaks (FOC with encoder)

Postby Cristian » 13 Sep 2017, 11:21

FOC tab looks like this
foc.jpg
foc.jpg (305.96 KiB) Viewed 2129 times


The motor is the 190kv version of this , I hope it's ok to post links like this

One detail I forgot to mention is that while I was trying to get Position Control to work I had max amps configured to 60A and if I would let it in Position Control mode it would start to smell after 3-5s and I saw smoke from the motor after like 10s (that motor still works but I switched to experimenting on another one just to be sure) Now I have max amps set to 20A

From those settings if I change from Encoder to Sensorless all control modes work

Prevas_erra
Posts: 24
Joined: 11 Apr 2016, 16:03
Location: Stockholm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Motor doesn't spin, only squeaks (FOC with encoder)

Postby Prevas_erra » 13 Sep 2017, 12:35

You probably have to change the tuning of the PID settings for speed and position when using an encoder instead of sensorless.
So start with a low P and zero I and D to see if you can get it to start. Increase P and add I and D until you get the response you want.
Nobody can tell you what you should use for PID values.

pf26
Posts: 310
Joined: 28 Mar 2016, 14:37
Location: FR Valence
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Motor doesn't spin, only squeaks (FOC with encoder)

Postby pf26 » 13 Sep 2017, 12:38

Did you try to simply have the motor to turn if encoder FOC (in current controlled mode) ?
If the motor turns in sensorless FOC than it means current sensing is ok, and most likely your encoder signals get perturbated when the motor is powered. You may have a look at the Rotor Position tab once the motor is wanted to start.
Did you change the resistors, remove the capacitors as required when using the encoder instead of the hall sensors ?
Otherwise you may try to move the encoder wiring away from the power cables, and possibly try to scope the +5V and ABI signals.

Cristian
Posts: 10
Joined: 06 Jul 2017, 00:29
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Motor doesn't spin, only squeaks (FOC with encoder)

Postby Cristian » 13 Sep 2017, 14:05

I did try all the control modes and the behavior is the same, it looks like it tries to turn but it just squeaks
I did not replace resistors or remove capacitors, I was thinking about that but the rotor position looks so good I thought it's not needed for ABI
Power lines are 3in/8cm away from encoder wires
Here is a screenshot with the rotor position while trying to detect the encoder, it looks ok to me with motor powered
encoder.jpg
encoder.jpg (194.6 KiB) Viewed 2120 times


I can of course do that if that's the problem, I tried to avoid modifying it as I don't have experience with SMD components

ThierryGTLTS
Posts: 86
Joined: 09 Aug 2017, 11:10
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Motor doesn't spin, only squeaks (FOC with encoder)

Postby ThierryGTLTS » 13 Sep 2017, 15:22


Cristian
Posts: 10
Joined: 06 Jul 2017, 00:29
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Motor doesn't spin, only squeaks (FOC with encoder)

Postby Cristian » 14 Sep 2017, 06:14

So I removed the capacitors and the resistors and now it works!

What was weird before was that when running the detection for the encoder multiple times the offset was always different...pretty much random but now it is the same every time (with some margin for error ofc)

Thank you all for your help!

pf26
Posts: 310
Joined: 28 Mar 2016, 14:37
Location: FR Valence
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Motor doesn't spin, only squeaks (FOC with encoder)

Postby pf26 » 14 Sep 2017, 06:29

The offset was different each time because the resistor-capacitor of the hall filter introduces a delay in the signal. And depending upon at what speed you reached the Index, this delay would translate in a more or less large offset angle.
The position accuracy has to be quite good iin FOC since we have several poles per turn, and an error of a quarter of 360/(pole count) can make the torque drop from max to 0.


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Return to “FOC”

Who is online

Users browsing this forum: No registered users and 1 guest