CCS32Clara

From openinverter.org wiki
Jump to navigation Jump to search

Disclaimer: This Page is still work in progress! Any information written here is a draft only and should be handled as such. Contributions are more than welcome. If you have questions, please ask them in the discussion section of the page or in the OpenInverter Forum.

This page is about the reference software for the Fully OpenSource CCS Charge Controller (Foccci). CCS32Clara (also referred to as "Clara") is currently under development by the OpenInverter Community.

Here you will find documentation (or reference) on how to setup Clara, News on the development, diagrams, open ToDos, etc.

Clara on GitHub.

Clara in the OpenInverterForum.

Configuring Clara via CAN

Clara exposes only one single CAN interface for vehicle communication and initial configuration. So we need a CAN counterpart to talk to it.

There are two main approaches to this: a) use a command line tool [1] or b) use an ESP based CAN module [2]

Both ways require knowing Claras so called Node Id (similar to an IP address on a local network). By default this is 22. You can enter this node id on the bottom left navigation bar.

Parameters

Name Unit Min Max Default Description
Hardware Config
UdcDivider dig/V 0 100 10 Division factor from ADC digits to V of external voltage measurement board
EconomizerDuty % 0 100 100 Contactor economizer duty cycle. Contactors are always turned on with 12V for 1s then drop to this value. Set to 100% if your contactor has a built-in economizer
InletVtgSrc 0 2 0 0 - Charger output voltage is considered equal to charge port inlet voltage

1 - Analog input is used for measuring charge port inlet voltage

2 - Charge port inlet voltage is provided via CAN - don't forget to map something to InletVoltage

LockDuty % -100 100 30 H-bridge duty cycle for operating the lock. Use negative value if lock polarity is swapped
LockRunTime ms 0 10000 1000 Timeout for lock operation
LockClosedThresh dig 0 4095 0 Lock feedback value for closed
LockOpenThresh dig 0 4095 0 Lock feedback value for open - if equal to lockclosethr no feedback is assumed and lock is operated timed
ppvariant 0 9 0 Various circuit variations exist for PP resistor measurement. "1" is correct for the latest hardware
WakeupPinFunc 0 4 0 Configure what the wakeup pin does. TODO: describe below
Communication
NodeId 1 63 22 CANOpen node id for SDO requests
CanSpeed 0 4 2 Baud rate of CAN interface 0=125k, 1=250k, 2=500k, 3=800k, 4=1M - when configuring this != 500k you will loose communication to the ESP web interface!
Charge Parameters
MaxPower kW 0 1000 100 Absolute maximum charge power
MaxVoltage V 0 1000 410 Over voltage threshold. Always set about 10-20V higher then desired battery full voltage
MaxCurrent A 0 500 125 Absolute maximum charge current
TargetVoltage V 0 1000 0 Charge target voltage (volatile)
ChargeCurrent A 0 500 0 Instantaneous current setpoint (volatile)
soc % 0 100 0 Battery SoC for display on charger (volatile)
BatteryVoltage V 0 1000 0 Present battery voltage for precharge state (volatile)
enable 0 1 1 When 0 charging is stopped/not started (volatile)
AcObcState 0 15 0 Feedback from OBC
Testing
DemoVoltage V 0 500 0 Voltage for light bulb demo. To use the board without CAN, to get an constant voltage. Is ignored as long democtrl is not STANDALONE. Only values between 150V and 250V are accepted, others are treated as zero.
DemoControl 0 511 0 Enables the standalone demo mode if value is set to STANDALONE. In this mode, no CAN is required and the target voltages for precharge and charging loop are taken from demovtg.
ActuatorTest 0 7 0 Tests various outputs
logging 0 2047 Selects which modules log to the serial console

Spot values

Name Unit Description
opmode State of the CCS state machine
version
lasterr Last detected error
EvseVoltage V Outlet voltage reported by EVSE
EvseCurrent A Outlet current reported by EVSE
InletVoltage V Charge port voltage
EvseMaxCurrent A Maximum current the EVSE can deliver
EvseMaxVoltage V Maximum voltage the EVSE can deliver
ControlPilotDuty % The PWM ratio of the CP line. This is normally 5% for DC chargers, and between 10% and 90% for analog AC chargers.

Typical values are explained here: IEC 62196 Typ 2 – Wikipedia

