My new 18 FET TO-247 layout riding video page 10

I turned off low side pusling because I do not require it because my gate drives have their own isolated power supplies.

The low current sensor settings were put in place for testing. Something is too unstable to attempt full power and risk damaging something.

My current sensors are sized for 300A, I will be running in this range during acceleration. I have sensors which are good to 600A which I've tested and they worked. My 1800A sensors didn't work, but that's expected since low current is in the noise. I am going to need a setup which works in the +1000A in the near future. I have some ideas on how to make that work.
 
Lebowski said:
have you turned on and tried out recovery ?

I'll try that today. I need to secure the controller on the bike and up the battery voltage to hopefully get some more power :)
I was pulling bursts of 14C from some 4yr old LiPo packs in an 18S2P config.

Any tips on tuning recovery?

How about tips on tuning the control loops. I'm using my FOC settings from my 1.21 controller. They look like they are a bit off, but they do work as seen in the video.

These are my settings which work for FOC on my Cromotor Suggestions welcome.

Code:
0x05B7  0x0006  0x0933  0x001B  0x0002  0x0002  0x7FBC  0x0399
0x0000  0x00E8  0x8000  0x0240  0x0240  0x088C  0x0400  0x0400
0x0400  0xAAAA  0xAAAA  0xAAAA  0x02EE  0x0248  0x001B  0x0301
0x000A  0xFF0C  0x0430  0x0199  0x0614  0x0851  0xFFFF  0xFFFF
0xFFFF  0x00B6  0x02B6  0xFFFF  0xFFFF  0x1204  0x004C  0x099C
0x0000  0x030C  0x0258  0x0196  0x0000  0x0000  0x0001  0x0002
0x0000  0x028F  0x0017  0x0000  0x015E  0xFFFF  0xFD71  0xFFE9
0x0000  0xFEA2  0x0000  0x0A3D  0x001E  0x0000  0x0258  0xFFFF
0xF5C3  0xFFE2  0x0000  0xFDA8  0x0003  0x0000  0x0078  0x0000
0x0000  0xFFFD  0x0000  0xFF88  0x0000  0x0000  0x003C  0x0003
0x0000  0x0000  0x0000  0xFFC4  0xFFFD  0x0000  0x0000  0x0000
0x00F0  0x000C  0x0000  0x0000  0x0000  0xFF10  0xFFF4  0x0000
0x0000  0x0000  0x9421  0x0321  0x0750  0x05DC  0x01CD  0x0035
0x00E4  0x02EB  0x014F  0x0008  0x01E6  0x0042  0x0010  0x0E10
0x0000  0x03E8  0x00C8  0x5027  0x03B6  0x6000  0x0133  0x013F
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
*
 
nice test ride. your display shows Amin/Amax. i think Amin is kinda useless (its always zero), perhaps a Vmin would be more informative? see how your batteries droop during the acceleration and so you can know if you have right size wire and battery capacity for your needs.
 
HighHopes said:
nice test ride. your display shows Amin/Amax. i think Amin is kinda useless (its always zero), perhaps a Vmin would be more informative? see how your batteries droop during the acceleration and so you can know if you have right size wire and battery capacity for your needs.
Amin is used to keep track of max regen which is very use full ;)
 
Awesome to see it running! Throw it on the dyno next time you visit.
 
zombiess said:
Lebowski said:
have you turned on and tried out recovery ?

I'll try that today. I need to secure the controller on the bike and up the battery voltage to hopefully get some more power :)
I was pulling bursts of 14C from some 4yr old LiPo packs in an 18S2P config.

Any tips on tuning recovery?

How about tips on tuning the control loops. I'm using my FOC settings from my 1.21 controller. They look like they are a bit off, but they do work as seen in the video.

These are my settings which work for FOC on my Cromotor Suggestions welcome.

Code:
0x05B7  0x0006  0x0933  0x001B  0x0002  0x0002  0x7FBC  0x0399
0x0000  0x00E8  0x8000  0x0240  0x0240  0x088C  0x0400  0x0400
0x0400  0xAAAA  0xAAAA  0xAAAA  0x02EE  0x0248  0x001B  0x0301
0x000A  0xFF0C  0x0430  0x0199  0x0614  0x0851  0xFFFF  0xFFFF
0xFFFF  0x00B6  0x02B6  0xFFFF  0xFFFF  0x1204  0x004C  0x099C
0x0000  0x030C  0x0258  0x0196  0x0000  0x0000  0x0001  0x0002
0x0000  0x028F  0x0017  0x0000  0x015E  0xFFFF  0xFD71  0xFFE9
0x0000  0xFEA2  0x0000  0x0A3D  0x001E  0x0000  0x0258  0xFFFF
0xF5C3  0xFFE2  0x0000  0xFDA8  0x0003  0x0000  0x0078  0x0000
0x0000  0xFFFD  0x0000  0xFF88  0x0000  0x0000  0x003C  0x0003
0x0000  0x0000  0x0000  0xFFC4  0xFFFD  0x0000  0x0000  0x0000
0x00F0  0x000C  0x0000  0x0000  0x0000  0xFF10  0xFFF4  0x0000
0x0000  0x0000  0x9421  0x0321  0x0750  0x05DC  0x01CD  0x0035
0x00E4  0x02EB  0x014F  0x0008  0x01E6  0x0042  0x0010  0x0E10
0x0000  0x03E8  0x00C8  0x5027  0x03B6  0x6000  0x0133  0x013F
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
*

