Gen 2 Charger V5 Software Development Thread

Topics concerning the Tesla front and rear drive unit drop-in board
User avatar
Kevin Sharpe
Posts: 1345
Joined: Fri Dec 14, 2018 9:24 pm
Location: Ireland and US
Been thanked: 4 times

Re: Gen 2 Charger V5 Software Development Thread

Post by Kevin Sharpe »

Jack Bauer wrote: Sat Apr 04, 2020 6:09 am Yes. Still no luck with this bug. Have confirmed no hardware problems.
What connector are you using at the car end for test? AFAIK most J1772 car plugs do not implement the cable current sense resistor.
This is a personal post and I disclaim all responsibility for any loss or damage which any person may suffer from reliance on the information and material in this post or any opinion, conclusion or recommendation in the information and material.
tom91
Posts: 1278
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 205 times

Re: Gen 2 Charger V5 Software Development Thread

Post by tom91 »

All type 2 cables should shave a resistor to identify them. The software, atleast when i wrote the base, takes the cable limit into account.

So it does the EVSE pwm limit first then checks if the cable limit is lower and adjusts if needed.
Founder Volt Influx https://www.voltinflux.com/
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Gen 2 Charger V5 Software Development Thread

Post by Jack Bauer »

Yeah this is a bug in the new STM32F103 firmware that doesnt seem to read the adc value correctly. Not related to the evse or cables used.
I'm going to need a hacksaw
User avatar
Kevin Sharpe
Posts: 1345
Joined: Fri Dec 14, 2018 9:24 pm
Location: Ireland and US
Been thanked: 4 times

Re: Gen 2 Charger V5 Software Development Thread

Post by Kevin Sharpe »

tom91 wrote: Sat Apr 04, 2020 12:54 pm All type 2 cables should shave a resistor to identify them.
They do, at the EVSE end (which then modifies the Pilot PWM accordingly)... the resistor at the vehicle end is a later addition to the standard. I suspect millions of cables exist without the resistor at the vehicle end (certainly we made many thousands without this resistor).

How does the software know whether it's a "Type 2" connector with a resistor and a "Type 1" ("J1772") connector without a resistor? What does it do if no resistor is installed?
This is a personal post and I disclaim all responsibility for any loss or damage which any person may suffer from reliance on the information and material in this post or any opinion, conclusion or recommendation in the information and material.
tom91
Posts: 1278
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 205 times

Re: Gen 2 Charger V5 Software Development Thread

Post by tom91 »

Kevin Sharpe wrote: Sat Apr 04, 2020 1:48 pm
tom91 wrote: Sat Apr 04, 2020 12:54 pm All type 2 cables should shave a resistor to identify them.
They do, at the EVSE end (which then modifies the Pilot PWM accordingly)... the resistor at the vehicle end is a later addition to the standard. I suspect millions of cables exist without the resistor at the vehicle end (certainly we made many thousands without this resistor).

How does the software know whether it's a "Type 2" connector with a resistor and a "Type 1" ("J1772") connector without a resistor? What does it do if no resistor is installed?
Software does not allow a cable without a resistor at the vehicle inlet. It needs to detect a cable plugged in on the proximity line to allow it to start the evaluation if it can allow charging.

You configure the Socket Type....
Founder Volt Influx https://www.voltinflux.com/
User avatar
Kevin Sharpe
Posts: 1345
Joined: Fri Dec 14, 2018 9:24 pm
Location: Ireland and US
Been thanked: 4 times

Re: Gen 2 Charger V5 Software Development Thread

Post by Kevin Sharpe »

tom91 wrote: Sat Apr 04, 2020 1:55 pm Software does not allow a cable without a resistor at the vehicle inlet. It needs to detect a cable plugged in on the proximity line to allow it to start the evaluation if it can allow charging.
Sorry, I was unclear, in all scenarios you have resistor(s) on the proximity pin at the car end of the cable.
tom91 wrote: Sat Apr 04, 2020 1:55 pm You configure the Socket Type....
What if the proximity resistor in the handle at the car end of the cable conforms to the J1772 'standard' (150R + 330R) rather than the IEC 61851 standard (100R, 220R, 680R or 1500R)?
This is a personal post and I disclaim all responsibility for any loss or damage which any person may suffer from reliance on the information and material in this post or any opinion, conclusion or recommendation in the information and material.
tom91
Posts: 1278
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 205 times

