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

Ok My serial port won't show up in labview.

Moving on. I went through all the other items on my list and got my leaf inverter running perfectly on the bench all the way up to max voltage (458v close enough for bench testing) Video to come with a post in my thread.
I just had to change a few simple things for recovery and a few other things then I found I could not go full throttle in drive 2 (hall sensored) so I kept trying the simple things like eRPM and how many cycles etc. But I could not get it to work right with those settings so I messed around in the control loop coefficients and eventually looking at the manual I found I think you made a error.

The autocomplete sends
E to 480
F to 48
G to .0299

In the manual you say
This automatic advance comes
on top of the advance of coefficient c,f. For stability d,g must be less than 1/40th of c,f.
But 48/40 = 1.2 not .0299.... So I just shifted G a order of magnitude up to .3 and it worked perfectly!
Now I might even want to go to below 1.2..... ? For now it runs on the bench so I'm not worried but once I put a load on it I might want to look at this again.
 
Lebowski said:
I had a look at your hex, you did not calibrate for the FOC (menu i)

I see you've set it for 10mV/A, which would be for around 200 A sensors. Everything is scaled according to this, so the absolute value is not that important. For instance with 50A phase current you are basically saying that the phase current can be 25% of the sensor range. The controller IC does not care about how many Amps etc, it sees everything as so and so many % of current sensor range.

That it does not exit drive mode 1 makes me thing something is going on with the power stage. With the motor disconnected, did you use the PWM check function to make sure all 3 outputs work independently of each other (check for instance with 5%, 50% and 95% dutycycle). If you don't have a scope you can use a multimeter to check the terminal voltage is roughly dutycycle% times battery voltage.

Make sure the power stage is OK before running the FOC measurement !

It can be the controller is stuck in drive 1 because the current sensors are really off and need to be calibrated.

In drive_1 it basically waits for the currents to be less than specified in menu k, option h. If the current sensor offset is move than specified here it will not exit drive_1...

Good news and bad news. Did some checking and yet again found things that had to be corrected. Got the drives working properly. While testing without a motor I noticed the heatsink get a little warm. Should have dialed back my switching frequency. Set to the standaard of 18khz, since these are IGBT/drivers from 2007 I believe they wont be driven anywhere near this frequency.

The good news, after hooking the motor back up It did make some attempts to go into drive mode 3, I was quite happy it did. however during the trying hear a lil pop, not the ear shattering noise I heard when blowing a Thrysitor once. So I taught must be a minor issue, turned everything off waited, noticed the heatsink was hand warm. Turned it back on, the powerstage was drawing 2 amps instead of 1 :evil: Unhooked the motor and checked the pwm, and again when testing pwm the stage draws 2 amps from the 12 volt supply, and nothing switches. This means this unit now is toast and I will have to get another, makes the destructive removal of the current sensor an easy task.
 
You didn't have a datasheet for the module specifying max pwm frequency and minimum deadtime ? Did you start with long deadtime and reducing it, all the time observing battery current ? What is the type number of the module ?
 
Its inside a OEM inverter, with unknown driver. Taught that would protect it some more. Max battery current read on my current probe was 39 amps. Its also fused at 100 amps so a true hard fail would blow the fuse. So not really sure what failed and why. Need to do some destructive digging i believe. Deadtime was 600ns same as i used before when driving an induction motor. So i guess pwm frequency is the issue.
Luckly in Holland these inverter modules are plentiful and only 100 euros a piece. So replacing a complete module is no biggy, plus got alot of spares from the now broken one.
 

Attachments

  • WP_20150219_0061.jpg
    WP_20150219_0061.jpg
    180.3 KB · Views: 2,516
Here is my last hex file.
Code:
 0x0CA6  0x031C  0x005F  0x6556  0x173A  0x097B  0x2567  0x0061                  