For the recovery, use autocomplete and let me know how the standard settings perform.

Based on what do you think the control loop settings are not good ?
 
Good news, I was able to run the controller pretty hard by babying the throttle during acceleration. I managed to pull a peak of 174A at 82.5V (no load pack voltage was at 91V) so that's 14kW from the pack. Not too shabby. I couldn't get the MOSFET case temperature over 32C :D Pretty much what I expected for ebike use, can't pull enough continuous power.

I keep running into issues with the controller cutting out during quick acceleration in mode 3. If I get the motor hot, about 80C, so the power drops off, then I can go WOT form a low speed.

Here is some video of me beating it up with a motor which is feeling pretty soggy. Will be pretty nice once I have the control loops sorted.
[youtube]qo_dRZ-9MaE[/youtube]

Suggestions on what to change? It's not quick enough yet, needs a 30S pack, but more voltage also makes the cutting out issue worse.

I also tried using recovery mode before I stopped. Sometimes it worked, other times not so much. One time it gave me a little jolt from the throttle kicking in more than I expected.

Here are my settings,

Code:
0x05B7  0x0006  0x0933  0x001B  0x0002  0x0002  0x7FBC  0x0399
0x0000  0x00E8  0x8000  0x0240  0x0240  0x088C  0x0400  0x0400
0x0400  0xAAAA  0xAAAA  0xAAAA  0x0341  0x0267  0x001B  0x0301
0x000A  0xFF0E  0x0590  0x0199  0x0614  0x0851  0xFFFF  0xFFFF
0xFFFF  0x00B6  0x02B6  0xFFFF  0xFFFF  0x1204  0x00E6  0x0902
0x0000  0x030C  0x0258  0x0196  0x0000  0x0000  0x0001  0x0002
0x0000  0x028F  0x000D  0x0000  0x012C  0xFFFF  0xFD71  0xFFF3
0x0000  0xFED4  0x0000  0x028F  0x000A  0x0000  0x00C8  0xFFFF
0xFD71  0xFFF6  0x0000  0xFF38  0x0003  0x0000  0x0078  0x0000
0x0000  0xFFFD  0x0000  0xFF88  0x0000  0x0000  0x00C8  0x0002
0x0000  0x0000  0x0000  0xFF38  0xFFFE  0x0000  0x0000  0x0000
0x00F0  0x000C  0x0000  0x0000  0x0000  0xFF10  0xFFF4  0x0000
0x0000  0x0000  0x72C5  0x0321  0x0781  0x05DC  0x0267  0x0038
0x00F0  0x02EB  0x014F  0x0008  0x01E6  0x0042  0x0010  0x0E10
0x0000  0x03E8  0x00C8  0x4C31  0x03B6  0x6000  0x0399  0x0150
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
*
 
Getting a motor controller dialed in takes some tuning. If you research PID loop control theory, you will get the idea quickly.
 
Zombies from my experience if you use all the auto complete it will work and if not it will be super close. But I do find V2.3 to be tricky as its way different then the old v1.xx chips. I find one of the most important things to go though and set each thing one after another. If you miss auto complete on any one thing it will really mess things up.
 
I'll have a look this evening at the settings, but I guess error current filtering needs to be increased a bit, I'll have a look.
Yep, after recovery it doesn't wait for throttle closed or anything but will power immediately.

Have you ever thought about getting a quieter freewheel ? :mrgreen:
 
