Sensorless From Standstill (SFS) explained

Electric Motors and Controllers
Post Reply
User avatar
Lebowski   1 GW

1 GW
Posts: 3303
Joined: Jun 28 2011 1:38am
Location: beautiful Zurich, Switzerland

Sensorless From Standstill (SFS) explained

Post by Lebowski » Oct 29 2019 12:17pm

The pdf attached to this first post describes the technology necessary to build a sensorless FOC controller that can run a motor from standstill or a cold start / reset with full torque. The algorithm it uses to find the rotor phase delivers a continuous rotor angle, not just 6 steps like you get from hall sensors. It can be used to replace a sin/cos sensor.

The pdf contains quite some math, but the method is very 'graphics' based and is hopefully also understandable without the math. The math is necessary though if you want to play around and try to code your own version.

Page 5 to 10 is the TL;DR...

The development of this tech was covered in viewtopic.php?f=30&t=94865&p=1389515#p1389515

A video of a BLDC drill running at full torque (pulling through the highest ratched clutch setting), fully sensorless and using the algorithm: (The screw is 14 cm long and if I remember correctly 8 mm thick, drill runs at 50 A amplitude phase current)
Attachments
SFS_algorithm.pdf
(963.67 KiB) Downloaded 141 times

nieles   10 kW

10 kW
Posts: 678
Joined: Jul 14 2008 5:39pm
Location: The Netherlands

Re: Sensorless From Standstill (SFS) explained

Post by nieles » Oct 30 2019 3:42am

Hi Bas,

Thanks for releasing this, very interesting read.
I thought you wanted to sell this IP, What made you change your mind?

User avatar
Lebowski   1 GW

1 GW
Posts: 3303
Joined: Jun 28 2011 1:38am
Location: beautiful Zurich, Switzerland

Re: Sensorless From Standstill (SFS) explained

Post by Lebowski » Oct 30 2019 4:35am

nieles wrote:
Oct 30 2019 3:42am
Hi Bas,

Thanks for releasing this, very interesting read.
I thought you wanted to sell this IP, What made you change your mind?
I've never really been sure about the legal situation of selling this technology. Because I don't know the motor control literature I cannot be sure the basic idea is not patented already. And then selling it would put me in a legal mess. This can be figured out of course by a patent attorney but that would be too expensive for me.

Also, to me the whole idea is very obvious, and I was afraid it would get reverse engineered if I would show it to a company. The PWM signals not being center aligned is very easy to spot on an oscilloscope... I would be able to reverse engineer it from just that.

I thought about building a controller IC around it but that to me is just a lot of work, it would be a repeat excersize and not be interesting for me. Now if you have a controller business going on that's a different matter, but for just selling controller IC's for me it was not worth the effort. Plus again it would show the PWM signals, get reverse engineered etc etc.

My idea now is that by spreading this pdf around I hope the technology, if not patented already, becomes unpatentable and will remain in the public domain. Meaning we (EV hobbyists) can keep playing around with it. This is also the reason the pdf mentions many untested alternatives, to make those unpatentable as well.

peters   100 W

100 W
Posts: 280
Joined: Oct 20 2012 11:46pm
Location: Hungary

Re: Sensorless From Standstill (SFS) explained

Post by peters » Oct 30 2019 5:48am

This is magic.
I always thought the straightforward method would be to modulate the voltage amplitude (i.e. duty cycle) from PWM cycle to cycle and obtain the position from the changing currents, but your algorithm is very different.

User avatar
tecnologic   1 W

1 W
Posts: 54
Joined: Mar 24 2015 12:41pm
Contact:

Re: Sensorless From Standstill (SFS) explained

Post by tecnologic » Oct 30 2019 6:49am

Nice lebowsky!

kind of reminds me of https://ieeexplore.ieee.org/document/7499401

But without reading all the papers comming up with this :bigthumb:


full respect!!
regards

Tec

Punx0r   100 GW

100 GW
Posts: 5308
Joined: May 03 2012 8:16am
Location: England

Re: Sensorless From Standstill (SFS) explained

Post by Punx0r » Oct 30 2019 10:00am

Lebowski wrote:
Oct 30 2019 4:35am
My idea now is that by spreading this pdf around I hope the technology, if not patented already, becomes unpatentable and will remain in the public domain. Meaning we (EV hobbyists) can keep playing around with it. This is also the reason the pdf mentions many untested alternatives, to make those unpatentable as well.
:bigthumb:

User avatar
Arlo1   100 GW

100 GW
Posts: 8366
Joined: Apr 26 2009 10:36pm
Location: Nanaimo
Contact:

Re: Sensorless From Standstill (SFS) explained