0x000C  0x0006  0x7FBC  0x007F  0x0000  0x0020  0x8000  0x009F                  
0x004F  0x012E  0x03B2  0x039F  0x03A2  0xAAAA  0xAAAA  0xAAAA                  
0x0BB8  0x0BB8  0x008F  0x0D05  0x0003  0xE66C  0x1CA0  0x1000                  
0x0000  0x0000  0xFFFF  0xFFFF  0xFFFF  0x0089  0x0376  0xFFFF                  
0xFFFF  0x027E  0x0036  0x0223  0x0111  0x01C0  0x0258  0x0064                  
0x0004  0x0004  0x000E  0x0298  0x0000  0x999A  0x0030  0x0000                  
0x01E0  0xFFFF  0x6666  0xFFD0  0x0000  0xFE20  0x0000  0x4CCC                  
0x0030  0x0000  0x01E0  0xFFFF  0xB334  0xFFD0  0x0000  0xFE20                  
0x0003  0x0000  0x0078  0x0000  0x0000  0xFFFD  0x0000  0xFF88                  
0x0000  0x0000  0x0000  0x0000  0x0003  0x0000  0x00C8  0x0000                  
0x0000  0xFFFD  0x0000  0xFF38  0x0000  0x0000  0x000C  0x0000                  
0x00F0  0x0000  0x0000  0xFFF4  0x0000  0xFF10  0x01DB  0x1075                  
0x01C9  0x05B0  0x02AB  0x00F3  0x0411  0x7530  0x05B0  0x0024                  
0x0438  0x0042  0x0010  0x0E10  0x0000  0x05DC  0x0190  0x1194                  
0x03B6  0x6000  0x0088  0x05B2  0xFF00  0xDC3F  0x323F  0x073F                  
0x873F  0xB23F  0x5C3F  0xFF00  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  0x0907  0x0032                  
0x0005  0xFFFF  0xC519  0x764B  0x5482  0x41B3  0x35C3  0x2D7A                  
0x276B  0x22C9  0x1F1E  0x1C28  0x19B5  0x17A6  0x15E6  0x1463                  
0x1312  0x11EB  0x10E4  0x0FFB  0x0F28  0x0E6B  0x0DC0  0x0D23                  
0x0C94  0x0C10  0x0B97  0x0B27  0x0ABF  0x0A5F  0x0A05  0x09B1                  
0x0962  *
 
Lebowski I think I hit a rev limiter 800 rpm early....
I guess lab view would be more accurate I was trying out some field weakening on the bench but after the motor shook like it was at a rev limit I decided to call it and start installing it in the car.

I set the rev limiter for 10500 rpm its a 4 magnet poll pair motor and I set the erpm limit to 41.99 k erpm
But it seemed to be stopping at 9756 rpm which is 39k erpm it seamed like it was a rev limit so I stopped because at this voltage with all the loose wire it would have been a disaster if the motor locked up....

[youtube]gDxsox0T0Yo[/youtube]
 
The rev limiter is really only meant to prevent over-revving the motor, it is built in the same way as for an ICE.
When the controller hits the set rpm it internally closes the throttle and waits for rpm to drop, then activates the throttle again. This causes fast alternating accelleration decellaration as power is applied or not, and is causing the shaking you reported. As the power is removed when it hits the set rpm, the overall average rpm will be a bit lower than the set value but it all depends on you system. The fact that it can deal with basically instantaneous throttle on - off means the system is setup good (if it fails this it needs some adjusting of the control loop parameters). Also, all speed and frequency settings of the controller IC use as a reference the 30 MHz oscillator inside the chip. This one has a few % in-accuracy.

Can't wait for the video of the first testrun !!!
 
Got my current sensor measured, it comes down to about 0.00580 v/Amp or some where around 350 amp at 2 volts offset as most current transformers usually spec this. Got this from different measurements using multiple turns through a sensor and monitoring the output while varying the current with a lab supply and a light bulb, while measuring the current with the multimeter.

Getting my new powerstage in this week, I will start at a pwm frequency of 4 khz and deadtime of 1000ns to be safe. Are these realistic values to start at?
 
Tomdb said:
Got my current sensor measured, it comes down to about 0.00580 v/Amp or some where around 350 amp at 2 volts offset as most current transformers usually spec this. Got this from different measurements using multiple turns through a sensor and monitoring the output while varying the current with a lab supply and a light bulb, while measuring the current with the multimeter.

Getting my new powerstage in this week, I will start at a pwm frequency of 4 khz and deadtime of 1000ns to be safe. Are these realistic values to start at?
Based on Arlins, he started with 2u-sec deadtime...
 