temp1, 2, 3 °C Temperatures of the temperature sensors. Requires correct calibration values depending on the used NTC types.
MaxTemp °C Maximum of the above
ContactorDuty % Duty cycle of charge port contactor driver
AdcLockFeedback digit Feedback value from charge port lock
AdcProximityPilot digit Analog value of the PP line. This is the raw value of the analog-to-digital-converter in range 0 to 4095.
ResistanceProximityPilot ohm Measured resistance between PP line and ground. Requires correct setting of the parameter ppvariant.
CableCurrentLimit A Based on the PP resistance. The current limit of the charging cable for AC charging.
EvseCurrentLimit A Based on the CP PWM. The current limit of the charging station for AC charging.
AdcHwVariant digit raw AD value of the hardware variant coding input. Used to detect which variant of Foccci the software runs on.
AdcIpropi digit raw AD value of the current sensor for the charge port lock motor driver.
LockState State of charge port lock
StopReason
checkpoint
CanWatchdog 100 ms Time since last ChargeCurrent update. When it reaches 30 (3s) the charge session is stopped
cpuload

Errors

The spot value "lasterr" displays the last detected error that lead to a cancellation of charging or to not starting in the first place

Error Description
CANTIMEOUT The message mapped to canwatchdog hasn't been received for over 1s or nothing is mapped to canwatchdog
PLCTIMEOUT PLC communication with charger timed out
PRECTIMEOUT Precharging the EVSE output to specified voltage timed out or battery voltage is below minimum EVSE output voltage
LOCKTIMEOUT The connector lock didn't reach the desired position in time
EVSEFAULT The EVSE reported an error and stopped
RELAYWELDED A welded charge port relay was detected

Making Clara talk CHAdeMO on the CAN side

A pretty straightforward way to integrate CCS charging into your vehicle is to use the existing CHAdeMO (let's call it CDM from here on) CAN messaging. CDM has pretty much all data items we need to initiate a CCS charging session, so rather than defining a new set of messages we might as well adopt it. For example, Orion BMS or Zombieverter VCU natively support CHAdeMO anyway.

Screenshot of CAN mapping to interface Clara CCS with CHAdeMO

Let's go over the items in the screenshot one by one. Note that the IDs are decimal! (256=0x100, 258=0x102, 264=0x108, 265=0x109)

  • UdcDivider - Actually, here we just select some dummy item as the important bit is in the Offset field: the version. In this case I signal non-existent CDM version 10. This tells the CDM module in my car that it talks to Clara. It then includes the battery voltage in some unused message bytes - see below.
  • EvseVoltage - Transmits the charger's present output voltage back to the vehicle.
  • EvseCurrent - Transmits the charger's present output current back to the vehicle.
  • opmode - Observe the weird gain - this is forged to map Clara state "CurrentDemand (13)" to CDM state "ConnectorLocked (4)". In my car's CDM module this is sufficient to initiate the charging progress. You may need to change it so that the ChargeEnable flag together with ConnectorLocked is forged (numerical value 5).
  • EvseMaxVoltage - Transmits the EVSE's maximum output voltage back to the vehicle.
  • EvseMaxCurrent - Transmits the EVSE's maximum output current back to the vehicle.
  • BatteryVoltage - Transmits the present battery voltage to the EVSE. This is the special item that normally doesn't exist in CDM and that unfortunately will prevent you from using this solution with an OEM car in a safe manner. Of course, you could manually set this to some medium battery voltage like 360V, but if you arrive with a really low battery at, say, 300V this might weld your charge port contactors. You could also manually enter the battery voltage before each charging session.
  • TargetVoltage - Transmits the charge end voltage to the EVSE.
  • ChargeCurrent - By far the most important data item: the charge current request.
  • soc - In CDM this isn't normally a percentage value but some encoded kWh value. In my car's CDM module I specify a full battery as "200" (no idea what this actually means in kWh) and thereby can just output the SoC in 0.5% steps.
  • enable - The car's charge enable flag. When 0 will stop the CCS session.

As an additional safety measure you could connect CDM pin 4 (charge enable) to Clara's button input (at least once we added an active low mode for it). It might also be worthwhile to connect pin 7 (connection check) to the PP input for drive away protection when CDM is plugged in but not charging (again, once we have actually implemented this).

Let's list the CHAdeMO pin mapping one by one as well:

  • Pin 1 - GND
  • Pin 2 (12V, charger start/stop) - 12V (I take it from cigarette lighter)
  • Pin 4 (charging enable) - Foccci BUTTON
  • Pin 5, 6 - Power pins, triple check correct polarity!
  • Pin 7 (Connection check) - Foccci PP
  • Pin 8, 9 (CAN) - Foccci CANL, CANH
  • Pin 10 (charger start/stop 2) - Foccci SW1_LS

Attention: with this mapping the error flags are ignored, e.g. voltage or current mismatch.