Post by Arlo1 » Oct 30 2019 10:48am

Lebowski wrote:
Oct 30 2019 4:35am
nieles wrote:
Oct 30 2019 3:42am
Hi Bas,

Thanks for releasing this, very interesting read.
I thought you wanted to sell this IP, What made you change your mind?
I've never really been sure about the legal situation of selling this technology. Because I don't know the motor control literature I cannot be sure the basic idea is not patented already. And then selling it would put me in a legal mess. This can be figured out of course by a patent attorney but that would be too expensive for me.

Also, to me the whole idea is very obvious, and I was afraid it would get reverse engineered if I would show it to a company. The PWM signals not being center aligned is very easy to spot on an oscilloscope... I would be able to reverse engineer it from just that.

I thought about building a controller IC around it but that to me is just a lot of work, it would be a repeat excersize and not be interesting for me. Now if you have a controller business going on that's a different matter, but for just selling controller IC's for me it was not worth the effort. Plus again it would show the PWM signals, get reverse engineered etc etc.

My idea now is that by spreading this pdf around I hope the technology, if not patented already, becomes unpatentable and will remain in the public domain. Meaning we (EV hobbyists) can keep playing around with it. This is also the reason the pdf mentions many untested alternatives, to make those unpatentable as well.
Thank you for sharing this with the world.
Some times when people see your talent from the free work you release you make even more money. So don't fear it will come im sure.
Does your project need a high performance motor drive, battery charger or other power electronics developed? Let's talk!
www.powerdesigns.ca
Leaf motor controller build. http://endless-sphere.com/forums/viewto ... 27#p963227
YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
Never above 4.2v never below 2.7v EVER!!!
Support me on Patreon. https://www.patreon.com/user/posts?u=6842045
http://www.undergroundelectrics.ca/

User avatar
VasiliSk   100 W

100 W
Posts: 255
Joined: Apr 10 2014 5:11am
Location: Russia
Contact:

Re: Sensorless From Standstill (SFS) explained

Post by VasiliSk » Oct 31 2019 6:21am

Interesting. First what i thought - some sort of HFI
However need for schematic changes and extra adc channel will increase BOM cost quite.. Also i'm using PWM techniques to lower power stage losses tat is not applicable to this SFS

User avatar
Lebowski   1 GW

1 GW
Posts: 3303
Joined: Jun 28 2011 1:38am
Location: beautiful Zurich, Switzerland

Re: Sensorless From Standstill (SFS) explained

Post by Lebowski » Oct 31 2019 8:56am

VasiliSk wrote:
Oct 31 2019 6:21am
Interesting. First what i thought - some sort of HFI
However need for schematic changes and extra adc channel will increase BOM cost quite.. Also i'm using PWM techniques to lower power stage losses tat is not applicable to this SFS
The 33EV I used has a lot of ADC input, 9 or 11, am not really sure. So I use 3 for the current sensors, 3 for the LNA amplified/filtered currents and 1 for throttle. I just use the ADC in the 33EV, there is no separate ADC.

Yes, while running the algorithm will take some power but the nice thing is that you can switch off the PWM outputs completely when standing still. When you're at a traffic light for instance you can power down the output stage completely. Then when you give gas to accellerate the algorithm starts up (takes about 70 msec with the settings I used) and you're ready to go. The algorithm will take some power but this at a time when you have the initial accelleration away from the lights. And at a few kmh you can switch over to standard BEMF based sensorless FOC.
Last edited by Lebowski on Oct 31 2019 9:11am, edited 1 time in total.

john61ct   10 MW

10 MW
Posts: 2176
Joined: Dec 18 2018 2:06pm

Re: Sensorless From Standstill (SFS) explained

Post by john61ct » Oct 31 2019 8:59am

Is this tech something likely to see production units available within say a year?

User avatar
Lebowski   1 GW

1 GW
Posts: 3303
Joined: Jun 28 2011 1:38am
Location: beautiful Zurich, Switzerland

Re: Sensorless From Standstill (SFS) explained

Post by Lebowski » Oct 31 2019 9:12am

john61ct wrote:
Oct 31 2019 8:59am
Is this tech something likely to see production units available within say a year?
Send the pdf of the first post to your favorite controller manufacturer and push him to build one !

kiwifiat   100 W

100 W
Posts: 159
Joined: Mar 16 2013 5:49pm
Location: Vancouver, Canada

Re: Sensorless From Standstill (SFS) explained

Post by kiwifiat » Oct 31 2019 7:51pm

Brilliant as usual and a very generous move on your behalf.

Let us hope that someone can port this sensorless method to a cheap STM32 Arm chip so we mortals can benefit.
“You never know if quotes on the internet are genuine.” - Abraham Lincoln