Lebowski said:
Tomdb said:
Got my current sensor measured, it comes down to about 0.00580 v/Amp or some where around 350 amp at 2 volts offset as most current transformers usually spec this. Got this from different measurements using multiple turns through a sensor and monitoring the output while varying the current with a lab supply and a light bulb, while measuring the current with the multimeter.

Getting my new powerstage in this week, I will start at a pwm frequency of 4 khz and deadtime of 1000ns to be safe. Are these realistic values to start at?
Based on Arlins, he started with 2u-sec deadtime...
Its in my thread and a couple others.
Look for posts by high hopes.
Dead time is a mathematical equation for a safe amount of off time between low and high power switches.
You need to look at worst cast for both IE. what's the fastest one side can turn off and what's the fastest the other can turn on look at all the temperatures and make sure you allow for a change in gate voltages and make sure you add in you fet driver and boost stage as well. As well make sure Dead time does not exceed 5% of total switching time.

i made a long post about it sometime before. but you have the gist of it. deadtime is the min time needed between the slowest a thing can turn OFF and fastest it can turn ON. you have to start at the output of the brain, a digital signal, and look at all the filters time delays, component datasheet, and effect of temperature. when you're done that assessment, add 10%, that's your deadtime. the 10% is to cover graph eye-balling inaccuracies and other things you didn't consider (too far into the detail to care when simple 10% will cover it).

typically the major players are the gate drive IC, boost stage if you have one, IGBT delay, IGBT rise/fall.

in your chart you post, for the gate drive resistance you have, look at tON. that is your ON delay. tOFF, taht is your OFF delay. tr that is your rise time (time to switch ON) and tf is yoru fall time (time to switch off). so the IGBT to turn on is like this: tON + tr. how fast can that happen, let's assume you have 1 ohm gate resistor (makes it easy). it's interesting the switching time vs. current. notice how the graph goes only as low as 200A? but in motor drive application you will have from 0 A all the way up to some very high max value. so you have to estimate where that curve will be around 0A. now you might argue, that current is so low at 2 or 5 Amps, why look so near zero at the graph? because *IF* a shoot-through happens when controller asking for 4Amps, it will go from 4Amps to 1000A in 10's of micro seconds.. so we care. the trick is to try and look at the curves to find at which current you have the greatest delta difference for longest OFF time vs. fastest ON time.

you didn't show how these curves are affected by temperature, so we'll tackle that next. for now, just make the math for the IGBT by itself considering only teh temp at which the graphs were taken and then we'll discuss. when you get it right, we'll move on to include the other components.

https://endless-sphere.com/forums/viewtopic.php?f=30&t=35387&p=1013225#p1013225
 
Plus, when you are testing, changing pwm frequency and deadtime etc, always keep an eye on the battery current.

Spinning a small motor only costs a few 10's of Watts, any extra power in turned into heat. If your controller all of a sudden takes a few 100 W you can be sure you have shootthrough or other nasty stuff happening in the output stage. The battery current is a first indicator for this !
 
[strike]Okay got it all setup again with the new inverter. However something wierd is going on, current sensor calibration. Two channels jump to 2560 mv offset, i do not know If the micro looks for a 2500mv as a 0 reading. This would mean two of my sensor are shorted to ground. When unplugged im getting a reading of 2.5 volts, then plug in two read 0 and one reads 2.5v coming to think of it I should go back to the shed and do some testing soon because this might be the only thing holding me up right now.[/strike]
Effect of the offsets, when not set the drive does not want to go into drive 1 stably and goes to drive 0 at throttle (most likely overcurrent protection). When set the motor just pulses back and forth throttle only increase current slightly (limited by setting).
Stupid me, fixed the sensor issue, now all sensors read an offset of ~mv. However the motor remains to wriggle, increasing the throttle,current, causes it to wriggle more and jump around. Right now I got a similair motor to this one hooked up, swapped because this one has a lower cogging feel to it.
http://www.hobbyking.com/hobbyking/store/__14342__NTM_Prop_Drive_Series_35_36A_1400Kv_550W.html

Any idea what parameters I should look at, one other note during FOC measurement it only makes a tone and does not spin. :cry:

