Page 3 of 37

Re: Prius Gen2 adapter board development thread

Posted: Fri Apr 24, 2020 12:35 pm
by Kevin Sharpe
RetroZero wrote: Fri Apr 24, 2020 12:31 pm anything Gen 2 and Gen 3 compatible would open up huge potential for kit configurations 👍
Would also minimise the number of parts we have to put through testing 8-)

Re: Prius Gen2 adapter board development thread

Posted: Fri Apr 24, 2020 1:50 pm
by RetroZero
Yes 🤞👍

Re: Prius Gen2 adapter board development thread

Posted: Sun Apr 26, 2020 7:59 pm
by RetroZero
Hi again, just comming back to the add-ons for V3 board,to run the transaxle

1. At the very least you need 3 NPN transistors that operate the 12V PWM signals. -this is where a ULN2003 chip is a viable solution? example - https://i.ebayimg.com/images/g/qlQAAOSw ... -l1600.jpg . Then need to work out how to connect and set parameters.

2. Next you need to convert the bipolar -15V to +15V current feedback signals to 0-3.3V. A circuit has been posted earlier. You need MG2 current feedback for running FOC. Is this a good Example ?-http://www.icstation.com/images/big/pro ... 1_7347.jpg


I am working on 3 and 4 tomorrow :)

3. You need the blended in MG1 current feedback for charge mode (measure AC input current)
4. Then you can map one of the low side PWM signals, again via an NPN transistor, to the buck converter to allow HV battery charging.

Re: Prius Gen2 adapter board development thread

Posted: Mon Apr 27, 2020 5:51 am
by kiwifiat
RetroZero wrote: Sun Apr 26, 2020 7:59 pm
2. Next you need to convert the bipolar -15V to +15V current feedback signals to 0-3.3V. A circuit has been posted earlier. You need MG2 current feedback for running FOC. Is this a good Example ?-http://www.icstation.com/images/big/pro ... 1_7347.jpg
My previous quote of 15V p-p (-7.5V to +7.5V)may have been misinformation, I read a quote from some MIT guys the other day that they are 20V p-p which makes more sense for 400A resolution. I think that is what SciroccoEV was saying so apologies. Can anyone confirm?

Re: Prius Gen2 adapter board development thread

Posted: Mon Apr 27, 2020 6:39 am
by RetroZero
No problem, anything to move forward and rectify info along the way... So whilst waiting confirmation, might have to treat the bi-polar sensors as 20v (peak to peak). Whatever the values, I'm still trying to understand how to link up the circuits and set correct parameters... Here we go Google again today 😊
Good news is that it seems with some 'minor' mods, V3 could be a viable tested option going forward.

Re: Prius Gen2 adapter board development thread

Posted: Mon Apr 27, 2020 6:45 am
by Jack Bauer
Why is it always me who has to short circuit a car battery into the inverter and catch the current sensors output on the scope?? :)

Re: Prius Gen2 adapter board development thread

Posted: Mon Apr 27, 2020 9:37 am
by konstantin8818
Jack Bauer wrote: Mon Apr 27, 2020 6:45 am Why is it always me who has to short circuit a car battery into the inverter and catch the current sensors output on the scope?? :)
You the one who does this way better then others so far :lol: When we'll need to measure motor's torque, we'll ask Johu.... :evil:

Re: Prius Gen2 adapter board development thread

Posted: Mon Apr 27, 2020 11:26 am
by johu
Yes, health and safety FTW :P
kiwifiat wrote: Mon Apr 27, 2020 5:51 am My previous quote of 15V p-p (-7.5V to +7.5V)may have been misinformation, I read a quote from some MIT guys the other day that they are 20V p-p which makes more sense for 400A resolution. I think that is what SciroccoEV was saying so apologies. Can anyone confirm?
I was thinking more about this: viewtopic.php?f=14&t=228&start=210#p9400

Re: Prius Gen2 adapter board development thread

Posted: Mon Apr 27, 2020 12:29 pm
by RetroZero
As for short circuiting car batteries, Damien, you're the reference for it, and seems' like they don't blow up in your face...#happybatteryshortcircuiting!

