[DRIVING] Renault Clio Electrique -97

Tell us about the project you do with the open inverter
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Renault Clio Electrique -97

Post by bexander »

Pete9008 wrote: Wed Jan 11, 2023 3:12 pm I think the coggyness is just due to the motor saliency, id is about the only thing I can think of that might help. Is the 500W a measured number? It's a little higher than I would expect. What was the battery current during the 20A test?

I suppose the code could be modified so that the current isnt there there when stationary or above a few Hz, that should limit the power loss to the minimum.
At 20A id the battery current was 0,8A and 0,2A is the idle current so 0,5-0,6A extra current. My assumption is that this will increase linear wit id and then the extra current would be 1,1A at 370V so 400W, not 500W, but still a lot.
The MGR has quite a lot of backlash in the reduction gears and combined with high coggynes due to saliency it's very likely to be the cause of what I experience. This is not a high priority matter so probably better to focus on motor parameters and fw tuning to see if any improvments can be done there.

I have this graph that I think is representative for my motor, that indicates that what I get in my car is resonable considering the voltage in my batteries vs the voltage Lexus runs on the motor bus (don't know but 600V is my best guess). Specifically the drop-off in power in FW region.
RX400h_rear_e_motor.pdf
(57.7 KiB) Downloaded 67 times
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Renault Clio Electrique -97

Post by Pete9008 »

It may not be linear. The firmware turns off the pwm if frq, id and iq are all zero, to remove switching losses, which won't happen with manualid set so you may not be comparing like for like. The only way to be sure is to measure battery current for different id values and extrapolate the line. This was why I suggested it might be usefull to disable manualid when stationary as well as when above a few Hz.

Agree, based on that plot it looks like you are doing pretty well given the lower voltage. That seems to back up what I was starting to think about the effect of salient motors on the power curve.
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Renault Clio Electrique -97

Post by bexander »

PWM isn't disabled at standstill with the Prius inverter, viewtopic.php?t=2783. Don't know if it applies for Gen2 or Gen3 or both. I can do another test and see if I can get it to dissaper with up to 40A id.
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Renault Clio Electrique -97

Post by johu »

bexander wrote: Wed Jan 11, 2023 6:24 pm PWM isn't disabled at standstill with the Prius inverter, viewtopic.php?t=2783. Don't know if it applies for Gen2 or Gen3 or both. I can do another test and see if I can get it to dissaper with up to 40A id.
That's just Prius2 because it shorts out the motor when PWM is turned off (closes all low side IGBTs)

EDIT: the document you linked has title "ganzseitiger Faxausdruck". It's a fax :D
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Renault Clio Electrique -97

Post by Pete9008 »

Was just looking in the code to figure that out :)

Came across this for the HWREV enum:

Code: Select all

typedef enum
{
   HW_REV1, HW_REV2, HW_REV3, HW_TESLA, HW_BLUEPILL, HW_PRIUS
} HWREV;
So is HW_PRIUS there just the Gen2? In which case what is Gen3? (as I may have got some of my code edits wrong)

Edit - starting to look at the log files now!
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Renault Clio Electrique -97

Post by johu »

Uh yeah, HW_PRIUS is just Gen2 Prius. Gen3 Prius should detect as generic HW_REV3
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Renault Clio Electrique -97

Post by Pete9008 »

johu wrote: Wed Jan 11, 2023 6:36 pm Uh yeah, HW_PRIUS is just Gen2 Prius. Gen3 Prius should detect as generic HW_REV3
Note to self - don't make assumptions :oops: going to have to review the changes!
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Renault Clio Electrique -97

Post by Pete9008 »

So using the calculator gives:

Log4 - Lq=5.4mH, Ld=1.65mH, λ=95.0mWb
Log5 - Lq=5.1mH, Ld=1.66mH, λ=96.4mWb
Log6 - Lq=5.2mH, Ld=1.66mH, λ=96.0mWb
Log7 - Lq=5.0mH, Ld=1.68mH, λ=97.0mWb
Log8 - missing udc
Log9 - Lq=5.75mH, Ld=1.77mH, λ=95.3mWb
Log10 - Rs = 145mR