Hex posted below
Code:
0x01D9	0x18AE	0x0001	0xC174	0x037E	0x01BF	0x059F	0x00DF
0x0086	0x002C	0x7FBC	0x0055	0x0000	0x0015	0x8000	0x006A
0x0035	0x00CA	0x03F3	0x03F3	0x03F5	0xAAAA	0xAAAA	0xAAAA
0x0EA5	0x03D7	0x008F	0x14AB	0x0002	0xE676	0x0380	0xFFFF
0xFFFF	0xFFFF	0x1000	0x0000	0x0000	0xFFFF	0xFFFF	0x016B
0x01F4	0x01AB	0x007A	0x0356	0x0356	0x04C4	0x0258	0x0064
0xFFFF	0xFFFF	0xFFFF	0xFFFF	0x0000	0x999A	0x0030	0x0000
0x01E0	0xFFFF	0x6666	0xFFD0	0x0000	0xFE20	0x0000	0x07AE
0x0030	0x0000	0x01E0	0xFFFF	0xF852	0xFFD0	0x0000	0xFE20
0x0003	0x0000	0x0078	0x0000	0x0000	0xFFFD	0x0000	0xFF88
0x0000	0x0000	0x0000	0x0000	0x0003	0x0000	0x00C8	0x0000
0x0000	0xFFFD	0x0000	0xFF38	0x0000	0x0000	0x000C	0x0000
0x00F0	0x0000	0x0000	0xFFF4	0x0000	0xFF10	0x05CC	0x0174
0x056B	0x0907	0x00D5	0x0059	0x0180	0x7530	0x0907	0x0039
0x0FAE	0x0042	0x0010	0x0E10	0x0000	0x03E8	0x00C8	0x2FAD
0x03B6	0x6000	0x01EB	0x0219	0xFFFF	0xFFFF	0xFFFF	0xFFFF
0xFFFF	0xFFFF	0xFFFF	0xFFFF	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
0x0032	0xFFFF	0xC519	0x764B	0x5482	0x41B3	0x35C3	0x2D7A
0x276B	0x22C9	0x1F1E	0x1C28	0x19B5	0x17A6	0x15E6	0x1463
0x1312	0x11EB	0x10E4	0x0FFB	0x0F28	0x0E6B	0x0DC0	0x0D23
0x0C94	0x0C10	0x0B97	0x0B27	0x0ABF	0x0A5F	0x0A05	0x09B1
0x0962	*
 
Apart from the PWM being really low at 4 kHz for a motor like that, the settings look good. For sensorless start you have to play with wiggle rate and amplitude in the misc. menu, this is motor dependent...upto 20Hz and 45 deg are reasonable values.

Also, your rpms I would guess are way too low.
you have this
Code:
a) erpm limit, forward: 4.64 k-erpm
b) erpm limit, reverse: 2.32 k-erpm
c) accept direction change below: 228 erpm
d) transition erpm drive 2 -> 3: 1157 erpm
e) transition erpm drive 3 -> 2: 695 erpm

I would change a and b to at least 20 k-erpm for a motor like that.
Judging by the settings you've changed the PWM (as no-one would chose a funny number like 4.64 k-erpm), and
autocompleted (and thus changed) the f_sample. changing the f_sample has a big effect on all parameters, in effect
you have to run all the autocompletes again, also the FOC must be done again. Similarly, there are funny numbers
in the recovery menu that probably come from changing f_sample.

The menu's are organised such that when you change something in a certain menu you may have to run all the subsequent
ones again. This is mostly true for far-reaching settings as f_sample, the current sensor sensitivity and the max phase current.
 
Tomdb said:
thanks I will play with it.

What will the effect of a low pwm be on the motor?

Very high PWM currents. My little RC motor has 15uh inductance, at 65V (too high but OK) it takes 20W to run at like 50 k-erpm or so and
another 100W dissipation from the PWM currents combined with the motor resistance. I managed to reduce PWM dissipation to also around 20W
by changing the PWM frequency to 60kHz (but I run small 4115 FETs, not a big output stage like you)
 
Ok, it wiggles when in mode 2. When in mode 1 it burst the motor to get the position into orientation always goes into drive 2. However no mater what combination of wiggle angle and hz i get nothing else but wiggling no matter what throttle position. Battery current does nicely increase with throttle spin. Full throttle is roughly ready 1.5+/- amps however no clue if this is right now the limit. However with my alligator clip testleads I do not want to use alot of current.