Re: Prius Gen2 adapter board development thread

Posted: Mon Apr 27, 2020 4:50 pm
by RetroZero
Coming back to Current sensors.
1. Gen 2 inverter has 2 current sensors per ciruit: 2 for Mg1 (Phase V and W) and 2 for Mg2 (Phase V and W)
2. The current sensors are bi-polar - between 15 and 20 volts peak to peak (7.5v or 10v = 0 amps) Is it 15v or 20v, or is it in between these values?
3. V3 board uses these currents (converted to voltage of 0-3.3volts) to monitor over current (set in parameters by user) - only monitor?
4. V3 board has 2 Current inputs (converted to volts) - #pin 6 = II1 current - which means input current between -3v & +3v, AND #pin9 = II2
5. The +/-3v input from #pin 6 and #pin 9 are connected to a circuit in series BEFORE arriving at the V3 board. This circuit is the 'day counter' - example https://www.ebay.fr/itm/Adjustable-3A-D ... 2320889426
6.The MG1 Phase Currents V (converted into voltage) from the Inverter arrive via the 32 pin White Main connecter on pins #2 (GIVA)and #3 (GIVB). Why
2 wires? Is it positive and negative values?
7.My 2cents pea brain understands that GIVA & GIVB would connect to said 'day counter circuit board' in parallel- inputs (15v-20v), and then we set the output reference to 1.65v for input current of 0 volts.
8.If this is correct, we would duplicate the MG2 Phase Currents V via JP7 #pin 9?
9. We don't need or use Phase current W, OR is this where Johannes was talking about 'blending'? Does that mean we connect both MG current sensors in parallel to II1 and II2 respectively?

I hope the answer is not staring me in the face somewhere in the wikis (cause I looked), or I will have to go stab myself in the foot with a blunt object or something...
Again, sorry if questions seem stupid and redundant.

Re: Prius Gen2 adapter board development thread

Posted: Mon Apr 27, 2020 5:00 pm
by SciroccoEV
RetroZero wrote: Mon Apr 27, 2020 4:50 pm 2. The current sensors are bi-polar - between 15 and 20 volts peak to peak (7.5v or 10v = 0 amps) Is it 15v or 20v, or is it in between these values?
OK, one more time...

At zero current, the voltage output is zero.

The output voltage changes at 0.025V per Amp.

Output voltage is positive for positive current and negative for negative current.

It's bi-polar, as in the output voltage changes polarity. I really can't think of a way to make the description simpler.

Re: Prius Gen2 adapter board development thread

Posted: Mon Apr 27, 2020 5:42 pm
by RetroZero
Sorry, my mistake. Yes the 7.5 volts positive = maximum + Amps reading through current sensor. Inversely for negative 7.5volts.
When Amps is at 0 amps, it equals 0 volts.
However, V3 board only allows maximum input of 3.3volts. The zero value input from current sensors is converted to a 1.65volt value(through day counter), thus 3.3volts represents max positive current and 0v represents max negative current.
If that's correct, how do we go from 2 current sensors per circuit, with 4 pin connectors (GIVA, GIVB, GIWA, GIWB), to one pin II1?

Re: Prius Gen2 adapter board development thread

Posted: Mon Apr 27, 2020 5:53 pm
by SciroccoEV
The current outputs are described in this previously referenced source; http://techno-fandom.org/~hobbit/cars/ginv/i3elec.html

The A & B channels appear to simply be duplicates.

As I have previously proposed, the summing amplifier that performs the level shifting to can have a third input added.

Re: Prius Gen2 adapter board development thread

Posted: Mon Apr 27, 2020 7:19 pm
by johu
Thats great, I thought they were differential pairs or something. 4 wires eliminated, nice.

Re: Prius Gen2 adapter board development thread

Posted: Mon Apr 27, 2020 7:54 pm
by johu
So I'm thinking about the pin mapping of the ModICE connector. Would be nice to use the 20+12 version to make it obvious which plug goes where.

