Page 3 of 4

Re: Foccci wakeup/sleep discussions

Posted: Tue Mar 19, 2024 7:15 pm
by tom91
celeron55 wrote: Tue Mar 19, 2024 7:08 pm I would prefer someone to confirm this who has actually tested it though. And I haven't heard of the other brands.
Yes I have ran this a few times, it works. Most chargers will be like this too as the CP in the EV needs a diode, the -12V is for the station to make sure its not a rouge resistance on the CP to ground.

Re: Foccci wakeup/sleep discussions

Posted: Thu Apr 04, 2024 7:16 pm
by johu
Added the wakeup code now: https://github.com/uhi22/ccs32clara/com ... 1cafeb7baa and https://github.com/uhi22/ccs32clara/com ... 4cbf3d1d28

First, the wakeup sources
  1. Wakeup pin - bidirectional - level triggered (12V)
  2. Button - level triggered (GND)
  3. PP - optional via solder bridge - level triggered
  4. CP - Edge triggered
So the first 3 inputs will force the Foccci on. It can't turn itself off as long as that wakeup source is active. The last input will only trigger when transitioning from invalid to valid PWM and then Foccci can decide how long to stay awake. All modes always work regardless of software settings - except PP wakeup which can be turned off in hardware.

I came up with 5 modes for the wakeup OUTPUT
  1. Level - as long as the Foccci doesn't decide to turn off, we keep Wakeup on as well
  2. Pulse - When Foccci boots generate a 1s wakeup pulse
  3. LevelOnValidCp - As long as CP is pulsing we keep wakeup on
  4. PulseOnValidCp - Whenever we transition from non-pulsing to pulsing CP we generate a 1s pulse
  5. LevelOnValidPp - As long as PP is valid keep wakeup on
Some application examples
1st, Touran good enough approach
wakeup via PP enabled, WakeupPinFunc=LevelOnValidPp
  1. Foccci turns on as soon as even a non-powered charging cable is plugged in
  2. Wakeup signal is turned on
  3. BMS, VCU etc. is turned on (directly powered from wakeup as it can supply about 1A)
  4. VCU can detect via the level of the wakeup signal that a cable is plugged in and inhibit drive
  5. When charging cable is unplugged (as in PP lost), Wakeup is turned off and the VCU can allow driving
  6. If we wanted to report e.g. welded charge port relays Foccci would have to keep itself running until the car is started in drive mode again. Then something can be displayed on the instrument cluster. Of course this will time out eventually. Should be fine as you at least have to pull away from the rapid charger after charging.
  7. When charging is paused all ECUs stay on and consume 12V power (or HV power via DC/DC)
2nd, the distributed approach
wakeup via PP disabled, WakeupPinFunc=PulseOnValidCp. Here we have a bidirectional wakeup bus. Any ECU connected to it can send or receive wakeup events and the individual ECUs can decide whether they are needed for a particular task or not.
  1. Foccci turns on as soon as CP PWM starts. So either a cable is being plugged in or is already plugged in and now wants to charge
  2. It then turns on the wakeup output for 1s and wakes up all other ECUs
  3. The relevant ECUs will detect that we want to charge and stay on, the other ones turn off
  4. If we turn on ignition the VCU is already on and in charge mode and can inhibit drive
  5. If charging is paused (i.e. cable plugged in but no CP PWM) and we turn on ignition the VCU wakes up the Foccci and queries PP status. If something is plugged in drive is inhbited
  6. If Foccci detects an error e.g. welded relays, it stores that error to flash. When woken up by the VCU it report its non-zero error code
  7. When charging is paused, ALL ECUs can turn off and no 12V power is consumed. When CP comes back, the cycle restarts