Need to have a look at Log9 vs Log7 to see why the difference but looking reasonable.

Will continue the analysis on the calculator thread.
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Renault Clio Electrique -97

Post by bexander »

johu:
Regarding userPWM, would it be possible to add a forth pwmfunc mode, constant? I guess then pwmgain would set frequency and pwmofs would set duty cycle? I would love if I could get a constant frequency in the range of 20-200Hz and a duty cycle of 53% to control the DC/DC in the Toyota inverters.
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Renault Clio Electrique -97

Post by bexander »

Pete9008 wrote: Wed Jan 11, 2023 6:52 pm So using the calculator gives:

Log4 - Lq=5.4mH, Ld=1.65mH, λ=95.0mWb
Log5 - Lq=5.1mH, Ld=1.66mH, λ=96.4mWb
Log6 - Lq=5.2mH, Ld=1.66mH, λ=96.0mWb
Log7 - Lq=5.0mH, Ld=1.68mH, λ=97.0mWb
Log8 - missing udc
Log9 - Lq=5.75mH, Ld=1.77mH, λ=95.3mWb
Log10 - Rs = 145mR

Need to have a look at Log9 vs Log7 to see why the difference but looking reasonable.

Will continue the analysis on the calculator thread.
That is awesome!! Thank you!
I will put in lqminusld 3,5 and fluxlinkage to 96 and give it a test. Icrit ends up at 57,8 with those values so might be a good idea to set fwcurmax to 58 as well.

Regardin Rs, is that for two windings in series? I measured 75mOhm for one winding, but that can be wrong of course.
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Renault Clio Electrique -97

Post by Pete9008 »

bexander wrote: Wed Jan 11, 2023 7:04 pm That is awesome!! Thank you!
I will put in lqminusld 3,5 and fluxlinkage to 96 and give it a test. Icrit ends up at 57,8 with those values so might be a good idea to set fwcurmax to 58 as well.

Regardin Rs, is that for two windings in series? I measured 75mOhm for one winding, but that can be wrong of course.
Rs should be the measurement you get with one side of the meter on one phase and the other meter lead on the other two shorted together. However, it is actually what the firmware 'sees', which will include cables, IGBTs, diodes, deadtime, etc all avaraged over varying currents (some of those are non linear). All it is really useful for is in trying to improve agreement between the real world and the simulator!

Edit - did you change any parameters between log 7 and 9? Log9 looks like it contains a little more of the high speed oscillation?
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Renault Clio Electrique -97

Post by bexander »

Pete9008 wrote: Wed Jan 11, 2023 7:11 pm Rs should be the measurement you get with one side of the meter on one phase and the other meter lead on the other two shorted together. However, it is actually what the firmware 'sees', which will include cables, IGBTs, diodes, deadtime, etc all avaraged over varying currents (some of those are non linear). All it is really useful for is in trying to improve agreement between the real world and the simulator!
Aha, that explains a lot. Have put all values in the simulator and it look very close to what I have IRL. Very nice job!
Pete9008 wrote: Wed Jan 11, 2023 7:11 pm Edit - did you change any parameters between log 7 and 9? Log9 looks like it contains a little more of the high speed oscillation?
I changed parameters between all logs, to test different settings. Log4-8 is taken at the same location, every time driving back to the start location on the flatest piece of road I could find close by. Log9 is from that location back to my house so there is definitely an elevation climb in there. Maybe should have excluded that log? Not strange that Log9 is deviating from the others.
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Renault Clio Electrique -97

Post by Pete9008 »