OK made some changes to the settings:
Code:
0x05B7	0x0006	0x0933	0x0013	0x0008	0x0002	0x7FBC	0x0399
0x0000	0x00E8	0x8000	0x0300	0x0180	0x088C	0x0400	0x0400
0x0400	0xAAAA	0xAAAA	0xAAAA	0x0341	0x0267	0x001B	0x0301
0x000A	0xFF0E	0x0590	0x0199	0x0614	0x0851	0xFFFF	0xFFFF
0xFFFF	0x00B6	0x02B6	0xFFFF	0xFFFF	0x1204	0x00E6	0x0902
0x0000	0x030C	0x0258	0x0196	0x0000	0x0000	0x0001	0x0002
0x0000	0x4CCD	0x000C	0x0000	0x00F0	0xFFFF	0xB333	0xFFF4
0x0000	0xFF10	0x0000	0x07AE	0x0018	0x0000	0x01E0	0xFFFF
0xF852	0xFFE8	0x0000	0xFE20	0x0003	0x0000	0x0078	0x0000
0x0000	0xFFFD	0x0000	0xFF88	0x0000	0x0000	0x003C	0x0003
0x0000	0x0000	0x0000	0xFFC4	0xFFFD	0x0000	0x0000	0x0000
0x00F0	0x000C	0x0000	0x0000	0x0000	0xFF10	0xFFF4	0x0000
0x0000	0x0000	0x72C5	0x0321	0x0781	0x05DC	0x0267	0x0038
0x00F0	0x02EB	0x006F	0x0008	0x01E6	0x0042	0x0010	0x0E10
0x0000	0x03E8	0x00C8	0x4C31	0x03B6	0x6000	0x0399	0x0070
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
*

main things I changed:
-transition erpms, from 900 and 70 made them about 700 and 300
-changed the fixed error current to 50A, the proportional to 25A. The fixed part is for low motor erpms, so hoping to increase tolerance to full throttle at low speed
-changed the error current filtering to 15msec (from 5 msec), this is in the filter menu and operates during drive_3
-the error current filtering for drive_2 is in the recovery menu, made this one also 15msec
-changed all the control loop coefficients back to original
 
I tested your settings Lebowski. The control loop was a no go, not even close, couldn't even spin the motor. I went back to my original settings of 1st order 350, 23, 0.01 and it ran again. Your other settings didn't make a noticeable difference to me. I even tried upping the current values you mentioned by another 25A each and still no good.

What did make a difference was lowering my phase amps from 300 down to 250. It wasn't perfect, but it was better. I'm wondering if the phase current could be overshooting and the loop loses control.

I'm basing this theory on a few things:

1. the normal control loop entries don't work for the Cromotor but works well for a low inductance motor
2. the issue gets worse the more I increase the current setting, even if there is no perceivable difference in acceleration
3. at low RPM there is little BEMF and the current can rise more quickly
4. the battery current setting is only loosely coupled to the loop being lost.
5. the problem lessens as the motor's resistance increases as it heats up

What thoughts do you have?
 
For the meaning of the loop coefficients, check out manual v2.40 from page 15. Keep in mind the minimal factor 40 between
1st and 2nd order, and the minimal factor 20 between 2nd and 3rd order. Your ratio is less than 40 between 350 and 23, so
there is a chance of loop instability.

Regarding the motor doesn't spin with the original settings, I'm assuming you're talking about that it doesn't start sensorless
when the wheel is off the ground ? For this you need to experiment with wiggle rate and amplitude in the miscellaneous
menu. You need to experiment there, useful values for wiggle rate should be between about 4 and 20 Hz, wiggle amplitude
between 10 and 45 degrees.

You're saying you need to baby the throttle at low motor speed else it conks out to recovery. When this happens, are you in
drive_2 or already solidly in drive_3 ?\

Just to comment on your points:
1- My own v1 motor is 300 uH and the standard settings work well there... Inductance shouldn't really matter.
2- The fault code probably happens at a certain phase current, a higher setting will make it appear as if it happens earlier. No noticeable performance increase because it conks out at the same lower current.
3- Nope, BEMF has nothing to do with it. Only difference at low erpm is that the impedance of the inductor is still low... but it points to amplitude loop maybe too fast
4- logical, as it is unlikely to hit battery current limiting at low motor speed.
5- Maybe it will help to reduce the speed at which the current can ramp up. In the control coefficients menu, lower all amplitude loop coefficients by the same factor. Due to a programming error (fixed in v2.40)
the 3rd order coefficient should be kept 0, the 2nd order coefficient should be above 1. Standard here is 60 and 3 for 3rd and 2nd order coefficients, try 40 and 2...
 
Lebowski said:
Regarding the motor doesn't spin with the original settings, I'm assuming you're talking about that it doesn't start sensorless
when the wheel is off the ground ?

Nope, it will not work unloaded or loaded, the motor just bucks around. Tried pedaling to start, still fails in a seizure. The controller is confused by the stock auto parameters when hooked up to a Cromotor. I have to change them to something like 350/23/0.01 in order to get it to work in FOC.

The controller is solidly into FOC when it cuts out (when I have it mostly working).

I'll take a look at the latest manual.
 
zombiess said:
Lebowski said:
Regarding the motor doesn't spin with the original settings, I'm assuming you're talking about that it doesn't start sensorless
when the wheel is off the ground ?

Nope, it will not work unloaded or loaded. The controller is confused at the auto parameters when hooked up to a Cromotor. I have to change them to something like 350/23/0.01 in order to get it to work in FOC.

The controller is solidly into FOC when it cuts out (when I have it mostly working).