User avatar
VasiliSk   100 W

100 W
Posts: 255
Joined: Apr 10 2014 5:11am
Location: Russia
Contact:

Re: Sensorless From Standstill (SFS) explained

Post by VasiliSk » Nov 01 2019 5:13am

Lebowski i dont have PWM running when throttle released coz i have phase voltage measurement. But all other inputs of current CPU is already used. Taking a bigger one is price thing. good OPAMP also pricy.

peters   100 W

100 W
Posts: 280
Joined: Oct 20 2012 11:46pm
Location: Hungary

Re: Sensorless From Standstill (SFS) explained

Post by peters » Nov 01 2019 5:26am

Couldn't the LNAs be removed and the filter implemented in the firmware? At the expense of more noise I suppose, but is it a too strong restriction? Then the existing circuits would be compatible.
In my case 10-15 ADC pins are quickly used up, because I measure all power supplies, 2 temperature sensors, 2 throttles, 3 phase currents and the 3 phase output voltages.

User avatar
Lebowski   1 GW

1 GW
Posts: 3303
Joined: Jun 28 2011 1:38am
Location: beautiful Zurich, Switzerland

Re: Sensorless From Standstill (SFS) explained

Post by Lebowski » Nov 01 2019 6:55am

I think without LNA the bit where you determine the MSB (or: the 0-180 decision) will not work as the signal wil be too small. Plus the LNA limits the amount of harmonics sampled by the ADC and makes digital filtering easier. I would not go without LNA.

User avatar
tecnologic   1 W

1 W
Posts: 54
Joined: Mar 24 2015 12:41pm
Contact:

Re: Sensorless From Standstill (SFS) explained

Post by tecnologic » Nov 01 2019 7:02am

If u have a true 16bit signal u could eliminate the LNAs because the gain of 30dB of those LNAs is about 32x so that's 5 bits u need. And most current systems do not have the resolution for this.

Even though the Rx part of this approach is novel compared to recent sensorless motor control literature it faces the same physical problems and that's SNR. So I like lebowskys analogue approach to raise his snr by a few opamps.

The mcp6022 is fairly standard and no low noise beast for 10buks a piece.
regards

Tec

User avatar
Lebowski   1 GW

1 GW
Posts: 3303
Joined: Jun 28 2011 1:38am
Location: beautiful Zurich, Switzerland

Re: Sensorless From Standstill (SFS) explained

Post by Lebowski » Nov 01 2019 7:14am

Or, Peters, if you have one extra ADC channel and dont use the 3 from the current sensors you can
- do Clarke transform in the analog domain with no filtering and no gain, use those for you FOC control. Takes 2 ADC channels
- build a 2 channel LNA using the Clarke transformed signals, the LNA output signals then also need 2 adc channels.

The circuit on page 67 implements the Clarke transform of page 55

The mcp6022 is roughly $1.20 at digikey, the 33EV128GM006 processor I used is $3.50 and has 36 ADC inputs

User avatar
Lebowski   1 GW

1 GW
Posts: 3303
Joined: Jun 28 2011 1:38am
Location: beautiful Zurich, Switzerland

Re: Sensorless From Standstill (SFS) explained

Post by Lebowski » Nov 01 2019 8:49am

tecnologic wrote:
Nov 01 2019 7:02am
If u have a true 16bit signal u could eliminate the LNAs because the gain of 30dB of those LNAs is about 32x so that's 5 bits u need. And most current systems do not have the resolution for this.

Even though the Rx part of this approach is novel compared to recent sensorless motor control literature it faces the same physical problems and that's SNR. So I like lebowskys analogue approach to raise his snr by a few opamps.

The mcp6022 is fairly standard and no low noise beast for 10buks a piece.
The LNA also filters away the higher harmonic of the tx-ed square wave signals. So for instance the 5th of your 20kHz pwm at -100 kHz is suppressed, while with a 16b ADC it will be unsuppressed in your spectrum somewhere, and you'll need heavier digital filtering to get rid of it. Also getting rid of the very strong motor powering signal close to DC prevents intermodulation caused by ADC non linearities.

With the LNA the typical 1 MHz 9.5 Enob ADC of your average microcontroller is more than enough...

User avatar
tecnologic   1 W

1 W
Posts: 54
Joined: Mar 24 2015 12:41pm
Contact:

Re: Sensorless From Standstill (SFS) explained

Post by tecnologic » Nov 01 2019 9:03am

Lebowskys, I'm totally with u in that point. But I wanted to point out what will be needed to just get away with digital filtering. And just to be clear I mean an enob of 16bit not a 16bit adc!
regards

Tec