bexander wrote: Wed Jan 11, 2023 7:22 pm Aha, that explains a lot. Have put all values in the simulator and it look very close to what I have IRL. Very nice job!
:D
bexander wrote: Wed Jan 11, 2023 7:22 pm I changed parameters between all logs, to test different settings. Log4-8 is taken at the same location, every time driving back to the start location on the flatest piece of road I could find close by. Log9 is from that location back to my house so there is definitely an elevation climb in there. Maybe should have excluded that log? Not strange that Log9 is deviating from the others.
That would explain it, thanks for the clarification. It has also given me an idea on how to improve the analysis by allowing sections to be excluded. Would any of that last log be on flat ground - it would be nice if I could analyse just that section and see better agreement to the others.

The climb could also explain the oscillation if the motor was having to work a bit harder.

Thanks for taking the trouble to take all the plots, it's provided some really good test data.
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Renault Clio Electrique -97

Post by johu »

bexander wrote: Wed Jan 11, 2023 6:53 pm johu:
Regarding userPWM, would it be possible to add a forth pwmfunc mode, constant? I guess then pwmgain would set frequency and pwmofs would set duty cycle? I would love if I could get a constant frequency in the range of 20-200Hz and a duty cycle of 53% to control the DC/DC in the Toyota inverters.
Damned legacy. So yes, on the Prius inverter that will work because it hasn't got the over current comparator. On all other variants the same timer also generates the references for said comparator and thus needs to be high frequency. So if someone were to set it to the new mode e.g. on a Nissan board it would just overcurrent all the time for no apparent reason.
Hmm, could call the mode "PriusConstant" or something

EDIT: could that be a job for the atmega?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Renault Clio Electrique -97

Post by bexander »

Pete9008 wrote: Wed Jan 11, 2023 7:36 pm That would explain it, thanks for the clarification. It has also given me an idea on how to improve the analysis by allowing sections to be excluded. Would any of that last log be on flat ground - it would be nice if I could analyse just that section and see better agreement to the others.
Yes, the first part (0 - 95s) of the plot is on fairly flat road.
Pete9008 wrote: Wed Jan 11, 2023 7:36 pm Thanks for taking the trouble to take all the plots, it's provided some really good test data.
Glad I could help!
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Renault Clio Electrique -97

Post by bexander »

johu wrote: Wed Jan 11, 2023 9:28 pm Damned legacy. So yes, on the Prius inverter that will work because it hasn't got the over current comparator. On all other variants the same timer also generates the references for said comparator and thus needs to be high frequency. So if someone were to set it to the new mode e.g. on a Nissan board it would just overcurrent all the time for no apparent reason.
Hmm, could call the mode "PriusConstant" or something

EDIT: could that be a job for the atmega?
I'm trying to get rid of the atmega, it currently provides the needed PWM. It is possible to use a NE555 to provide the PWM (does so in my Leaf setup, using the Prius DC/DC) so no big deal, just trying to create a very minimalistic Toyota board.
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Renault Clio Electrique -97

Post by bexander »

johu wrote: Wed Jan 11, 2023 6:36 pm Uh yeah, HW_PRIUS is just Gen2 Prius. Gen3 Prius should detect as generic HW_REV3
My Auris board seem to detect as REV2?
Screenshot_2023-01-12_09-10-33.png
Screenshot_2023-01-12_09-10-33.png (4.79 KiB) Viewed 2062 times
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Renault Clio Electrique -97

Post by bexander »

Was out driving yesterday and noticed that there are quite some oscillation when at 65-70km/h (280-310Hz) cruise or slightly lower torque request.
Tries to tune it by increase kp which helps reduce the phenomena but it also gives unwanted regen with kp at 800.
Adjusted other parameters as well but without desired effect.

Started the simulator and tested with less than 100% tourqe demand and I can see a oscialltion here as well for 25% and 12% torque demand.
Torque demand 100%
Torque demand 100%
Torque demand 50%
Torque demand 50%
Torque demand 25%
Torque demand 25%
Torque demand 12%
Torque demand 12%
Torque demand 6%
Torque demand 6%
Torque demand 3%
Torque demand 3%
The conclusion I can find is that when |Vd| is close to |Vq| the control loop start oscillating?
I will continue testing in the sim. Any suggestions on what to do is very welcome.
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Renault Clio Electrique -97

Post by bexander »

