
So now I have undertaken replacing it with an openinverter-ized Leaf inverter after great success with the Tesla Gen2 charger board - my max pack voltage is ~350v so the Leaf inverter was a natural fit. I'm much more experienced with electrical and motor controls stuff than mechanical fabrication - so I figured it would be better worth my time to leave the old motor mounted up and deal with figuring out an unknown motor rather than try to replace it with a Leaf motor. I still bought myself a whole Leaf front stack since the first Leaf inverter I bought from Ebay had been so aggressively crowbarred off the motor to the point its PCB was cracked and one IGBT module ripped apart, and in case I did want to undertake swapping the Leaf motor and putting the original control board for VCU/CAN type control later on down the road.
So far I have been successful setting up the Leaf inverter to first spin the Leaf motor, then to spin the ancient motor, I was able to calibrate syncofs, tune the current controller gains, hook it up to the existing throttle pot, and I've been able to move the car back and forth on my driveway, including putting it on ramps to touch up wiring and coolant tubes underneath.
However, at my current battery voltage of 308v or so, I was only reaching 3600rpm (180hz - it's a 3 pole pair motor) where with the original inverter my previous limit had been 4000rpm (200hz). So as a first attempt at setting up flux weakening, I took an initial guess at the fluxlinkage value, set fwcurmax to -100, and revved up. To my surprise, I only reached 160hz. I could see on the graph that Id magnitude was increasing, so I knew that the flux weakening had engaged when I needed it. After some experiments changing fwcurmax and fluxlinkage with no results, I eventually just injected manual positive Id and to my surprise this worked - was able to reach past 180hz depending on how much Id I set.
Here is a plot: The first 2 runs are with fwcurmax at 0. The third run fwcurmax is at -100 and you can see the max frequency is lower. The fourth run manual Id is at 100 and I reached just a little past 200hz.
So seemingly the flux weakening Id output has a sign flip somewhere? I figure I must be configured improperly, since it's working properly for other folks. I tried running the motor in reverse (flipped dirmode) and still had the same behavior. (limited to 160hz at fwcurmax of -100)
This happened both on FOC 5.24 and 5.27 (currently what I am running). I've attached my parameter json - it seems like it's missing a few parameters though, notably my respolepairs and pinswap values, which are also not visible in the web interface but they do stay saved to flash.