The second approach is more versatile but it also means all devices need to support this method.
So I think there can be an intermediate approach:
3rd accessible sleep approach
Here we only have a wakeup bus between VCU and Foccci. All other devices are powered up by other means, like VCU controlled relays. Wakeup via PP is disabled, WakeupPinFunc=LevelOnValidCp
  1. Foccci turns on as soon as CP PWM starts. So either a cable is being plugged in or is already plugged in and now wants to charge
  2. It then turns on the wakeup output this waking up the VCU
  3. The VCU determines via CAN message from Foccci whether we want to AC or DC charge and turns on needed components. Components needed in both cases that have low power consumption (e.g. BMS) can also be driven from the wakeup signal directly
  4. If we turn on ignition the VCU is already on and in charge mode and can inhibit drive
  5. If charging is paused (i.e. cable plugged in but no CP PWM) and we turn on ignition the VCU wakes up the Foccci and queries PP status. If something is plugged in drive is inhbited
  6. If Foccci detects an error e.g. welded relays, it stores that error to flash. When woken up by the VCU it report its non-zero error code
  7. When charging is paused, ALL ECUs will turn off and no 12V power is consumed. When CP comes back, the cycle restarts
Someone care to transfer this to the wiki? And better still garnish it with diagrams?

Re: Foccci wakeup/sleep discussions

Posted: Fri Apr 05, 2024 12:02 pm
by Bigpie
Is focci able to detect the duty of CP and if it's over 5% switch over the CP to the OBC for AC charging?

Re: Foccci wakeup/sleep discussions

Posted: Fri Apr 05, 2024 12:12 pm
by tom91
At the moment no, as ran out of pins. So you would need an external VCU to do this, easily done with something like Zombie ;)

Re: Foccci wakeup/sleep discussions

Posted: Fri Apr 05, 2024 12:53 pm
by johu
Bigpie wrote: Fri Apr 05, 2024 12:02 pm Is focci able to detect the duty of CP and if it's over 5% switch over the CP to the OBC for AC charging?
Like Tom says, it's not really intended.
What I do see is removing the 2k7 from foccci and just paralleling OBC and Foccci. Then the 2k7 inside the charger is used to enter state B. So when DC charging Foccci switches to state C, when AC charging Foccci doesn't touch CP and leaves this to the charger.

Re: Foccci wakeup/sleep discussions

Posted: Fri Apr 05, 2024 12:54 pm
by Bigpie
Might just do the Damien Maguire method then, normally closed on a relay to AC charger and flip a switch for CCS

Re: Foccci wakeup/sleep discussions

Posted: Wed Apr 24, 2024 1:07 pm
by evMacGyver
For AC charge using CAN controlled chargers its software change and something that would work for me. Or is there some downsides to think? Isn't it like LIM does AC, at least cable/charge currents are available thru can bus?

Plan is to charge from solar, have Johu or anyone else done this type of AC charger control? What would be best approach keeping plug connected, how charger could get vehicle to sleep and wake when needed? Is there any another way than stop sending CP completely during nights and start again next day? PP is low all the time.

Re: Foccci wakeup/sleep discussions

Posted: Wed Apr 24, 2024 2:58 pm
by johu
The EVSE should shut down CP (or make it 12V) when setting current limits below 6A. Or and least when sending an explicit stop command.

In that case you'd omit PP wakeup. CP wakeup is always active. So basically go with the 3rd approach from here viewtopic.php?p=69417#p69417

Foccci will then sleep 10s after CP stops pulsing and wake back up when it starts.

Re: Foccci wakeup/sleep discussions

Posted: Thu May 30, 2024 5:19 pm
by xvyDFatih
Hi

I have 4.2 and 4.5 versions. Im connecting to Ac charge station. Im getting cp error. Actually it works with one charge station. But it didnt work with other two station.

What can be problem? Thanks nest wishes

Re: Foccci wakeup/sleep discussions

Posted: Thu May 30, 2024 6:58 pm
by uhi22
What do you mean with CP error? Where/how do you observe this? Do you use CAN to control the state C? Does the charger close the relay if you just connect 2k7 and diode, and in a second step the 1k3? Foccci should do nothing else.

Re: Foccci wakeup/sleep discussions

