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

I'm in the same boat Jeremy. I find if it looses sync during start up or when its running if it fires the wrong phase it will trip my desat.
I'm finding the new chip harder to work with the old v.1xxx but I need to verify that by building a low power ~100v 100-400 amp motorcycle/ebike controller.
So I am going to start a build like that at the same time I continue with the leaf inverter.
 
Zombiess, I've been thinking about your control loop settings... what may be happening is that due to the fast accelleration of the motor the controller
runs mainly on the Integrating part of the control coefficients (the 2nd order coefficient, as the coefficients are not PID but P,I, I^2 (the loop is I,I^2,I^3, so
three integrators)).
Anyways, in the standard setup when it goes from drive_2 to drive_3 the 2nd order coefficient goes from 24 to 12 and it might be that the 12 is too
low for the phase advance (as the 3rd order hasn't caught up yet due to the low .0299 coefficient).

this is standard:
Code:
  phase control loop, drive 3
b) 1st order: 240
c) 2nd order: 12.0000
d) 3rd order: 0.3000
  phase control loop, drive 2
e) 1st order: 480
f) 2nd order: 24.0000
g) 3rd order: 0.0299

So to fix this I think best is to increase the coefficients of drive_3
Code:
  phase control loop, drive 3
b) 1st order: 480
c) 2nd order: 24.0000
d) 3rd order: 0.6000
  phase control loop, drive 2
e) 1st order: 480
f) 2nd order: 24.0000
g) 3rd order: 0.0299

or reduce the ones of drive_2:
Code:
  phase control loop, drive 3
b) 1st order: 240
c) 2nd order: 12.0000
d) 3rd order: 0.3000
  phase control loop, drive 2
e) 1st order: 240
f) 2nd order: 12.0000
g) 3rd order: 0.0299

clou being that the 1st and 2nd of both drive_2 and 3 are the same.
It explains to me by the way why you get better results with your coefficients... but this is why they are all user settable, I know how to program the algorithm but not what coefficients are the best :?
 
this is exactly the reason why linearizing PI(D) or vector FOC control is most common, it is very stable. Lewbowski non-linear controller requires high degree of match between motor and controller to be stable which can be tough to do by trial and error but has the advantage of much higher performance one u get it tuned. It is very likely that each motor will need its own set of tuning parameters. And those might even change even for same motor if DC bus voltage is different.

Before u fiddle with the tuning make sure your rotor is aligned with your position tracking algorithm (for sensor less ) or resolver/encoder for sensored. 5degree of error drops performance by 13%. 10 degree of error is not even usable.

Also u need to know by analysis that u can track the arc angle during acceleration. If u don't know how to do that then set controller to extreme slow acceleration until u have stable operation then slowly increase allowed acceleration.
 
HighHopes said:
this is exactly the reason why linearizing PI(D) or vector FOC control is most common, it is very stable. Lewbowski non-linear controller requires high degree of match between motor and controller to be stable which can be tough to do by trial and error but has the advantage of much higher performance one u get it tuned. It is very likely that each motor will need its own set of tuning parameters. And those might even change even for same motor if DC bus voltage is different.

You are just so wrong here ! :shock:
 
Do the mode 2 settings have any effect on mode 3?

Would setting the 3rd order gain to zero make the loop easier to tune by making it a PI loop?

Can you go into more detail as to why you went with PII^2 vs just PI?

You followed up the the PII^2 comment with
the loop is I,I^2,I^3, so three integrators)

This confuses me since you just said the loop was PII^2.

I know how to program the algorithm but not what coefficients are the best

Do you know how to model in Simulink? If so it could allow you to see the connection between your gain settings and the algorithm with different variables at play. Simulink helped me figure out PI control. Modeling is a powerful tool to help understand processes. Modeling allowed me to go beyond just having knowledge of PI control into having understanding of how the gains affect the control loop and how to tune out issues.
 
I model everything before I program the chip in assembly, because debugging the assembly is virtually impossible. So, the way I work is first I model the control loops and the motor and get it running on the computer. Then once it is all OK I carefully step by step translate the controller model into assembly. Debugging the assembly is hard as it is impossible to observe all internal variables and signals (this would be the same when the controller was coded in C).

One thing though, I do not use simulink or matlab, I really hate that software package. I am a big fan of Labview, which has all the functionality of matlab and simulink but is much easier to use (and can instantiate Matlab, so I see Matlab as a sub-set of Labview). There is a free linux Labview (6.1) floating around the web, I use this one under Ubuntu and works fine for this sort of modelling.

You can make the 3rd order coefficient 0 but this will lead to problems:
-it limits the max motor speed as it cannot advance more than f_sample * 2nd order coefficient degrees per second
-there is no erpm info anymore, the controller will be stuck in drive 2 and the FOC will think frequency is 0.

The loopfilter inside the controller is P,I,I^2 but the entire system is I,I^2, I^3...
 
You guys are awesome! Just because the majority of us stay silent in your controller work sharing doesn't mean it's not greatly appreciated. Thank goodness I didn't try to build my own controller, though I applaud Arlo1 for having the determination to see it through. I'll stick with motors and frames, and rely on you guys to handle the "black boxes".

Sorry for the interruption, but take a pause and pat yourselves on the back for me for so freely sharing your hard work and hard earned knowledge. If you ever get it down to a "solder by numbers" kit, count me in, and I'll invest sufficiently in a group buy of components and materials to get the cost down.

John
 
