[DRIVING] VW Beetle 2003

Tell us about the project you do with the open inverter
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: VW - Beetle 2003

Post by Pete9008 »

Think I know what is causing your trips, have a look at viewtopic.php?t=2611&start=900. Just checked your parameter file listed on the previous page of this thread and your CT adc input is going to start to clip at 455A !!
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: VW - Beetle 2003

Post by Bigpie »

Ahh, I understand on a high level. I guess adjusting some resistors on the logic board will scale it down?

TBH, you've already made it 100% better so if this is as good as I can get out of the current hardware pretty happy with it

Edit, just another note, I have the gen3 Prius board but the inverter I've got in there at the minute is a from a Yaris but with the Prius main capacitor. Not sure if the physical current sensors differ. Think I've got the Prius sensors somewhere.
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: VW - Beetle 2003

Post by Pete9008 »

You got it, exactly.

Nice to know what it is though and also explains why keeping throtcur below 4.5 helps. Also explains the problems you had with the sim, looking at the plot you posted you can see it breaking whenever the current rose above 450A.
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: VW - Beetle 2003

Post by Pete9008 »

Bigpie wrote: Sun Feb 12, 2023 7:37 pm Edit, just another note, I have the gen3 Prius board but the inverter I've got in there at the minute is a from a Yaris but with the Prius main capacitor. Not sure if the physical current sensors differ. Think I've got the Prius sensors somewhere.
Can't comment on that, I know the MG1 and MG2 scaling is different on the Prius but not idea what was on the Yaris.
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: VW - Beetle 2003

Post by Bigpie »

Screenshot 2023-02-12 at 9.16.32 pm.png
Would changing R59 to 20k and halving the scaling be the fix or am I wayyyy of in my understanding?
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: VW - Beetle 2003

Post by Pete9008 »

Now that's interesting, that's similar to the circuit block that I'm currently modding onto my logic board! Gives me confidence that I'm going in the right direction with it. I'm wondering whether I've been looking at the wrong set of reference schematics. Where is that circuit from?

Not sure R59 is the resistor I'd change, probably reduce R44 instead but need to work out the gain equations first (the standard circuit gives a bipolar output, that one has been tweaked to cope with the stm32 adc's 1.65v midpoint offset) to make sure the 0A point stayed in the right place.
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: VW - Beetle 2003

Post by Bigpie »

VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: VW - Beetle 2003

Post by Pete9008 »

Thanks, that explains it, I was looking at the dual motor version and I can't see them on that.
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: VW - Beetle 2003

Post by Ev8 »

Oh wow, very good spot, I wonder what current levels the gen2 board starts clipping at
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: VW - Beetle 2003

Post by Pete9008 »

Bigpie wrote: Sun Feb 12, 2023 9:23 pm Screenshot 2023-02-12 at 9.16.32 pm.png
Would changing R59 to 20k and halving the scaling be the fix or am I wayyyy of in my understanding?
What kind of full scale current are you after? Bear in mind the bigger you go the worse the resolution at low current becomes.
Assume you have both MG1 and MG2 current going through the MG2 CT?
Ill try to have a look at what resistor value change would do the job this evening.
Ev8 wrote: Mon Feb 13, 2023 6:50 am Oh wow, very good spot, I wonder what current levels the gen2 board starts clipping at
Just looking at your MG2 param file I would guess at around 644A, would need to know the circuit to be sure though. If you have a link I can have a look?
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: VW - Beetle 2003

Post by Bigpie »

I am running both through MG2. I'm happy enough at throtcur 4.5 though I rarely do get a cut out by stamping on it it would be good to eliminate completely, but more for interests sake than anything. The car performs fine for its required duties.

Tempted to sell the leaf motor and get a RX400h transmission for a future project though. EV8 has proved they work well and the space and weight saving appeal.
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: VW - Beetle 2003

Post by Pete9008 »

Bigpie wrote: Mon Feb 13, 2023 11:16 am I am running both through MG2. I'm happy enough at throtcur 4.5 though I rarely do get a cut out by stamping on it it would be good to eliminate completely, but more for interests sake than anything. The car performs fine for its required duties.
In that case I might be more tempted to detect the adc maxing out in software and derate. Keeps the full resolution and probably safer overall - @johu, what do you think, possible or not?
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: VW - Beetle 2003

Post by johu »

Pete9008 wrote: Mon Feb 13, 2023 11:32 am In that case I might be more tempted to detect the adc maxing out in software and derate. Keeps the full resolution and probably safer overall - @johu, what do you think, possible or not?
That or just have a dynamic upper limit for throtcur/fwcurmax depending on the current sensor gain factors. Say you have ilxgain=1 then your maximum phase current is about 2000A and with some mystery factor you can arrive at maximum throtcur from that.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
royhen99
Posts: 195
Joined: Sun Feb 20, 2022 4:23 am
Location: N. Wiltshire. UK
Has thanked: 14 times
Been thanked: 94 times

Re: VW - Beetle 2003

Post by royhen99 »

I don't think that the ADC is limiting, the maximium output for the circuit above is 3.24V with 0V input. If the current sensor response is as on github, 1-9V then the ADC will not see above 3V.
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: VW - Beetle 2003

Post by Pete9008 »

The trouble is the CT output can actually exceed those values. The op amps in the CT are powered from -5v and 26v and can probably get to an output of -2V to possibly up to somewhere near 20V! We tend to push them a little bit past Toyotas 1-9v range (which is based on guaranteed output under worst case conditions).

If you work back from the possible 12bit adc range, through Bigpie's current gains and compare this with the currents measured it is right on the limit (and that's assuming a perfect mid rail reference which is unlikely).
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: VW - Beetle 2003