Any ideas? Or should I try the motor i was using before (link a few posts back). Planning on powering a salve motor out of an electric car. The lower ferquency im using what kind of motor does this work with better, high pole count and higher induction?

Tomorrow im hooking up my Rigol DS1054. How should I best measure my motor phases (in test mode ofcourse) battery negative and phase out?

Code:
0x01E2  0x187E  0x0001  0xCD83  0x0F0C  0x0F0C  0x183B  0x00C0
0x0086  0x0026  0x7FBC  0x0055  0x0000  0x0015  0x8000  0x006A
0x0035  0x00CA  0x03F3  0x03F3  0x03F5  0xAAAA  0xAAAA  0xAAAA
0x0EA5  0x03D7  0x008F  0x14AB  0x0002  0xE676  0x0380  0xFFFF
0xFFFF  0xFFFF  0x1000  0x0000  0x0000  0xFFFF  0xFFFF  0x016B
0x01F4  0x01AB  0x007A  0x0356  0x0356  0x0118  0x0258  0x0064
0xFFFF  0xFFFF  0xFFFF  0xFFFF  0x0000  0x999A  0x0030  0x0000
0x01E0  0xFFFF  0x6666  0xFFD0  0x0000  0xFE20  0x0000  0x07AE
0x0030  0x0000  0x01E0  0xFFFF  0xF852  0xFFD0  0x0000  0xFE20
0x0003  0x0000  0x0078  0x0000  0x0000  0xFFFD  0x0000  0xFF88
0x0000  0x0000  0x0000  0x0000  0x0003  0x0000  0x00C8  0x0000
0x0000  0xFFFD  0x0000  0xFF38  0x0000  0x0000  0x000C  0x0000
0x00F0  0x0000  0x0000  0xFFF4  0x0000  0xFF10  0x05CC  0x017B
0x0561  0x0907  0x00D5  0x0059  0x0180  0x7530  0x0907  0x0039
0x0D80  0x0042  0x0241  0x1FFE  0x0000  0x03E8  0x00C8  0x2FAD
0x03B6  0x6000  0x01EB  0x0219  0xFFFF  0xFFFF  0xFFFF  0xFFFF
0xFFFF  0xFFFF  0xFFFF  0xFFFF  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
0x0032  0xFFFF  0xC519  0x764B  0x5482  0x41B3  0x35C3  0x2D7A
0x276B  0x22C9  0x1F1E  0x1C28  0x19B5  0x17A6  0x15E6  0x1463
0x1312  0x11EB  0x10E4  0x0FFB  0x0F28  0x0E6B  0x0DC0  0x0D23
0x0C94  0x0C10  0x0B97  0x0B27  0x0ABF  0x0A5F  0x0A05  0x09B1
0x0962  *
 
I haven't looked at the hex yet, but can you check and make 100% sure all current sensors are in the correct path. So pwm channel A must have in its motor wire current sensor A etc etc...
 
I had a look at the last hex... 15a phase current may not be enough to start it, I know my RC motor needs at least 15A, so you're cutting it close.
for wiggle, i think I use 5Hz and 10 or 20 deg for the RC motor.

Another thing to try, give it some throttle and use a drill to spin the motor. This should start it too and at least show whether it runs in drive 3.
Be careful though, if you swapped any of the motor phases it will quickly overheat the motor when spinning it with a drill. Maybe add 3 20A or 30A
car fuses, one in each motor wire.
 
The motor "spins" jerkingly around now with near full throttle with a measured phase amps of roughly 50 amps AC, with my current clamp.
Switched to the red motor, 10 uh induction roughly and low resistance. Maybe these motors are not the best to test a "slow" power stage with. What kind of motor would you recommend for easier testing, a higher pole count and induction lets say hub motor?

Checked the wiring, color matched the "A" phase current sensor with driver and the wires are ribbon cables. All current sensors calibrate and all phases give the same voltage under pwm test.