Posted: Fri May 31, 2024 6:09 am
by xvyDFatih
uhi22 wrote: Thu May 30, 2024 6:58 pm What do you mean with CP error? Where/how do you observe this? Do you use CAN to control the state C? Does the charger close the relay if you just connect 2k7 and diode, and in a second step the 1k3? Foccci should do nothing else.
When i connected to ac charger im getting cp error from ac charger evse. Also im.measuring 4.56 - 4.69k between cp gnd on focci board. I can control state c, ac charger is giving cp error. I didnt understand why?

Re: Foccci wakeup/sleep discussions

Posted: Fri May 31, 2024 6:58 am
by uhi22
image.png
If your charging station tells you a CP error, it want's to say that it did not detect the circuit in blue box.
I see three potential root causes:
1. The charging station is defect and tells bullshit.
2. The wiring between the charging station and Foccci is wrong.
3. The Foccci does not behave like the blue box.

To find out, which of these is the case, I propose that you grab a diode, two resistors and a switch, build the blue box, and connect it to the charger. With this you can find out whether (1) is the true. And then connect the same circuit instead of Foccci, so you can check whether (2) is true.

The resistance measurement at the vehicle inlet is tricky, because there is the series of diode and 2k7, so depending on the multimeter it shows "something" above 2k7 in the one direction and "infinite" in the other direction.

Re: Foccci wakeup/sleep discussions

Posted: Fri May 31, 2024 7:19 am
by xvyDFatih
uhi22 wrote: Fri May 31, 2024 6:58 am image.png

If your charging station tells you a CP error, it want's to say that it did not detect the circuit in blue box.
I see three potential root causes:
1. The charging station is defect and tells bullshit.
2. The wiring between the charging station and Foccci is wrong.
3. The Foccci does not behave like the blue box.

To find out, which of these is the case, I propose that you grab a diode, two resistors and a switch, build the blue box, and connect it to the charger. With this you can find out whether (1) is the true. And then connect the same circuit instead of Foccci, so you can check whether (2) is true.

The resistance measurement at the vehicle inlet is tricky, because there is the series of diode and 2k7, so depending on the multimeter it shows "something" above 2k7 in the one direction and "infinite" in the other direction.
I tried with 3 evse. One is working and charging. Second is giving cp error. Also i guess evse ac charge station is like second.

1. The charging station is defect and tells bullshit.
I have small evcc for ac charging. Charger is working with it.
2. The wiring between the charging station and Foccci is wrong
It is true. Because other charger is working and charging.
3. The Foccci does not behave like the blue box.
Why is charging one charger. Why is not behaving like blue side? What can we do



Also i connect 2.7k and switch and 1.3k. Charger is working with it
Also i measured the cp side with oscilloscope, pwm values are 26-27. That is no problem about it

Re: Foccci wakeup/sleep discussions

Posted: Fri May 31, 2024 7:35 am
by uhi22
Two ideas:
- check the voltage levels of the PWM with the oscilloscope. It should be -12V and +9V after plugged-in, and later, when the charging is active, it shall be -12V and +6V.
- Foccci does not contain more than the blue box. But if Foccci would have closed the state C switch, some chargers may complain because the switch should be open at the beginning and close later. Some chargers may not be interested in this, and may working even if plugging-in which state C is already closed.

[Edit] and another test: use a 12V power supply and a 1k resistor, to simulate the charging station. Connect this to your vehicle CP and PE. Expected is 9V in this case.

Re: Foccci wakeup/sleep discussions

Posted: Fri May 31, 2024 8:06 am
by xvyDFatih
uhi22 wrote: Fri May 31, 2024 7:35 am Two ideas:
- check the voltage levels of the PWM with the oscilloscope. It should be -12V and +9V after plugged-in, and later, when the charging is active, it shall be -12V and +6V.
- Foccci does not contain more than the blue box. But if Foccci would have closed the state C switch, some chargers may complain because the switch should be open at the beginning and close later. Some chargers may not be interested in this, and may working even if plugging-in which state C is already closed.