Yep, my advice is still to go back to original parameters and to experiment with the wiggle parameters...
 
Lebowski said:
Yep, my advice is still to go back to original parameters and to experiment with the wiggle parameters...

You really think the wiggle parameters will make a difference? I've tried it previously and it didn't work, but I'll certainly try again.

Suggestions on where to start?

I forgot to mention previously that when it konks out of FOC I end up with a latched fault which usually means over current (+700A)/ shoot through. I don't get a fault if it konks out at low speed, low current.
 
zombiess said:
Lebowski said:
Yep, my advice is still to go back to original parameters and to experiment with the wiggle parameters...

You really think the wiggle parameters will make a difference? I've tried it previously and it didn't work, but I'll certainly try again.

Suggestions on where to start?

I forgot to mention previously that when it konks out of FOC I end up with a latched fault which usually means over current (+700A)/ shoot through. I don't get a fault if it konks out at low speed, low current.

With the wiggle, I would start at high wiggle amplitude and low wiggle rate (so 40 instead of 20 degree, 4 Hz instead of 9) but it requires some experimenting.

The latch fault... I think for the controller IC it is impossible to turn on both FETs for a single output, just by the way the PWM modules are built. So I'm guessing the shoot through comes first which is
then detected both by your fault detection and by the controller IC ? Maybe when the FETs heat up the deadtime is not sufficient anymore ? Could heating up slow down the gate drive ?
 
Lebowski said:
With the wiggle, I would start at high wiggle amplitude and low wiggle rate (so 40 instead of 20 degree, 4 Hz instead of 9) but it requires some experimenting.

The latch fault... I think for the controller IC it is impossible to turn on both FETs for a single output, just by the way the PWM modules are built. So I'm guessing the shoot through comes first which is
then detected both by your fault detection and by the controller IC ? Maybe when the FETs heat up the deadtime is not sufficient anymore ? Could heating up slow down the gate drive ?

The gate driver fault is a bit puzzling. It only happens when the controller loses sync with the motor under power. The controller will happily cause the motor to have seizure like movements or run smoothly (depending on loop settings), until it triggers a fault as the current goes up. It could be that there is a short pulse > 700A which would also trigger the desat on the gate driver. I suspect that this is what is happening and it is not a shoot through event. The only reason I notice it is my fault detection is pretty sensitive. I believe if I used settings which made FOC work pretty well and disabled the fault detection it would run fine. I have done this before at lower current/voltage and it has worked well, but I would still see a fault triggered.

I noticed that there is no pattern to the driver which triggers the fault, it is random in nature.

If your controller chip detects a fault, it will not trigger my fault handling, I am only reading the fault signals from the gate drive ICs. The dead time can change as the chip heats up, but I have been running 2000ns of dead time to troubleshoot. I have set the dead time as low as 600ns to 3000ns, and it has had no effect on the error. I have also experimented with switching freq, from 10kHz to 30kHz and it made no difference.
 
what do you mean by controller losing synch with the motor? is this a scenario you can recreate in simulink?
 
HighHopes said:
what do you mean by controller losing synch with the motor? is this a scenario you can recreate in simulink?

Possibly, but I would have to understand the control loop and FOC really well. The control loop with auto settings seems to work well running a low inductance low pole count motor, but has had trouble with the four different 23 pole pair hub motors I've hooked up to it with no load.

I'm not not very versed in FOC yet so this could be off, but I'm trying :)
What I mean by losing sync is it feels like the control is lost with the default gains, then it tries to regain it, but it does so incorrectly. With auto settings on the control loop it is in oscillation, bouncing back and forth until something goes so wrong that I believe the vector is lost. I imagine it like the current vector is being "bounced" off the rotor flux angle and the controller is unable to track the response well enough so that it can grab back on. Eventually this oscillates out of control, and the controller tries to grab back on, but when it finds it again it's lagged and it slips away making a really neat sci-fi sound effect. Like a rubber band being plucked while it's being stretched.

I could try to get geeky and talk about poles moving to the right of jw, but I don't want to embarrass myself just yet, need more studying :lol:

When I have the gains so FOC mostly works, it starts accelerating and then I have a fault triggered, no cool sci fi sound either, it just quits and then blinks out a random gate driver fault code. My settings which "mostly work" can create a really grumbly feeling that reminds me of driving over gravel (torque ripple?) that dissapears as either current is reduced or rotor speed increases. Through testing I've noticed that this issue is less likely to happen when I lower the phase current. My settings create a loop that does not have enough margin. The problem I have is I don't know which way to tune the three gains since I don't have a solid, objective data collection method to measure stuff like a step response so I can see the details and then tweak them. Lebowski also says it is not PID control, so I don't know what I'm tweaking. My gains / controller effort could be up/up or up/down. I don't know enough yet so I'm stuck with trial/error tuning.
 
Back
Top