Code:
0x00BD	0x092F	0x0001	0xE2A1	0x0F0C	0x0F0C	0x183B	0x00C0
0x0086	0x0026	0x7FBC	0x011C	0x0000	0x0047	0x8000	0x0164
0x00B2	0x02A3	0x03F3	0x03F3	0x03F5	0xAAAA	0xAAAA	0xAAAA
0x0EA5	0x03D7	0x008F	0x14AB	0x0002	0xE676	0x0380	0xFFFF
0xFFFF	0xFFFF	0x1000	0x0000	0x0000	0xFFFF	0xFFFF	0x016B
0x01F4	0x0590	0x007A	0x0590	0x0590	0x0118	0x0258	0x0064
0xFFFF	0xFFFF	0xFFFF	0xFFFF	0x0000	0x999A	0x0030	0x0000
0x01E0	0xFFFF	0x6666	0xFFD0	0x0000	0xFE20	0x0000	0x07AE
0x0030	0x0000	0x01E0	0xFFFF	0xF852	0xFFD0	0x0000	0xFE20
0x0003	0x0000	0x0078	0x0000	0x0000	0xFFFD	0x0000	0xFF88
0x0000	0x0000	0x0000	0x0000	0x0003	0x0000	0x00C8	0x0000
0x0000	0xFFFD	0x0000	0xFF38	0x0000	0x0000	0x000C	0x0000
0x00F0	0x0000	0x0000	0xFFF4	0x0000	0xFF10	0x05CC	0x0094
0x0204	0x0907	0x01AB	0x0059	0x0180	0x7530	0x0907	0x0039
0x0D80	0x0042	0x0039	0x1C70	0x0000	0x03E8	0x00C8	0x2FAD
0x03B6	0x6000	0x01EB	0x0219	0xFFFF	0xFFFF	0xFFFF	0xFFFF
0xFFFF	0xFFFF	0xFFFF	0xFFFF	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
0x0032	0xFFFF	0xC519	0x764B	0x5482	0x41B3	0x35C3	0x2D7A
0x276B	0x22C9	0x1F1E	0x1C28	0x19B5	0x17A6	0x15E6	0x1463
0x1312	0x11EB	0x10E4	0x0FFB	0x0F28	0x0E6B	0x0DC0	0x0D23
0x0C94	0x0C10	0x0B97	0x0B27	0x0ABF	0x0A5F	0x0A05	0x09B1
0x0962	*
 
I will take my oscilloscope out to my shed this weekend. Measure the current sensor outputs to check for excessive noise also will check a motor phase.

So for motor phase checking, gnd to the battery negative and the sense side to the motor phase is good right? (also no other measurements)
 
Yep, you were right, it didn't want to spin with your settings. The PWM frequency is way too low, my power supply kept switching off as the power draw for the PWM currents was just too much.

I changed some settings (entered my own current sensor info, recalibrated FOC for my motor, different wiggle rate settings) and managed to get the motor spinning.

The motor was not happy though, for a small 15uH motor 4kHz PWM is not enough :D but I actually think the main problem was the sampling frequency. 5.66 kHz was too low, set it to 41 kHz.

Code:
0x00DD	0x00EC	0x0015	0xF5EF	0x0221	0x0221	0x036D	0x001B
0x000A	0x0005	0x7FBC	0x0623	0x0000	0x018B	0x8000	0x07AD
0x03D6	0x0E92	0x03F3	0x03F3	0x03F5	0xAAAA	0xAAAA	0xAAAA
0x0EA5	0x0257	0x008F	0x02ED	0x000B	0xE776	0x0380	0xFFFF
0xFFFF	0xFFFF	0x1000	0x0000	0x0000	0xFFFF	0xFFFF	0x016B
0x01F4	0x1EB6	0x0189	0x03D6	0x0000	0x0350	0x0258	0x0064
0xFFFF	0xFFFF	0xFFFF	0xFFFF	0x0000	0x999A	0x0030	0x0000
0x01E0	0xFFFF	0x6666	0xFFD0	0x0000	0xFE20	0x0000	0x07AE
0x0030	0x0000	0x01E0	0xFFFF	0xF852	0xFFD0	0x0000	0xFE20
0x0003	0x0000	0x0078	0x0000	0x0000	0xFFFD	0x0000	0xFF88
0x0000	0x0000	0x0000	0x0000	0x0003	0x0000	0x00C8	0x0000
0x0000	0xFFFD	0x0000	0xFF38	0x0000	0x0000	0x000C	0x0000
0x00F0	0x0000	0x0000	0xFFF4	0x0000	0xFF10	0x6400	0x0172
0x030C	0x0147	0x0F5B	0x0036	0x00EA	0x7530	0x0147	0x0008
0x01E6	0x0042	0x0010	0x0E10	0x0000	0x03E8	0x00C8	0x4E3A
0x03B6	0x6000	0x0623	0x0147	0xFFFF	0xFFFF	0xFFFF	0xFFFF
0xFFFF	0xFFFF	0xFFFF	0xFFFF	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
0x0032	0xFFFF	0xC519	0x764B	0x5482	0x41B3	0x35C3	0x2D7A
0x276B	0x22C9	0x1F1E	0x1C28	0x19B5	0x17A6	0x15E6	0x1463
0x1312	0x11EB	0x10E4	0x0FFB	0x0F28	0x0E6B	0x0DC0	0x0D23
0x0C94	0x0C10	0x0B97	0x0B27	0x0ABF	0x0A5F	0x0A05	0x09B1
0x0962	*
 
