Prius Gen2 adapter board development thread
-
- Posts: 481
- Joined: Thu Jul 04, 2019 6:35 pm
- Location: Somerset, UK
- Has thanked: 43 times
- Been thanked: 113 times
Re: Prius Gen2 adapter board development thread
I went back to trying out the delta light configuration but this time with LEDs, this time I only get one flashing LED. It looks like I am only getting full voltage between the back two phase wires on the inverter. The multimeter is reading 9.3v on the flashing led and 7.2v on the other two. This would explain why I was getting one bright and two dimmer incandescent bulbs.
Is this just a setting I have accidentally enabled? I'm intending to carry on regardless and hook up the motor this weekend. Seems more productive to get a motor turning than try to get the settings right to flash light bulbs.
Is this just a setting I have accidentally enabled? I'm intending to carry on regardless and hook up the motor this weekend. Seems more productive to get a motor turning than try to get the settings right to flash light bulbs.
-
- Posts: 759
- Joined: Tue Oct 29, 2019 2:48 pm
- Location: France
- Has thanked: 361 times
- Been thanked: 44 times
- Contact:
Re: Prius Gen2 adapter board development thread
I had the same - one light flashing more than the others.
-
- Posts: 759
- Joined: Tue Oct 29, 2019 2:48 pm
- Location: France
- Has thanked: 361 times
- Been thanked: 44 times
- Contact:
Re: Prius Gen2 adapter board development thread
So tried to refresh, still can access the web interface but no values. The refresh circles keep turning next to category and spot value menus.
- SciroccoEV
- Posts: 369
- Joined: Thu Oct 10, 2019 1:50 pm
- Location: Luton UK
- Been thanked: 15 times
Re: Prius Gen2 adapter board development thread
Sound like your Wifi adaptor isn't talking to the STM32.
-
- Posts: 481
- Joined: Thu Jul 04, 2019 6:35 pm
- Location: Somerset, UK
- Has thanked: 43 times
- Been thanked: 113 times
Re: Prius Gen2 adapter board development thread
okay I double checked ...and mine are like johu says, but taking his advise I pin swapped "sin cos" in the webinterface (S2 and S3) to get this better looking angle report .johu wrote: ↑Fri Jul 17, 2020 7:56 amGRF -> R1 (Pin 4)imwoody36 wrote: ↑Thu Jul 16, 2020 10:13 pm black GRF = exc a
white grfg=gnd
red GSN=ENC A
green GSNG= SIN a
Yellow GCs= ENC B
Brown Gcsg= cos a
and I believe the pin mapping JOHU provided shows
pin1 is ENC_B would be yellow
Pin2 is S1S4 would be ??
pin3 is ENC_A would be red
Pin4 is R1 ( exit a?) would be black
Pin 5 is Resolver 2 would be ??
so 6 wires and 5 connection points
my question is this , where does cos A belong and where does Sin A belong?
GRFG -> R2 (Pin 5)
GSNG and GCSG -> S1S4 (Pin 2)
GSN -> S2 (Pin 3)
GCS -> S3 (Pin 1)
Maybe I'm mistaken about the last two but thats what the pinswap parameter is for (if not moving, set to 2)
this is 3 complete revolutions.
but here is the rub
when I swap my wiring for those pins there is NO EFFECT! unless i againpinswap in the webinterface. WTF?
so clearly pinswap in software does not do that same feature as swapping the sin and cos wires on the resolver
dont you think this is a bug?
the priustoric boatcar guy
-
- Posts: 759
- Joined: Tue Oct 29, 2019 2:48 pm
- Location: France
- Has thanked: 361 times
- Been thanked: 44 times
- Contact:
Re: Prius Gen2 adapter board development thread
I might have cooked the STM then... Wifi lights up.
Even without wifi adapter connected, the LED next to R32 should flash no?
Any chance of checking voltage on ALIVE through hole points?
Even without wifi adapter connected, the LED next to R32 should flash no?
Any chance of checking voltage on ALIVE through hole points?
Re: Prius Gen2 adapter board development thread
Retro, I had a similar condition with my BluePill go at this and based on my web searching, the STM programmed just fine. For reasons I never figured out, the WiFi module (ESP8266-DEV in my case) & STM32 just absolutely would not communicate and it is beyond my technical knowledge to figure out, much less explain why.
My point, it might not be a fried STM, hoping not.
-
- Posts: 759
- Joined: Tue Oct 29, 2019 2:48 pm
- Location: France
- Has thanked: 361 times
- Been thanked: 44 times
- Contact:
Re: Prius Gen2 adapter board development thread
Is the wifi adapter part of the test when the board is first powered up?
Re: Prius Gen2 adapter board development thread
Resolver must be wound like this to achieve 90 degree spacing for sin and cos with 14 slots:
https://www.dynapar.com/hs-fs/hubfs/upl ... ndings.jpg
Oval rotor has two lobes so correct setting must be 1 pole pair for resolver, right?
https://www.dynapar.com/hs-fs/hubfs/upl ... ndings.jpg
Oval rotor has two lobes so correct setting must be 1 pole pair for resolver, right?
Re: Prius Gen2 adapter board development thread
yes, there are two lobes, and I am willing to accept that 1 pole pair is a good setting. thank you jap
I am noticing that my angle readout is changing even when the resolver is not moving. and I have connected another " test" resolver outside the motor just to see if there is any interference.
back to the pinswap feature.. what if I ( like damien in his youtube video) , need to pinswap pwm 2 and 3 but I also need to swap sin/cos
I cant do both with software, and when I swap the wires physically there is no effect.
I cant get over the fact that there is no way the (inverter control board v3) can control the motor in FOC mode if it does not read the resolver angle correctly.
maybe I need a low pass filter to get rid of that hysteresis (See previous photo)or maybe change the resolver frequency? by the way is there a published suggestion for the parameters descriptions like say for example resolver freq?
I am noticing that my angle readout is changing even when the resolver is not moving. and I have connected another " test" resolver outside the motor just to see if there is any interference.
back to the pinswap feature.. what if I ( like damien in his youtube video) , need to pinswap pwm 2 and 3 but I also need to swap sin/cos
I cant do both with software, and when I swap the wires physically there is no effect.
I cant get over the fact that there is no way the (inverter control board v3) can control the motor in FOC mode if it does not read the resolver angle correctly.
maybe I need a low pass filter to get rid of that hysteresis (See previous photo)or maybe change the resolver frequency? by the way is there a published suggestion for the parameters descriptions like say for example resolver freq?
the priustoric boatcar guy
- bexander
- Posts: 835
- Joined: Tue Jun 16, 2020 6:00 pm
- Location: Gothenburg, Sweden
- Has thanked: 63 times
- Been thanked: 89 times
Re: Prius Gen2 adapter board development thread
imwoody36: What signal is ploted in the picture? Is it one of ENC A or ENC B?
I would expect this signal to slowly rise and fall similar to a sine-wave. The signal ploted looks like a digita signal jumping from low to high?
I would expect this signal to slowly rise and fall similar to a sine-wave. The signal ploted looks like a digita signal jumping from low to high?
- Jack Bauer
- Posts: 3563
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 1 time
- Been thanked: 87 times
- Contact:
Re: Prius Gen2 adapter board development thread
Here are my parameters for running a Gen 2 MG2 with a Gen 3 inverter in foc mode. Bit of confusion going on so I'll try and answer a few basics.
-Although you will get a lovely looking graph with almost any combination of resolver wiring and swap params, only one will actually return the correct angle information to the FOC routine to calculate the rotor angle. The others will lead you down a path of frustration. Been there, done that.
-I originally had the pole pairs set wrongly but the motor would still spin just at the wrong speed and presumably less power.
-The trick here is to be methodical. I know its so tempting to have wires everywhere and trying 10 things at once. Slow down, label every wire, take notes and when tiredness and frustration creeps in, stop and come back tomorrow.
-Swapping sin and cos is NOT the same as swapping the POLARITY of either. Case in point when I tried to make the Tesla Model 3 rear drive unit spin with a Prius Gen 3 inverter this is the procedure I used:
-Connect as per tesla wiring diagram. Lovely graph, no spin just vibration.
-Swap Cos/Sin param. Same result.
-Back to original. Swap SIN polarity. Same result.
-Connect SIN back to normal polarity but swap COS polarity. Motor spins perfectly.
Hope this helps.
-Although you will get a lovely looking graph with almost any combination of resolver wiring and swap params, only one will actually return the correct angle information to the FOC routine to calculate the rotor angle. The others will lead you down a path of frustration. Been there, done that.
-I originally had the pole pairs set wrongly but the motor would still spin just at the wrong speed and presumably less power.
-The trick here is to be methodical. I know its so tempting to have wires everywhere and trying 10 things at once. Slow down, label every wire, take notes and when tiredness and frustration creeps in, stop and come back tomorrow.
-Swapping sin and cos is NOT the same as swapping the POLARITY of either. Case in point when I tried to make the Tesla Model 3 rear drive unit spin with a Prius Gen 3 inverter this is the procedure I used:
-Connect as per tesla wiring diagram. Lovely graph, no spin just vibration.
-Swap Cos/Sin param. Same result.
-Back to original. Swap SIN polarity. Same result.
-Connect SIN back to normal polarity but swap COS polarity. Motor spins perfectly.
Hope this helps.
- Attachments
-
- params_prius_gen2trans_new2020FOC.json
- (1.3 KiB) Downloaded 104 times
I'm going to need a hacksaw
-
- Posts: 759
- Joined: Tue Oct 29, 2019 2:48 pm
- Location: France
- Has thanked: 361 times
- Been thanked: 44 times
- Contact:
Re: Prius Gen2 adapter board development thread
I have a local electronic repair shop I am going to check out today to try and pick up a wifi adapter and LED. I am goin in blind at the moment.
Any pointers would be great for what else I might be able to check. My main question is whether I damaged the STM or not. Without schematics, it's a little hit and miss.
Any pointers would be great for what else I might be able to check. My main question is whether I damaged the STM or not. Without schematics, it's a little hit and miss.
Re: Prius Gen2 adapter board development thread
imwoody, what are your C1 and R1 values for this:
edit: confusing attachment removed, sorry about that.
edit: confusing attachment removed, sorry about that.
-
- Posts: 759
- Joined: Tue Oct 29, 2019 2:48 pm
- Location: France
- Has thanked: 361 times
- Been thanked: 44 times
- Contact:
Re: Prius Gen2 adapter board development thread
Thanks a million for that! I'll try to make some sense from it.
Re: Prius Gen2 adapter board development thread
that is the webinterface with " angle" selected. I dont see an option to show me ENC A or ENC B
you are right I would expect a sine, and no it is more like a square but when I turn slowly by hand the leading and trailing edges begin to look like a sine due to what I thought was noise. then I see the post below by JAP and Im thinking wait, what?
this is my board.
this is the first time I am hearing about a c1 and an R1. is that for this board???
then I see the wonderful file share by Damien ...whooo hoo! but how to install a json file?
time for some reading
( also huge shout out to Damien for encouraging...was considering taking up a bad habit )
the priustoric boatcar guy
Re: Prius Gen2 adapter board development thread
Oh, crap, sorry imwoody! I must have mixed up schematics when I was going through files on my computer. Prius board that you have is different, schematic from patreon package doesn't mention need to change anything for resolver setup..
- Jack Bauer
- Posts: 3563
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 1 time
- Been thanked: 87 times
- Contact:
-
- Posts: 759
- Joined: Tue Oct 29, 2019 2:48 pm
- Location: France
- Has thanked: 361 times
- Been thanked: 44 times
- Contact:
Re: Prius Gen2 adapter board development thread
whew! I was trying to make sense and then found patreon schematic....still don't know what I fried though
-
- Posts: 917
- Joined: Fri Apr 26, 2019 5:40 pm
- Has thanked: 310 times
- Been thanked: 192 times
Re: Prius Gen2 adapter board development thread
I think you should give us a procedure of what you did. When troubleshooting, you can't just say what's broken, it's often helpful to tell us how you progressed. You won't know if you did something wrong (or you wouldn't have done it). Try to make it as easy for people to help you as possible.
Right now it sounds like you're having the same problem I was having with a different board. My problem was that I didn't flash the bootloader file before I flashed the software itself. No one told me that when I described my problem. I found that out when I walked through what I did, and someone asked what happened when I flashed the bootloader, and I was like "Bootloader? What's that?" Just using that for illustration, not saying that's your problem.
Right now it sounds like you're having the same problem I was having with a different board. My problem was that I didn't flash the bootloader file before I flashed the software itself. No one told me that when I described my problem. I found that out when I walked through what I did, and someone asked what happened when I flashed the bootloader, and I was like "Bootloader? What's that?" Just using that for illustration, not saying that's your problem.
Re: Prius Gen2 adapter board development thread
status update:
improvement with damiens parameters installed (thank you !)!, will begin to hum and jerk when throttle is applied.
( and conversely will stop when throttle is released
not using any manual current, and im still not convinced the resolver is giving good angle data.
did try reversing sin in hardware, and then cos,
not getting a pretty sine wave on the angle plot like this page shows
https://openinverter.org/wiki/Web_Interface#Update
two of the three motor wires are warm, not melting but the third clearly is cold.
im going to drag a scope out to the work area and see if I can visualize anything. should I assume there is not a sin and cos readout in the webinterface?
here is a tube video of what I got
improvement with damiens parameters installed (thank you !)!, will begin to hum and jerk when throttle is applied.
( and conversely will stop when throttle is released
not using any manual current, and im still not convinced the resolver is giving good angle data.
did try reversing sin in hardware, and then cos,
not getting a pretty sine wave on the angle plot like this page shows
https://openinverter.org/wiki/Web_Interface#Update
two of the three motor wires are warm, not melting but the third clearly is cold.
im going to drag a scope out to the work area and see if I can visualize anything. should I assume there is not a sin and cos readout in the webinterface?
here is a tube video of what I got
the priustoric boatcar guy
- SciroccoEV
- Posts: 369
- Joined: Thu Oct 10, 2019 1:50 pm
- Location: Luton UK
- Been thanked: 15 times
Re: Prius Gen2 adapter board development thread
The angle data should go from 0 to 359 degrees and then back to 0.
Guess what shape that graph would look like.
Guess what shape that graph would look like.
-
- Posts: 759
- Joined: Tue Oct 29, 2019 2:48 pm
- Location: France
- Has thanked: 361 times
- Been thanked: 44 times
- Contact:
Re: Prius Gen2 adapter board development thread
Thanks for the advice, will try to keep it short.MattsAwesomeStuff wrote: ↑Wed Jul 22, 2020 4:58 pm I think you should give us a procedure of what you did. When troubleshooting, you can't just say what's broken, it's often helpful to tell us how you progressed. You won't know if you did something wrong (or you wouldn't have done it). Try to make it as easy for people to help you as possible.
BEFORE 'the problem' : I had 12V and GRND, LED PWR lit up and stayed ON and LED ALIVE flashed Red.
Communication via wifi - OK and web interface with values OK
Connected 2nd 12V supply for HV
Carried out Delta test with 3 X 21W light bulbs - one burnt brighter than the others but 1Hz flashing, solder joints maybe?
After playing with flslipspin and ampnom as per everyone helping here on the forum, I managed a spin up MG1 in Manual Mode from MG2 inverter output- Champagne!!
Connected standard 12V 20A relays for Precharge and Main contactors. Used a 3rd Relay ( IN and OUT switching circuit) to simulate precharge resitor - 40 Ohms. Precharge and Main contacter functioned correctly....
Connected 3 way position switch for Forward & Reverse - signal confirmed in values
Connected push button for STRT signal - OK
Connected MG2 inverter 12V signal to Forward and Reverse - thought MG2 ON signal is only required when direction is selected.
Connected Prius Gen 2 pedal - potnom would only activate from 90% to 100%, BUT communication via wifi still possible.
Wired up Resolver cabling (got it all wrong from what I see imwoody had done) along with Johu and what the rest of you posted, BUT, communication OK.
THEN : I had to leave my project a few days.....so when I returned, I decided to first clean up all my wiring.
I even anticipated higher HV, so connected 2nd series of more powerful relays, to be switched by the first set on original 12V Low voltage system.
Unable to get Precharge and Main contacters to function - No faults in web interface and Communication OK
4hrs later, went back to original relay set up. Unable to get Precharge and Main contacter to function correctly - Precharge remained ON permamnently. Put it down to bad connections and too many fuses all over the place.
Soldered up wiring and connected 12V supply and corresponding adapter board signals as before. Still only precharge relay staying ON.
All this time, LED Alive flashed and communication with board was OK.
THEN, I cut the precharge signal wire and denuded it for testing....I had 12V supply to the board connected.
When I moved the board for better testing position, the precharge signal wire (P16) 'fell' on the 12V supply I had close by....
Poof, and lights out was what happened next. LED PWR remains ON along with wifi adapter LED
Communication to wifi OK, web Interface communication is possible, but no values.
With a multimeter, I have confirmed at each through hole point that there is iether -3.3V, 5.5V or 0V.
Tested LED ALIVE with multimeter in diode Mode, doesn't beep, but I get the same with PWR LED. I do however get a resistance and then short circuit when testing in one of the directions. Confirmed PWR and ALIVE LED's values identicle...500 Ohm R32 resistor - OK
When GRND of multimeter on 0V 'reference' Q1 OUT_PRE and Q2 OUT_DCSW have 0v and 3.3V on each pins respectively.
How would I test the STM is not fried, or is there something else I should test before that?
I tried to reload parameters and reset web interface - no luck....
-
- Posts: 99
- Joined: Sat Dec 22, 2018 9:39 pm
- Location: Vancouver, Canada
- Been thanked: 10 times
Re: Prius Gen2 adapter board development thread
This is what your sine and cosine feedback signals should look like on a scope:imwoody36 wrote: ↑Wed Jul 22, 2020 6:56 pm status update:
improvement with damiens parameters installed (thank you !)!, will begin to hum and jerk when throttle is applied.
( and conversely will stop when throttle is released
not using any manual current, and im still not convinced the resolver is giving good angle data.
did try reversing sin in hardware, and then cos,
not getting a pretty sine wave on the angle plot like this page shows
https://openinverter.org/wiki/Web_Interface#Update
two of the three motor wires are warm, not melting but the third clearly is cold.
im going to drag a scope out to the work area and see if I can visualize anything. should I assume there is not a sin and cos readout in the webinterface?
here is a tube video of what I got
Clearly your signals are not sinusoidal. I suggest that you disconnect the sine and cosine connections from the control board and just scope the resolver driving signal with the resolver drive coil connected to the control board. It should be perfectly sinusoidal. If that looks ok next scope the sine and cosine feedback signals with them disconnected from the control board. Again the signals should be sinusoidal. Post your results. I would be inclined to double check your wiring, the sine and cosine coils have the same impedance and the driving coil will be significantly different and have a smaller value.