[Edit] and another test: use a 12V power supply and a 1k resistor, to simulate the charging station. Connect this to your vehicle CP and PE. Expected is 9V in this case.
1. It is showing 5.6 volt in state b. I think no problem between states on focci.

2. I will try

Re: Foccci wakeup/sleep discussions

Posted: Fri May 31, 2024 8:18 am
by uhi22
5.6v is not state B. B is 9V.

Re: Foccci wakeup/sleep discussions

Posted: Fri May 31, 2024 8:20 am
by xvyDFatih
uhi22 wrote: Fri May 31, 2024 8:18 am 5.6v is not state B. B is 9V.
Sory. Focci in state b, charger cp voltage is 5.6v

Re: Foccci wakeup/sleep discussions

Posted: Fri May 31, 2024 8:24 am
by uhi22
This is the error. In state B the Foccci should have only 2k7 resistor, which leads to 9V nominally.

[Edit] On Foccci there is a LED for state C. You could try to switch this via the parameter ActuatorTest. This should lead to
- LED off, is state B, is 9V
- LED on, is state C, is 6V

[Edit 2] And check what the spotvalue AcObcState says. If it is "charging", the Foccci is expected to turn the State C on, and in the other cases it shall stay in State B.

Re: Foccci wakeup/sleep discussions

Posted: Fri May 31, 2024 9:33 am
by xvyDFatih
uhi22 wrote: Fri May 31, 2024 8:24 am This is the error. In state B the Foccci should have only 2k7 resistor, which leads to 9V nominally.

[Edit] On Foccci there is a LED for state C. You could try to switch this via the parameter ActuatorTest. This should lead to
- LED off, is state B, is 9V
- LED on, is state C, is 6V

[Edit 2] And check what the spotvalue AcObcState says. If it is "charging", the Foccci is expected to turn the State C on, and in the other cases it shall stay in State B.
I tried with 1k and power supply. As you said im measuring 8.76 volt on cp side. So we can say charger is not working properly.
Also i will look led for state c and obc state

Re: Foccci wakeup/sleep discussions

Posted: Sat Jun 01, 2024 3:40 pm
by xvyDFatih
xvyDFatih wrote: Fri May 31, 2024 9:33 am I tried with 1k and power supply. As you said im measuring 8.76 volt on cp side. So we can say charger is not working properly.
Also i will look led for state c and obc state
I went to charging station. When i connected focci board to ac station. Ac station cp voltage is ~8.65v. Focci is waking 3-5 seconds. Then it is not working continuesly.

I cant find any issue about where is it

Re: Foccci wakeup/sleep discussions

Posted: Sat Jun 01, 2024 6:41 pm
by johu
It goes back to sleep when it does not get a PWM on CP
You can send 12V to the wakeup input ti force it to stay on

Re: Foccci wakeup/sleep discussions

Posted: Sun Jun 16, 2024 8:56 am
by evMacGyver
Every time I plugged home AC charger to the car with Focci 4.5, I heard short contactor sound from the charging station. If Focci is already waken by button or before it goes back to sleep, charging station did not react.

Something to do with sleep, so I added pull-down resistor from STATE_C_CONTROL mosfet gate to ground and now Focci does not shortly activate CP.

Please, use resistors with mosfets, those are important while uC is waking. Second option is to use mosfets with internal gate resistor.

Re: Foccci wakeup/sleep discussions

Posted: Sun Jun 16, 2024 10:41 am
by johu
Does it run the latest or recent firmware? It instructs pull-down in boot loader.
Probably still a good idea to fit pull down resistors

Re: Foccci wakeup/sleep discussions

Posted: Sun Jun 16, 2024 2:13 pm
by evMacGyver
Latest firmware yes and for bootloader could I have used the same v5.2 stm32_loader.bin as for zombie, I think so?

Re: Foccci wakeup/sleep discussions

Posted: Sun Jun 16, 2024 2:30 pm
by uhi22
Confirmed the state C issue during wakeup. Which bootloader would fix this?
image.png