Post by Ev8 »

Bigpie wrote: Mon Feb 13, 2023 11:16 am

Tempted to sell the leaf motor and get a RX400h transmission for a future project though. EV8 has proved they work well and the space and weight saving appeal.
Rx400h transaxle does weigh a freaking ton, 2 person lift job! Also worth taking a look at the gear ratios as I think you’ll struggle to spin mg2 much past 5.5k rpm,

Edit, not sure of the actual reduction ratio in rx400h transaxle but if you guess at 8.615:1 (Prius gen3) then guess a tire diameter of 660mm then you’ll need to spin mg2 to 8k to hit 70mph , I’ll play with the simulator later but I’ve not got mg2 to more than 5600rpm in the sim
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: VW - Beetle 2003

Post by Pete9008 »

royhen99 wrote: Mon Feb 13, 2023 12:25 pm I don't think that the ADC is limiting, the maximium output for the circuit above is 3.24V with 0V input. If the current sensor response is as on github, 1-9V then the ADC will not see above 3V.
Is this the graph you are referring to?
https://github.com/damienmaguire/Prius- ... _curve.jpg
If so I see your point, that would suggest that we should comfortably have a 600A range. Something isn't right there though, my fairly rough measurements suggest 10mV/A for MG2 (and I'm fairly sure I've seen that figure elsewhere too) which doesn't tie up with that plot. Could the plot be for the Gen2 (the numbers seem to match Ev8 gain parameters much better and he is using the Gen2)?

Has anyone characterised the CTs using a decent current source or measured one against an accurate meter?

Either way I still think the adc is clipping on Bigpie's setup based just based on the adc range, Ilxgains and measured currents. If the current sensor gains are wrong it's still clipping but the current is being under (or over?) reported.
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: VW - Beetle 2003

Post by Pete9008 »

johu wrote: Mon Feb 13, 2023 12:20 pm That or just have a dynamic upper limit for throtcur/fwcurmax depending on the current sensor gain factors. Say you have ilxgain=1 then your maximum phase current is about 2000A and with some mystery factor you can arrive at maximum throtcur from that.
Could do although I'm guessing that is how Bigpie arrived at the 4.5 setting!

To me it's more something that should never happen but if it does the user could do with knowing about it - maybe add an entry in the error log or light the MIL?
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: VW - Beetle 2003

Post by Bigpie »

I just kept increasing it until performance was ok and used a rough idea of when the MG1 and MG2 stages cutout, 450A seemed low enough below the sum of both.
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: VW - Beetle 2003

Post by Ev8 »

That’s the sensible tuning method! I imagined a target performance and decreased throtcur until It no longer cut out on sustained full throttle lol,
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: VW - Beetle 2003

Post by Bigpie »

:D That seems completely on brand. Start at 11.
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: VW - Beetle 2003

Post by Pete9008 »

But the question is does it trip because you hit the desat limit or does it trip because the adc clips, the control loops keep trying to increase the current to hit the target, the current spikes and then it hits desat?
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: VW - Beetle 2003

Post by Bigpie »

Not sure. Just seen a post by bexander, his gains are higher than mine
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: VW - Beetle 2003

Post by Pete9008 »

TBH I can't really see huge value in high absolute accuracy on the current sensors. As long as they don't clip, are linear, 0A is in the right place and the inverter isn't overheating/going into desat it doesn't make a huge difference to anything. It will affect the values used for Lq, Ld and flux linkage a bit but not enough to be of great concern. The battery current is the one that is more important and most people seem to use a dedicated sensor for that anyway.

Edit - still nice to be in the right ballpark though.
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: VW - Beetle 2003

Post by Bigpie »

What a long day, set off at 7ish to go meet Dom for another battery back.

First rapid charge took some getting going, thankfully I was overcautious and stopped early, charged 40% to 90% and carried on my way. Next stop another 35 miles or so someone in an Etron had pulled up and there was only 1 unit. Decided to carry on to next a couple of junctions away, 2 instavolt units. 1 had a leaf not charging Infront and another free. As I was jumping on, an AA man appeared to say he was here for the leaf that was flat and wouldn't charge. I tried both units and sure enough no cigar. I was on 19% and Dom was still waiting 20 minutes away.

Thankfully he was kind enough to meet me there to do the deal, I now had another ~9kwh but I couldn't use it.

My aunt lives about 10 miles from this charger and there's no other rapids in range, Leicester is pretty poor for a major city.
I managed to get to her house, just, 2.8v min cell, proper empty.

4 hours on a granny, enough to get me to a BP outside of Loughborough when I got there it was occupied, so I pushed on to McDonald's instavolt. There was only one unit there, also occupied but I didn't have much left so waited and got a charge.

Not enough to get home, so headed back to the first instavolt of the day. Theres 2 at this site, the one I used earlier occupied and the second was free, awesome. I tried it a couple of times, was just about to get laptop out for some debugging and the fella next door moved, so I just swapped to that one and filled up. I got home just before 8pm.

Each time you use an instavolt they put a £30 preauth on the card, so by now I much have £300 of preauth transactions on my card that take a few days to go.

I did 178 miles, battery was under 30 degrees, just. It was a stressful day. The charging infrastructure is too patchy and unreliable especially with a tiny pack.

Forgot to mention, the leaf was a rental and the renter had just buggered off and left the AA man. While debugging, the station wasn't able to measure any voltage. It was just reporting 0 volts on both units. Someone did get the CCS going though.
Attachments
IMG_20230218_112649242.jpg
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Post Reply