Lets see. Wires to inverter:
  1. GIVA - to level shifter 1
  2. MIVA - another input to level shifter 1
  3. GIWA - to level shifter 2
  4. MIVA - another input to level shifter 2
  5. MUU - PWM1
  6. MVU - PWM2
  7. MWU - PWM3
  8. VH - udc input
  9. MIVT - tmphs input
  10. MFIV - desat input
  11. CPWM - PWM2_N for charging
  12. GINV and GCNV and GND - ground everything here
So thats 12 pins used up. Inside the wiring loom I would constantly tie MSDN and CSDN (inverter 2 and boost converter shut down) to 12V. I don't see a reason to disable them at any point in time.

On the inverter side I need to drop 6 pins because we only have 20 pins on the ModICE. How about
  1. Encoder channel B/Resolver S3
  2. GND/Resolver center point S1S4
  3. Encoder channel A or single channel input/Resolver S2
  4. Index pulse input/5V output/Resover excitation R1
  5. Throttle Input (0-3.3V)
  6. 2nd Throttle Input (0-3.3V)
  7. Start input (12V)
  8. Brake Input (12V)
  9. Forward (12V)
  10. Reverse (12V)
  11. Motor Temperature Input -
  12. Motor Temperature Input +
  13. DC contactor output
  14. Precharge Output
  15. Misc output - e.g. for controlling brake booster vacuum pump
  16. Misc input - for measuring brake booster vacuum
  17. CANL
  18. CANH
  19. GND
  20. 12V
So as you see I'm trying to incorporate brake booster control or some other misc function, that switches a digital output with respect to some analog input. I've dropped a few IOs which would need to be handled by some CAN IO module if needed.

Re: Prius Gen2 adapter board development thread

Posted: Mon Apr 27, 2020 11:48 pm
by ZooKeeper
I do not see the need for 15 & 16, they are well controlled with simple vacuum switches.

Can motor Temp be a single input from a 5v or 3v3 reference? Most "engines" are that way.

Re: Prius Gen2 adapter board development thread

Posted: Tue Apr 28, 2020 12:32 am
by kiwifiat
SciroccoEV wrote: Mon Apr 27, 2020 5:00 pm
RetroZero wrote: Mon Apr 27, 2020 4:50 pm 2. The current sensors are bi-polar - between 15 and 20 volts peak to peak (7.5v or 10v = 0 amps) Is it 15v or 20v, or is it in between these values?
OK, one more time...

At zero current, the voltage output is zero.

The output voltage changes at 0.025V per Amp.

Output voltage is positive for positive current and negative for negative current.

It's bi-polar, as in the output voltage changes polarity. I really can't think of a way to make the description simpler.
So we have the transfer function but not the limits, it isn't possible to design a suitable conditioning circuit without knowledge of the output range.
Do you know what voltage the output saturates at? Are they 15V p-p or 20V p-p?

The http://techno-fandom.org/~hobbit/cars/ginv/i3elec.html site does not specify as far as I can see, maybe I'm going blind. It is particularly important for FOC to have accurate current data and especially important that the current inputs don't saturate when current is actually still increasing. Crap in equals crap out in other words for the FOC algorithm.

Re: Prius Gen2 adapter board development thread

Posted: Tue Apr 28, 2020 5:22 am
by johu
I would assume +/-600A or +/-15V to be a sensible range. So 30V p-p. FOC doesn't need that good SNR but I agree saturation would probably trigger a current limit.

EDIT: modified your design for roughly +/-15V and two inputs

Re: Prius Gen2 adapter board development thread

Posted: Tue Apr 28, 2020 5:56 am
by johu
ZooKeeper wrote: Mon Apr 27, 2020 11:48 pm I do not see the need for 15 & 16, they are well controlled with simple vacuum switches.
I remember Shane had a problem with the vacuum switch as it was lacking hysteresis so the pump would switch on and off multiple times. But anyway, it's just an application example.
ZooKeeper wrote: Mon Apr 27, 2020 11:48 pm Can motor Temp be a single input from a 5v or 3v3 reference? Most "engines" are that way.
Yeah I wish, but all electric motors I know just expose two wires of a sensor.