Thats an easy thing to try, I will do that right now.

Damm Lebowski, you the man. Fixed it with the 41 Khz sampling. However works like a charm,give throttle it increases the current then spins up and goes to 4 then purrs like a kitten. However it does not reduce current at off throttle but keeps it pinned for some reason around 40 amps phase current?!? Did i set a recovery or base value wrong?

Thanks for you insights into calibrating :eek:

Code:
0x00BD	0x092F	0x0001	0xE2A1	0x0530	0x0530	0x085A	0x0035
0x001A	0x0026	0x7FBC	0x011C	0x0000	0x0047	0x8000	0x0164
0x00B2	0x02A3	0x03F3	0x03F3	0x03F5	0xAAAA	0xAAAA	0xAAAA
0x0EA5	0x0248	0x008F	0x02DA	0x000B	0xE676	0x0380	0xFFFF
0xFFFF	0xFFFF	0x1000	0x0000	0x0000	0xFFFF	0xFFFF	0x016B
0x01F4	0x0590	0x0047	0x0590	0x0590	0x0804	0x0258	0x0064
0xFFFF	0xFFFF	0xFFFF	0xFFFF	0x0000	0x999A	0x0030	0x0000
0x01E0	0xFFFF	0x6666	0xFFD0	0x0000	0xFE20	0x0000	0x07AE
0x0030	0x0000	0x01E0	0xFFFF	0xF852	0xFFD0	0x0000	0xFE20
0x0003	0x0000	0x0078	0x0000	0x0000	0xFFFD	0x0000	0xFF88
0x0000	0x0000	0x0000	0x0000	0x0003	0x0000	0x00C8	0x0000
0x0000	0xFFFD	0x0000	0xFF38	0x0000	0x0000	0x000C	0x0000
0x00F0	0x0000	0x0000	0xFFF4	0x0000	0xFF10	0x05CC	0x0094
0x0204	0x0907	0x01AB	0x0035	0x00E4	0x7530	0x013E	0x0007
0x0D80	0x0042	0x0010	0x1554	0x0000	0x03E8	0x00C8	0x5043
0x03B6	0x6000	0x011C	0x013F	0xFFFF	0xFFFF	0xFFFF	0xFFFF
0xFFFF	0xFFFF	0xFFFF	0xFFFF	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
0x0032	0xFFFF	0xC519	0x764B	0x5482	0x41B3	0x35C3	0x2D7A
0x276B	0x22C9	0x1F1E	0x1C28	0x19B5	0x17A6	0x15E6	0x1463
0x1312	0x11EB	0x10E4	0x0FFB	0x0F28	0x0E6B	0x0DC0	0x0D23
0x0C94	0x0C10	0x0B97	0x0B27	0x0ABF	0x0A5F	0x0A05	0x09B1
0x0962	*
 
Mine did this too but I thought it was due to my power supply so I didn't pay attention to it, the relays in the supply kept clicking on and off.

I looked into it a bit and from the internal variables I can see that the throttle is processed correctly. And since the only 'unusual' thing in the setup is the very low PWM,
I increased this and it made the problem go away. 6 kHz was fine, with 5 there was still a hint of it and with 4 kHz it did not listen to throttle anymore.

I guess what is happening is that somehow the motor starts running on the very high PWM currents....
 
would adding a set regen pot on throttle two fix this you think? Or should I measure my phases to see if its safe to up the pwm freq?
 
Back
Top