Lebowski's motor controller IC, schematic & setup, new v2.A1

Lebowski said:
I actually want to sense changes in phase inductances (to deduce position) while powered, i do not want something where i have to alternate between powering and sensing. The video a few posts back was sensing and powering at the same time.
Lizardmech comment about enough resolution ('Dynamic Range') is correct and is the reason for the analog pre-processing.
How do you find the performance of the allegro ACS sensors in general? I have only used resistive current sense in the past but allegro now have some nice 100V high current SMD models and their existing models were upgraded with more bandwidth. It's almost impossible to find any performance comparison between the different current sensing options around or information about if you should prioritize bandwidth, rise time or other characteristics when selecting them for motor control.
 
I prefer proper current (magnetic field based) over resistive ones for the simple reason that if you want to keep the power dissipation the same, the higher the current rating of the resistor the lower the effective voltage you'll get.
A 1W sense resistor for 1A can deliver 1V signal, a 1W for 1000A will only deliver 1mV signal, with only 1uV per A.

I would say phase delay through the sensor is most important, as this delay translates to an offset between motor voltage and current
 
The specification on the Allergro ACS states a response time of 4us and bandwidth of 120 kHz. Seems just barely fast enough.
 
Response time seems to be the biggest weakness on the ACS, at least on the high current versions. They have 1mhz versions with sub 1us propagation but they never release them in the high current versions for some reason. The INA240 I have been using recently is faster but they are limited to 80V and shunt resistor heat is an issue, you gain a few watts worth of heat at 100A+ and accuracy theoretically suffers as resistance changes. An isolated current shunt amplifier I tried is faster than high current ACS but still had the down sides of resistive sense. I'm not sure how fast is fast enough for motor control, considering a worst case scenario of a motor with 200,000 ERPM you still have around 300us per electrical cycle?
 
While researching giant magnetoresistance I discovered these isolated current sensors today, a little more expensive than ACS but sub 1us response time and high bandwidth.
https://www.sensitec.com/products-solutions/current-measurement/cds4000-family
 
Hm I don't know, 120kHz bandwitdth for the ACS parts seem good enough to me. 100k-erpm translates to 1.6 kHz, a pole at 120kHz would give a phase rotation of less than 1 degree. Cycle time of the algorithm is in the order of 30usec, so 4 usec delay in the current sensor doesn't seem relevant.
 
Been very busy here with the saliency (?) based position detection, want to detect the rotor phase at standstill by measuring the differences between the motor inductances.

And I want it good, just dividing the rotor position in 60 degree portions (like what you get with hall sensors) will not be good enough, I want like 8 bits or so. Basically the goal is to get phase info as if there was a resolver, but then without the resolver but based on the motor inductance info.