Re: Gen 2 Charger V5 Software Development Thread

Post by tom91 »

Kevin Sharpe wrote: Sat Apr 04, 2020 2:12 pm What if the proximity resistor in the handle at the car end of the cable conforms to the J1772 'standard' (150R + 330R) rather than the IEC 61851 standard (100R, 220R, 680R or 1500R)?
The Type 1 J1772 standard does not support cable rating, so there is no cable rating applied if the Charger is configured to Type 1.

The software detects the plug, using the resistor in the plug, with Type 2 it then also checks cable current limit, with Type 1 it can detect switch pushed or not and stop charging if the switch is pressed.
Founder Volt Influx https://www.voltinflux.com/
User avatar
Kevin Sharpe
Posts: 1345
Joined: Fri Dec 14, 2018 9:24 pm
Location: Ireland and US
Been thanked: 4 times

Re: Gen 2 Charger V5 Software Development Thread

Post by Kevin Sharpe »

tom91 wrote: Sat Apr 04, 2020 2:18 pm The software detects the plug, using the resistor in the plug, with Type 2 it then also checks cable current limit, with Type 1 it can detect switch pushed or not and stop charging if the switch is pressed.
Ok, I see the logic... I guess the question is how many "Type 2" cables exist in the wild without the RC resistor at the car end :?:

Adaptors at the car end also need some thought... thankfully this is all open source so I can modify the behaviour if I wish :D
This is a personal post and I disclaim all responsibility for any loss or damage which any person may suffer from reliance on the information and material in this post or any opinion, conclusion or recommendation in the information and material.
tom91
Posts: 1278
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 205 times

Re: Gen 2 Charger V5 Software Development Thread

Post by tom91 »

Kevin Sharpe wrote: Sat Apr 04, 2020 2:25 pm Ok, I see the logic... I guess the question is how many "Type 2" cables exist in the wild without the RC resistor at the car end :?:

Adaptors at the car end also need some thought... thankfully this is all open source so I can modify the behaviour if I wish :D
Yes that is the power of open source, you can a lot more easy adapt it to whatever situation you find yourself in.

There will always be some EVSE/installation that does not exactly follow the rules so you will always find new quirks/bugs.
Founder Volt Influx https://www.voltinflux.com/
User avatar
Kevin Sharpe
Posts: 1345
Joined: Fri Dec 14, 2018 9:24 pm
Location: Ireland and US
Been thanked: 4 times

Re: Gen 2 Charger V5 Software Development Thread

Post by Kevin Sharpe »

Jack Bauer wrote: Sat Apr 04, 2020 1:14 pm Yeah this is a bug in the new STM32F103 firmware that doesnt seem to read the adc value correctly.
Seen this App Note?

STM32 ADC modes and their applications 8-)
en.CD00258017.pdf
(236.26 KiB) Downloaded 169 times
This is a personal post and I disclaim all responsibility for any loss or damage which any person may suffer from reliance on the information and material in this post or any opinion, conclusion or recommendation in the information and material.
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Gen 2 Charger V5 Software Development Thread

Post by jon volk »

Have a Gen 2 charger coming on Friday and also picked up a couple blue pills to mess around with the ADC on the bench. Had a few stumbles getting accustomed to the IDE and code after messing with Arduino based stuff, but now have the charger software running on one of the blue pills. Ill see if I can make any headway.
Formerly 92 E30 BMW Cabrio with Tesla power
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Gen 2 Charger V5 Software Development Thread

Post by Jack Bauer »

Thanks Jon. Very much appreciate the support.
I'm going to need a hacksaw
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Gen 2 Charger V5 Software Development Thread

Post by jon volk »

