[DRIVING] Project RX8 , Prius gen2, Lexus transaxle to rwd

Tell us about the project you do with the open inverter
Post Reply
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Ev8 »

just graphed these logs, looks like synadv on mg1 is a little high, Im running the over modulated 5.25R
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Pete9008 »

On 5.25 syncadv shouldn't need adjusting, just leave it at the default (11 I think). It's now used for something different to the old syncadv and shouldn't need to change.

If ud doesn't stay at 0 then it is syncofs that's probably out and needs adjusting.

How easy is it to redo? I might be able to work back from the data you have to get to a revised syncofs value if its a pain.
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Ev8 »

I can redo tomorrow, I swear johannes described adjusting syncadv to stop ud changing with frequency..
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Ev8 »

When you say stay at zero am I looking for exactly 0 or within a couple of hundred points of jitter
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Pete9008 »

Depends when it was, a while ago it would have been. I would have liked to rename it to synccomp to avoid confusion but we stuck with syncadv.

Just close to zero, say ud below at 5% of uq should be fine.

Edit - just to explain the back emf on a motor (the voltage when it is spinning but not producing torque/no currents flowing) should be pure Uq (Ud of zero). If it isn't then the controller isn't reading the motor position correctly and so there is probably an error in syncofs. It's never going to be perfect but just get close.

Syncadv is now used to compensate for the delays between measuring the motor current/position and getting the new PWM value out to the IGBTs; it is largely fixed by the firmware and so shouldn't need to change.
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Pete9008 »

Just had a look at your logs using the calculator, if you change to a comma delimiter rather than a semicolon they will load right in, you can then select the region you want to analyse and it works out the numbers for you (although only flux linkage for these logs). It gives 112,5mWb for MG2 and 64.0 for MG1.

I think the wobble on the graph you mentioned is just the control loops settling at the start of the coast down. Just ignore that bit.

Ud looks fine on those, no problem with it at all. Just need to adjust it with scynofs not syncadj :)

Edit - plot from the calculator, wobble ringed can be ignored:
Ev8_mg2.jpg
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Ev8 »

Ok will see if I can get out this evening and have another go
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Pete9008 »

Just tried calculating Lq from your log, get 1.9mH (not much data to go on though). Is that anywhere close?

If it were me I'd have the handbrake on, in high gear and foot on the clutch ready to catch any overspeed just in case!

Might still have a play with the simulator, be interesting to see if my calculated offset matches you measured!

Edit - just checked, I used 2.2mH when doing simulator runs so seems possible (BTW, Lq was for MG2)

Edit - Just tried it in the simulator and changing syncadv from 11 to 18 needed me to then adjust syncofs from 0 to 64000 to compensate. So a change of -1500. That would to suggest that to get from 18 back to 11 would need around 1500 adding to syncofs. Sounds a bit big and I doubt that you would be that far out but with the cogging of the second motor I suppose it could be possible? Interested to hear your results.
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Ev8 »

ok i just got back in, these are the new spin down logs and the new params.
and yes I changed syncof of mg1 by 1200 to get back to 11 and by 600 on mg2. i can feel a good improvement in smoothness, lol 2 motors of 1 shaft is fun to setup!! but im glad ive fine tuned it by plotting ud and uq, as trying to find the deadband in syncof tuning with 2 lots of magnets trying to cog slightly out of sync only gets you so close.

went for a test drive, hit 325A peak
Attachments
params(MG2 16.01.23).json
(1.44 KiB) Downloaded 47 times
params(MG1 16.01.23).json
(1.44 KiB) Downloaded 48 times
log(mg2syncof13200syncadv11).csv
(6.42 KiB) Downloaded 42 times
log(mg1syncoff13200syncadv11).csv
(5.57 KiB) Downloaded 45 times
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Pete9008 »

That's great :) and when you put it like that it's amazing you got as close as you did!

Will have a look at the logs now

Edit: Looks good: MG1=67mWb, MG2=112mWb