User avatar
Lebowski   1 GW

1 GW
Posts: 3303
Joined: Jun 28 2011 1:38am
Location: beautiful Zurich, Switzerland

Re: Sensorless From Standstill (SFS) explained

Post by Lebowski » Nov 01 2019 9:18am

tecnologic wrote:
Nov 01 2019 9:03am
Lebowskys, I'm totally with u in that point. But I wanted to point out what will be needed to just get away with digital filtering. And just to be clear I mean an enob of 16bit not a 16bit adc!
some people may remember the v2 controller IC having an HF sensorless mode... that was the first time me playing around with this. Instead of at the PWM frequency it outputted a 1kHz sine wave signal rotating in only one direction and did not use a LNA. It worked but not very good. I didn't know yet about sending two the same frequencies but with different polarity would get rid of the (motor) phase delay impact. I did know it would be interesting to try it at PWM frequencies but the 30F chip cannot do non-center alligned PWM. Only when I got the ZIF socket for the tqfp64 pin 33EV could I try all this out... but by then I was sitting on this for like 3 years already.

User avatar
HighHopes   10 kW

10 kW
Posts: 860
Joined: Mar 28 2013 6:25pm

Re: Sensorless From Standstill (SFS) explained

Post by HighHopes » Nov 02 2019 9:35am

now that's a nice post! i was there when the aerospace engineers developed and patented realistic methods of doing zero start full torque sensorless (before electric vehicles were a "thing"). i've read pretty much all the patents and was involved in some of the development. using negative sequence component and higher frequency injection to get up to a certain speed (and then let bEMF method take over) is the typical way but HOW you do that is what makes it practicacl or not. the way you describe in this paper i think its unique, the pwm shift method you describe, so coo-dos for that! i think your paper is an original contribution to the body of knowledge, very enjoyable read. thanks again for the post :)
Does your project need a high performance motor drive? Let's talk!
www.powerdesigns.ca
Do you like our work? Support Axiom to win the 2019 Hackaday Prize!

marcos   1 kW

1 kW
Posts: 318
Joined: Nov 19 2016 11:38pm

Re: Sensorless From Standstill (SFS) explained

Post by marcos » Nov 03 2019 10:26pm

That's a very awesome and valuable contribution Lebowski, thanks!!

I'm not sure the STM32F4 can handle this non-center-alignement phase shift, I think it requires the coordination of many many timers. In any case, I sent the tip to benjamin vedder, we was considering this kind of signal injection so I'm hopeful that your method could reach many many riders!
Does your project need a high performance motor drive? Let's talk!
www.powerdesigns.ca
Do you like our work? Support Axiom to win the 2019 Hackaday Prize!

User avatar
Lebowski   1 GW

1 GW
Posts: 3303
Joined: Jun 28 2011 1:38am
Location: beautiful Zurich, Switzerland

Re: Sensorless From Standstill (SFS) explained

Post by Lebowski » Nov 04 2019 1:41am

marcos wrote:
Nov 03 2019 10:26pm
That's a very awesome and valuable contribution Lebowski, thanks!!

I'm not sure the STM32F4 can handle this non-center-alignement phase shift, I think it requires the coordination of many many timers. In any case, I sent the tip to benjamin vedder, we was considering this kind of signal injection so I'm hopeful that your method could reach many many riders!
Seems way over the top, a 32F4... but they are cheap too so I get it. I like the 33EV I use, mainly because it is a 5V chip and can sample 4 analog inputs at once. Because you also need to sample all LNA outputs at the same time (at 20 kHz 1 usec sampling delay corresponds to 7 degrees). Plus the 33EV has more than enough processing power. And finally Microchip documentation for their processors is really elaborate and extensive.

User avatar
methods   10 GW

10 GW
Posts: 4601
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Sensorless From Standstill (SFS) explained

Post by methods » Nov 08 2019 2:50am

Rad work.
I wish I had the attention span right now to enjoy it. I will mark it for while I am in Washington on Vacation.

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
methods   10 GW

10 GW
Posts: 4601
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Sensorless From Standstill (SFS) explained

Post by methods » Nov 08 2019 2:53am

Arlo1 wrote:
Oct 30 2019 10:48am

Thank you for sharing this with the world.
Some times when people see your talent from the free work you release you make even more money. So don't fear it will come im sure.

This is truth.
Sadly the efficiency is about 0.1%, but it is there.

I have tested this theory

...

When all your teeth have fallen out
When you have no more friends
When you live in a van by the river

... one person will show up who remembers your hard work and they will give you a shot :wink:

(As a hiring manager I actually credit folks heavily for DIY contributions to the community. I encourage others to do so as well)

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

Post Reply