Re: Prius Gen2 adapter board development thread

Posted: Tue Apr 28, 2020 8:04 am
by SciroccoEV
kiwifiat wrote: Tue Apr 28, 2020 12:32 am So we have the transfer function but not the limits, it isn't possible to design a suitable conditioning circuit without knowledge of the output range.
Do you know what voltage the output saturates at? Are they 15V p-p or 20V p-p?
The linear output range of the current sensors likely exceeds the over current shutdown point of the power module.

Damien has performed short circuit tests to determine the approximate over current shutdown point.

Do I have to connect the dots for you?

Re: Prius Gen2 adapter board development thread

Posted: Tue Apr 28, 2020 8:14 am
by konstantin8818
johu wrote: Tue Apr 28, 2020 5:56 am Yeah I wish, but all electric motors I know just expose two wires of a sensor.
Isn't one of those wires connected to "common ground"? At least in Curtis controller and powerwatcher and even on Damien'g gen 2 board they are.

Re: Prius Gen2 adapter board development thread

Posted: Tue Apr 28, 2020 9:52 am
by RetroZero
"As I have previously proposed, the summing amplifier that performs the level shifting to can have a third input added"

Thanks Scirocco, but this is again over my electronics level. I 'sort of' understand the concept, and the changes Johu has done to your schematics proposal, but above me.
I found a differential summing op amp on Herdware.com, but don't know if it is the 'quick fix solution'. I am happy to pay someone to build this circuit, or let me know where I could find it as standard item and populate myself.

I am currently in position as "sitting duck" after realising that both boards cannot run a motor on its own. The 3 "extra" items require designing or aquiring as standard add ons....Depending on these 3 "extras", the appropriate board can then be ordered. Damiens being through hole, allows for more modifications from what I understand, but V3 is closer to a "tested" compatible solution (without much possibilities to modify once populated). :roll:
Glad my questions however have helped Johu to eliminate some wires :)

Re: Prius Gen2 adapter board development thread

Posted: Tue Apr 28, 2020 10:02 am
by johu
Why don't you just build that circuit on your strip board? Dual OpAmp and a few resistors. You can skip the second input, it is only needed for charging. You need to build the circuit TWICE (thus dual opamp) once for il1, once for il2.

EDIT: a solution that would run both inverters will need two mostly independent brain boards/a dual brain board and will obviously loose the ability to charge.

Re: Prius Gen2 adapter board development thread

Posted: Tue Apr 28, 2020 1:16 pm
by ZooKeeper
johu wrote: Tue Apr 28, 2020 5:56 am
ZooKeeper wrote: Mon Apr 27, 2020 11:48 pm Can motor Temp be a single input from a 5v or 3v3 reference? Most "engines" are that way.
Yeah I wish, but all electric motors I know just expose two wires of a sensor.
So 5v ref and signal like automotive? Let me do some testing on my MGR, but NTC or PTC, one should be able to be either common Vref or Gnd.

Re: Prius Gen2 adapter board development thread

Posted: Tue Apr 28, 2020 1:51 pm
by RetroZero
johu wrote: Tue Apr 28, 2020 10:02 am Why don't you just build that circuit on your strip board? Dual OpAmp and a few resistors. You can skip the second input, it is only needed for charging. You need to build the circuit TWICE (thus dual opamp) once for il1, once for il2.

EDIT: a solution that would run both inverters will need two mostly independent brain boards/a dual brain board and will obviously loose the ability to charge.

So V3 PWM outputs are 3.3v.
Main inverter 32 pin (MUU,MVU,MWU) require PWM input signals of 12v. This is where the ULN2003 solves the problem - boosts 3.3v to 12v?

Then the circuit for dual op amp receives the MG2 (GIVA and GIVB) inputs from inverter (15v p-p), and sends 0 - 3.3v signal to II1

Am I getting this?