Edit2: If you do want to try the MTPV stuff then it needs good values for flux linkage, Lq and Ld to have any chance of working so could do with a driving log for each motor too (see viewtopic.php?p=51168#p51168)
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Ev8 »

Cool, I will get some driving logs during the week, do they need to include full throttle acceleration or just normal driving?
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Pete9008 »

I'd probably do a couple, one normal driving and then a separate one with a higher power run (or are they both the same thing for you ;) )

Could do with avoiding hills and being as light as possible on the brakes for the normal driving one, regen is fine though. Basically anything that causes the car to speed up or slow down without the motor doing it introduces errors (the calculator assumes that acceleration and deceleration are purely due to the motor torque).

The motor parameters change with current and the calculator just takes the average of whatever is in the plot so if the log is on average normal driving then the calculated values should be good for normal driving too.
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Ev8 »

Ok got it! Thanks
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Pete9008 »

Just been looking at your MG2 data. I wasn't expecting there to be enough information in it to calculate Lq and Ld but it has come up with a pretty repeatable Lq=2.3mH and Ld=0.87mH. It will be interesting to see how much different the normal driving log is...
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Ev8 »

Cool. Very impressive
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Pete9008 »

I think it just shows how well Johannes code measures and controls Iq and Id and also that your motor is set up pretty accurately.

I'd have expected the signals to be down lost in the noise on a low power test like that but they aren't!
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Pete9008 »

Ev8 wrote: Mon Jan 16, 2023 7:05 pm I can redo tomorrow, I swear johannes described adjusting syncadv to stop ud changing with frequency..
Remembered the post that I think you were referring to, this one viewtopic.php?p=48358#p48358. I can see why you adjusted syncadv now. In that post Johannes was using a known good syncofs value to calibrate the new syncofs parameter (but if read out of context it can be taken the other way round).

@johu - any chance you could add a comment on the post to make it clear that syncadv shouldn't be changed?
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Ev8 »

Ahh that makes sense!
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Ev8 »

The cold weather finally killed off my 12v battery, it was only 30ah U1 battery designed for a ride on lawnmower, but the bms was drawing it down overnight, the bms draws less than 100ma so the battery was knackered, I have replaced it with a cheap Chinese 12v lifepo4 battery again 30ah but half the size, has its own internal bms, a couple of days in and it seems to be doing the job!

https://www.ebay.co.uk/itm/325352465559 ... media=COPY
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by arber333 »

Sorry about the off topic but i think it is best to just ask.
I am dealing with a friends RX8 and he is missing ecu. Do you know which CAN telegrams to send to dash to get the PSU alive and possibly to get RPM dial to move?
Thanks

Arber
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Ev8 »

If you broadcast rpm as rpm*3.85 across bytes 0 and 1 on can id 201 this will both start the powersteering and run the rev counter.
I simply sweep the needle once on startup so the powersteering is always on as once it see any rpm in will work.

ive attached my code, its a bit hacky and heavily borrowed from other peoples work and please excuse the horrible /8 on the micro and millis this is because i adjusted one of the timers to increase the frequency on a pwm pin and hadn't realised that pin used the same timer as the millis function
Attachments
rx8can_v1.4__8khz_pwm_adjusted_micros_.ino
(10.64 KiB) Downloaded 49 times
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by arber333 »

Ev8 wrote: Wed Jan 18, 2023 7:22 pm If you broadcast rpm as rpm*3.85 across bytes 0 and 1 on can id 201 this will both start the powersteering and run the rev counter.
I simply sweep the needle once on startup so the powersteering is always on as once it see any rpm in will work.

ive attached my code, its a bit hacky and heavily borrowed from other peoples work and please excuse the horrible /8 on the micro and millis this is because i adjusted one of the timers to increase the frequency on a pwm pin and hadn't realised that pin used the same timer as the millis function
Wow that was fast! Thank you. I will put this into my ESP32 VCU code and try to feed the mazda 0x201 pill.
When i sort it out i will publish here OK ? :)
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Ev8 »

yep no problem!
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Ev8 »

Just got back from little logging, some of them might not be much use as it looks like a couple were cut short thanks to wifi going out, but i hope there is some data Pete can use for his wizardry
Attachments
log(MG2) 4.csv
(15.27 KiB) Downloaded 43 times
log(MG2) 3.csv
(2.85 KiB) Downloaded 42 times
log(MG2) 2.csv
(13.13 KiB) Downloaded 43 times
log(MG2) 1.csv
(15.16 KiB) Downloaded 44 times
log(MG1) 4.csv
(13.6 KiB) Downloaded 41 times
log(MG1) 3.csv
(13.39 KiB) Downloaded 43 times
log(MG1) 2.csv
(12.47 KiB) Downloaded 39 times
log(MG1) 1.csv
(7.73 KiB) Downloaded 42 times
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Project RX8 , Prius gen2, Lexus transaxle to rwd

Post by Ev8 »

and current params
Attachments
params(MG2 16.01.23).json
(1.44 KiB) Downloaded 44 times
params(MG1 16.01.23).json
(1.44 KiB) Downloaded 40 times
Post Reply