Lebowski said:
HighHopes said:
this is exactly the reason why linearizing PI(D) or vector FOC control is most common, it is very stable. Lewbowski non-linear controller requires high degree of match between motor and controller to be stable which can be tough to do by trial and error but has the advantage of much higher performance one u get it tuned. It is very likely that each motor will need its own set of tuning parameters. And those might even change even for same motor if DC bus voltage is different.

You are just so wrong here ! :shock:

Yes possible to be wrong always. I've never used your controller. My comment was based on my own experience with design if non linear controller. Was a b#tch to tune because it would transition from one region of tuning elements into another randomly (human chosen sliding set points). But once you got it figured out it was very responsive.
 
Tried some new mode 3 settings and here is what I noticed.

FOC works well at high load low RPM if 2nd order coefficient is set below 13 and 1st order is anywhere from 350-900. Not much of a difference. The 2nd order appears to control how well the loop has control at low speed high torque. First order I"m not noticing much of a difference over the range. 3rd order I have not played with enough. The bike will still cut out under high load right as it gets to the highest current it's going to draw from the battery. I have the error currents set to 75A. Phase current limited to 275A, battery current set to 200A but it's only peaking around 170A.

I ran into a mechanical issue with the bike which will delay more testing until I can fix it, the motor moved in it's drop outs a bit.

Maybe the loop is losing control due to the acceleration? Right as it's about to pull well is when it conks out and faults. If I baby it a bit through that range I can get good acceleration.

P.S., my motor hates me :twisted:
 
what i experienced with my motor is, that changing inductance percentage (as found in 2.40 firmware) doesn't help at all. keeping it at 100% seems to work best.
so the main thing to play around for me are the control loops. my main issue is, that i can start from a stand still. i gently turn the throttle and i goes tschirp tschirp ... when i start to pedal and there is no load in drive_2 i can make the motor overcome that phase and go to drive_3 where i found that the higher 1st and 2nd value are, the better it becomes. up to a point where i reach lets say 50% speed and can go WOT until it accelerates to full speed and stays there. BUT the controller/motor starts to make some strange noise which doesn't sound like a good thing to me. so i'm not happy with this "solution".

these are values that work better for me:
Code:
  phase control loop, drive 3
b) 1st order: 960
c) 2nd order: 48.0000
d) 3rd order: 0.6000
 
@izeman
is your puma hub motor controller is created by you or just bought from shop ?

@Zombies
whats the current status mate, is it stable, and range of single charge ?
 
going to build this circuit,
first have to understand kicad and small things :)

any pcb simultion softwares to recommend ? so i understood clearly before the pcb creation.

Offtopic:
i am zero in electronics, but something inside telling me to try atleast, then only you're able to ride powerful e-bike.
 
newbiebiker said:
going to build this circuit,
first have to understand kicad and small things :)

any pcb simultion softwares to recommend ? so i understood clearly before the pcb creation.

Offtopic:
i am zero in electronics, but something inside telling me to try atleast, then only you're able to ride powerful e-bike.
have a look here for the PCB of (my version of) this controller

http://endless-sphere.com/forums/viewtopic.php?f=30&t=57877
 
sure Lebowski,
in output stage, 6 fet or 24 fet, that number depend on max voltage/max current means we can use single high rating power fet, eg: single 150 a/ 150 v one ?
 
newbiebiker said:
sure Lebowski,
in output stage, 6 fet or 24 fet, that number depend on max voltage/max current means we can use single high rating power fet, eg: single 150 a/ 150 v one ?

as long as you can keep it cool enough... multiple fets though both and have lower dissipation (as the resistance is lowered) and this lower dissipation is spread out over more FETs (so each FET sees a lot less heat)
 
Lebowski said:
newbiebiker said:
sure Lebowski,
in output stage, 6 fet or 24 fet, that number depend on max voltage/max current means we can use single high rating power fet, eg: single 150 a/ 150 v one ?

as long as you can keep it cool enough... multiple fets though both and have lower dissipation (as the resistance is lowered) and this lower dissipation is spread out over more FETs (so each FET sees a lot less heat)

as my aim to create the normal board shown here to test it fully then i will create my dream hybrid bike :)

Will the below scenario work (hybrid) :
like the normal petrol bike is more complicated in rear wheel, as the gear chains and all, better i can create a controller with one high rating FET(yeah one FET, or max 2 fet) for just starting (from zero to 10 kmph) then i move to petrol side (nothing going to change in bike, will add a button/small instead of electric throttle, so i can normally use by petrol bike)
because fossil fuel vehicles drink more and more fuel for starting (that first gear Shift), so due to starting(moving) i will switch to petrol from second gear.

Advantage :
more milage, just for moving the bike so less like 5 AH Lipo is enough i think + small size of controller due to 1 fet :) as i not going to use more than 30 seconds (max 1 min)
 
newbiebiker said:
@Zombies
whats the current status mate, is it stable, and range of single charge ?

No progress lately. I've been trying to deal with pain and losing my ability to stand, walk and get a decent nights sleep.

I might be load testing in a couple of weeks. I need to schedule it.
 
zombiess said:
newbiebiker said:
@Zombies
whats the current status mate, is it stable, and range of single charge ?

No progress lately. I've been trying to deal with pain and losing my ability to stand, walk and get a decent nights sleep.

I might be load testing in a couple of weeks. I need to schedule it.

Take care your health buddy, health first work next :)
 
toolbag said:
You guys are doing a great job bringing an intelligent discussion to the comments section :lol: .

Looking forward to seeing this controller loaded up! Do you know what your electrical frequency is like on your current test setup?

What frequency are you asking about, the switching freq? It's settable in the controller chip, I usually use 15-21kHz
 
Back
Top