Reducing VLimMargin seem to reduce the problem but I'm not to keen on reducing the IRL, might cause other problems.
All plots with 12% Torque demand, VLimMargin is normaly set to 2000.
VLimMargin_2000
VLimMargin_2000
VLimMargin_1000
VLimMargin_1000
VLimMargin_100
VLimMargin_100
VLimMargin_0
VLimMargin_0
VLimMargin_4000
VLimMargin_4000
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Renault Clio Electrique -97

Post by bexander »

Reducing Ki also seem to reduce the issue.
All plots with 12% Torque demand.
Kp 500, Ki 10000
Kp 500, Ki 10000
Kp 500, Ki 5000
Kp 500, Ki 5000
Kp 500, Ki 2500
Kp 500, Ki 2500
Kp 500, Ki 20000
Kp 500, Ki 20000
Then decrease Ki and slightly increase Kp
Kp 600, Ki 5000
Kp 600, Ki 5000
Looks promising, needs testing in car.

Did som Accel/Coast as well to see how it will respond to step changes. There is a slower respons with lower Ki, as expected.
Kp 500, Ki 10000
Kp 500, Ki 10000
Kp 500, Ki 2500
Kp 500, Ki 2500
Kp 600, Ki 5000
Kp 600, Ki 5000
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Renault Clio Electrique -97

Post by Ev8 »

Not suprised that a lower ki is better I run a ki of 500 on my Lexus motors
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Renault Clio Electrique -97

Post by bexander »

Ev8 wrote: Fri Jan 13, 2023 7:47 am Not suprised that a lower ki is better I run a ki of 500 on my Lexus motors
That's very low compared to Johu's 10000 on the Prius transaxle.
What Kp are you running?
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Renault Clio Electrique -97

Post by Pete9008 »

My guess is that if you push ki too high the control loop becomes slightly unstable and its oscillations then start to interfere with the vlim loop. The two then fight each other. By reducing the margin you are effectively turning off the limiter, best stay at 2000 or above to make sure it has enough headroom. Reducing ki looks like the best approach here.

There were a couple of bugs in the old PI controllers (now fixed) that were partially masked by using high ki and I still wonder whether that is why such high values became common practice?

Edit - Ev8, 500 does sound a bit low but then its results that matter :), could you share your parameters, if I have time I'd like to have a look at how that works on the sim. Also what speed do you rev the motors to (higher speeds may need higher ki)?

Edit2 - the worst voltage component that the ki term has to deal with is the wLI term (both for d and q). The higher the speed (w), the higher the throttle (I) or the higher the motor inductance (L) the bigger it is and so the bigger ki needs to be. Once you find a value that works well with the 12% current demand check that it still gives good results at full throttle and high speeds as the lower value may be a little marginal there (worst case is when coming off the throttle at high speed as there is a large and rapid change in I which ki needs to keep up with).
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Renault Clio Electrique -97

Post by bexander »

Have been out test driving and tuning.
First I tuned Ki down and also Kp up to end up at Kp 700 and Ki 1200. Feels much better but the oscillation is still there.
Decided to try the Ki/Kp tuning procedure, viewtopic.php?p=45512#p45512.
The result I ended up with was Kp 700 and Ki 1000-2000. So the procedure seem to work well.
Set Kp 700 and Ki 1000 and made another test drive. Drives ok, the oscillation is still there but much less pronounced. A large log from the entire test drive adn also latest parameters.
log 11.csv
(147.59 KiB) Downloaded 50 times
Yaris_MGR_FW5_24_2023-01-13.json
(1.46 KiB) Downloaded 52 times
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Renault Clio Electrique -97

Post by Pete9008 »

Thanks for the data, will try to have a look this evening.

Also got a few other ideas that might help, will probably be a few days before I get to them though. Hoping one of them might help flatten the torque curve (looking at that plot you found has convinced me that there is more we can do) while one of the others may improve loop stability a little.

Think I may know how to get the inverter to measure Ld and Lq by itself too :)
Post Reply