The level of processing this needs is staggering. To get 8 bit info is actually quite simple (but needs a trick that took me 5 days to figure out), the MSB though (the bit saying we're between 0-179 or 180-359 degrees) is a real #@$%#^*$&*. Been playing with sending out a bit pattern in the Field weakening dimension (Id or Iq, don't know what it is called officially, I call it I_imag), using matched filters etc to detect it back in the saliency and then based on inversion or not decide the MSB. This kinda worked but was horribly unreliable and audible noisy to boot (oh yeah, another thing is I don't want a loud tone or anything like that).

Also had to start using the DSP as simple first order lowpass filtering is no longer good enough. Have now switched over to FIR filtering and doing stuff like sample rate conversion.

I do now have something that works for deciding the MSB, but it does not work always. I already figured out why this is and also how to fix it, but it will again put an extra layer of complexity on top. Luckely at the moment I am nowhere near the limit of the processor, the one I have now does 70 M instructions per second versus 30 for the 30F.

Good thing it is so complex though, with me being out of a job at the moment it is a fun project to keep me busy (though with the summer going on here there is also lots of cycling and motorbiking to be done :D )
 
That sounds very interesting.

This kinda worked but was horribly unreliable and audible noisy to boot

So you calculate the rotor position without injecting any pwm pattern and without injecting any "I_imag" (Id) currents?
Do you measure the Ld and Lq inductance (anisotropy) while the deadtime and turn-on time of the mosfets?
 
I think the deatime is too short (set for 500nsec) to get anything useful out... plus there is phase current flowing to make the motor turn, effectively forcing what happens during deadtime...

Putting a pattern on the I_imag was like the neutral light on my old Moto Guzzi, it was right about 80% of the time... the 20% when it is wrong can be really dangerous though...
 
I have read a paper where they used an FPGA to measure the currents @20MHz, but I also think
that deadtime is too short and full of noise because of the switching FETs.

Than you inject some kind of short pwm pattern like INFORM method and calculate the current derivative, right?
Do you have two different algorithms for low and high speed?
 
In INFORM (indirect flux detection using online reactance measurement) some pwm patterns are applied "out of order" of field oriented control and measure the current derivative depending on voltage.
This method is much quieter than injecting current waves on imaginary axis (I_imag).

Requires your algorithm measurement of phase voltages or do you measure only the currents?
 
No u get only a position every 6th pwm cycle. But this depends on the implementation. Prof. Schrödl located in Wien proposed this method.

I would expect because of the analog circuitry u have to increase current resolution. u will sample the current at lets say 40% and 60% of pwm cycle with PWM switiching at around 50% und build the current deravative?
 
Just spent 2 days programming, but ran into a problem with the 33EV I'm using... some obscure mistake in the silicon explained in the errata (but who reads those ?). Luckely there's other ways to skin a cat...
 
:D my idea for getting full 360 info has worked, now I get reliable info about whether the phase is 0-179 or 180-359. So all combined I now get full 360 degree info (smooth, not just 6 levels) about the rotor position, sensorless at standstill. Processing time is around 10 to 20 msec for the first reliable output after a cold start, after that it should be able to keep up until it shifts to backemf based sensorless. The short processing time makes that the controller can switch off the output stage while waiting for the traffic lights, and switch on only at throttle up. And independent of whether you rolled backwards or forwards, and without needing to accurately sample motor voltages (doesn't need motor voltages...)

There is still a big mistery in there somewhere that I need to look at... a case of a polarity being different from what I expected. If I just dumbly take this into its stride it will work, I'm just curious why it is different and I want to understand this.

Next step is to add phase current.... I have kept this in mind and it should be OK, but you never know...
 
Thats real world science fiction, better than ..?.!... (fill in whatever you like :mrgreen: )
 
Lebowski said:
:D my idea for getting full 360 info has worked, now I get reliable info about whether the phase is 0-179 or 180-359. So all combined I now get full 360 degree info (smooth, not just 6 levels) about the rotor position, sensorless at standstill. Processing time is around 10 to 20 msec for the first reliable output after a cold start, after that it should be able to keep up until it shifts to backemf based sensorless. The short processing time makes that the controller can switch off the output stage while waiting for the traffic lights, and switch on only at throttle up. And independent of whether you rolled backwards or forwards, and without needing to accurately sample motor voltages (doesn't need motor voltages...)

There is still a big mistery in there somewhere that I need to look at... a case of a polarity being different from what I expected. If I just dumbly take this into its stride it will work, I'm just curious why it is different and I want to understand this.

Next step is to add phase current.... I have kept this in mind and it should be OK, but you never know...

Great work Lebowski, any chance this will be back ported to the 30F4011?
 
Great Work Bas, looking forward to this. Maybe its time your new chip and software had a thread of its own. Stop people getting confused. :D
 
Hi Bas, good job!

Is there a possibility to make a schematic like for 30F? I am in the middle of multi inverter project where i am committed to your design, but pinout is very general. I could just make a new brain board with same pinout if i had new chip schematic. Would it be powered from 5V or is it 3V3? In that case i would have to adapt signalling... :(.
Does your sensorles start require any outside elements?

tnx

Arber
 
Its a 5V chip (a 33EV from microchip), but for now it is all very early stages. Main thing to see is how it holds up under high throttle...

I have some opamp circuits, mainly to help the ADCs...
 
having been dusting off the controller.

However now it wont even spin the motor. All calibrations run without an issue.

However it sometimes will not go out of drive 1 or keep flashing the led and not power the stage up.

The hex is below.

Code:
version:293_
0x0133	0xFFFF	0xFFFF	0x0503	0x03C2	0x0001	0x0001	0x0000
0x0400	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0x0370	0x25DB	0x7FBC
0x7D2E	0x0030	0x070E	0x050E	0x2324	0x000B	0xFFFF	0xFFFF
0xFFFF	0xFFFF	0x795E	0x0400	0xB76C	0x000A	0x0000	0x07AE
0x0018	0x0000	0x01E0	0xFFFF	0xF852	0xFFE8	0x0000	0xFE20
0x0000	0x4CCD	0x0018	0x0000	0x01E0	0xFFFF	0xB333	0xFFE8
0x0000	0xFE20	0xF965	0xFF07	0xFFFF	0xFFFF	0x2141	0xFFFF
0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF
0xFFFF	0xFFFF	0x000F	0xF71A	0x0812	0x0060	0x0033	0x0000
0xFFFF	0x0000	0x01AB	0x00D5	0x03F7	0x03F0	0x03F0	0x0EA5
0x0581	0x002D	0x06E2	0x0005	0x0C99	0xFFF8	0x036F	0x1000
0x0000	0x0000	0x1000	0x0000	0x0000	0x0188	0x01D8	0x003B
0x0000	0x06AD	0x0055	0x0473	0x0590	0x0350	0x0258	0x0064
0xFFFF	0xFFFF	0xFFFF	0xFFFF	0x0003	0x0000	0x0078	0x0000
0x0000	0xFFFD	0x0000	0xFF88	0x0000	0x0000	0x0005	0x0000
0x0064	0xFFFB	0x0000	0xFF9C	0x000C	0x0000	0x00F0	0xFFF4
0x0000	0xFF10	0x05CC	0x014C	0x0183	0x0301	0x0356	0x0080
0x0226	0x0301	0x0013	0x0010	0x0E10	0x03E8	0x03B6	0x6000
0x0200	0x00C0	0x4000	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF
0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF
0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF
0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF
0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF
0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF
0xFFFF	0xFFFF	0xFFFF	0x0000	0x0000	0x0000	0x0005	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0xFFFF
0xAAAA	0x6666	0x4924	0x38E3	0x2E8B	0x2762	0x2222	0x1E1E
0x1AF2	0x1861	0x1642	0x147A	0x12F6	0x11A7	0x1084	0x0F83
0x0EA0	0x0DD6	0x0D20	0x0C7C	0x0BE8	0x0B60	0x0AE4	0x0A72
0x0A0A	0x09A9	0x094F	0x08FB	0x08AD	0x0864	0x0820	*
 
Back
Top