I just got the ADC reading on the blue pill. Just need to change scaling values(possibly. they don't seem to align but I need to do more testing) in the evseread function. Should be have it wrapped up for testing tomorrow.
Formerly 92 E30 BMW Cabrio with Tesla power
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Gen 2 Charger V5 Software Development Thread

Post by jon volk »

Not up to speed with how github works, but give this a try.
Attachments
main.c
(44 KiB) Downloaded 120 times
Formerly 92 E30 BMW Cabrio with Tesla power
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Gen 2 Charger V5 Software Development Thread

Post by Jack Bauer »

Will give it a shot. Thanks Jon.
I'm going to need a hacksaw
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Gen 2 Charger V5 Software Development Thread

Post by jon volk »

Started messing with the actual charger. WIth the code I posted above, I can get the connection state to change on the bluepill test with varying the input voltage. When running the above code on the logic board. It seems stuck at unconnected reading back a value of 996-998 regardless of connection. I need to dig in a little further.
Attachments
Capture.JPG
Formerly 92 E30 BMW Cabrio with Tesla power
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Gen 2 Charger V5 Software Development Thread

Post by Jack Bauer »

Is the voltage on the pin of the stm32 actually changing?
I'm going to need a hacksaw
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Gen 2 Charger V5 Software Development Thread

Post by jon volk »

That’s what I need to verify, as well as my measured voltage at the connector. Garage was cold and ran out of time yesterday.
Formerly 92 E30 BMW Cabrio with Tesla power
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Gen 2 Charger V5 Software Development Thread

Post by jon volk »

Progress made. It turns out my prox input put wasnt fully seated in the molex connector. Once my oversight was fixed, we now have the J1772 connection state properly working.

Ive now run into another issue. My evse will click the AC voltage on as shown in the debug screen, but it will not command any current. There is also a toggling going on with the AC cur limit values. Need to look into that further. Any ideas there?

Video in action.
Formerly 92 E30 BMW Cabrio with Tesla power
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Gen 2 Charger V5 Software Development Thread

Post by jon volk »

Screen grab of the latest plug in.
Attachments
Capture.JPG
Formerly 92 E30 BMW Cabrio with Tesla power
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Gen 2 Charger V5 Software Development Thread

Post by Jack Bauer »

You the man Jon:) I had not gotten any further then the prox detect problem but I see there your cable limit is 0 that is why its not drawing any current. It's not setup to calc the cable limit from the new values from the adc I would guess.
I'm going to need a hacksaw
tom91
Posts: 1278
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 205 times

Re: Gen 2 Charger V5 Software Development Thread

Post by tom91 »

jon volk wrote: Sat Apr 25, 2020 2:00 pm Screen grab of the latest plug in.
That looks good to me the current request is what is shown in the debug. so it should be asking for 4444mA ac current into the phases.

What is your configuration?
Founder Volt Influx https://www.voltinflux.com/
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Gen 2 Charger V5 Software Development Thread

Post by jon volk »

Heres the settings I have in there. It appears the AC is being requested, but the EVSE is not supplying the requested voltage. If i look at the EVSE app, it shows as connected, but not supplying any current.
Attachments
Capture.JPG
Formerly 92 E30 BMW Cabrio with Tesla power
tom91
Posts: 1278
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 205 times

Re: Gen 2 Charger V5 Software Development Thread

Post by tom91 »

jon volk wrote: Sat Apr 25, 2020 2:23 pm Heres the settings I have in there.
Be good to do debugging on the pilot signal output values.

Like add at line 1284:

Code: Select all

  
  else
  {
    accurlim = (micros() - pilottimer) * 100 / duration * 600; //Calculate the duty cycle then multiply by 600 to get mA current limit
    printf( \r\n);
    printf("Pilot curlim: ");
    printf(accurlim);     
  }
This will be a pain to see as it will be a lot of data due to the 1000hz pwm. But should indicate if there is an issue interpreting it.

Also a can capture of the charger coms would be usefull just to check what is being sent and to make sure you are not just having a quick on the module side.
Founder Volt Influx https://www.voltinflux.com/
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Gen 2 Charger V5 Software Development Thread

Post by jon volk »

Added jumper wires to get an external CAN connection. Here is a snip while plugged in.
Attachments
7EEE10A4-A274-4244-941C-250E861F32B3.jpeg
CAN capture.xlsx
(89.45 KiB) Downloaded 127 times
Formerly 92 E30 BMW Cabrio with Tesla power
Post Reply