[Ovmsdev] Volt/Ampera

Mark Webb-Johnson mark at webb-johnson.net
Sun Dec 30 14:23:25 HKT 2012


Michael,

OK. This looks like an extension to standard OBDII over CAN. See:

http://en.wikipedia.org/wiki/OBD-II_PIDs#CAN_.2811-bit.29_Bus_format
http://mbed.org/cookbook/OBDII-Can-Bus

> send:  7E4      8 06 2C FE 43 69 43 68 00

OBDII extension:
06 is the number of bytes in the message
2C is a custom mode
FE 43 69 43 68 00 would normally be the OBDII PID code, but here we don't know as it is custom

> send: 7E4      8 03 AA 04 FE 00 00 00 00


Similarly, 03 is the length, AA 04 FE is the message.

> return: 7EC      8 02 6C FE AA AA AA AA AA


02 is the length, 6C FE is the message. The rest is garbage.

> return: 5EC      8 FE 4A 6F 00 00 00 00 00 [repeat 160 times]


I think this is just the raw message (not OBDII). It is completely different from an OBDII over CAN reply.

It is not unusual for the physical controller ID to be a fixed offset from the OBDII response ID. In standard OBDII over CAN, the offset is often 8. Here, we're seeing an offset of 0x0200.

> Idea:
> car is off. -> no data on can bus.
> car is off and charging -> can bus wakes every ~30 MInutes up. You can see in my Logs.
> When the can bus is awake (it gets valid SOC Data for example), the Module send the initialization sequence and then the demand sequence.
> It can send the demand sequence every 10seconds until the the can bus go sleep.
> When there are no valid values in 5EC (the rest is valid) (temperature is zero, we normally don't have -40°C), the module sends the initialization sequnece again.


I think this is a fine approach.

For your convenience, I've added a hook function vehicle_fn_ticker10() to the vehicle layer. You can hook into that to get a callback once every 10 seconds.

I suggest you wrap this logic around a "if (sys_features[FEATURE_CANWRITE])" so that you only do this if canwrite is on. Don't write to the can bus unless it has been opened in active mode (otherwise the system will loop waiting for the bus to be writable, then watchdog timeout as it never does).

Other than that, the charging / not-charging state can be maintained in the way you suggest. You should also be able to detect charging is stopped (charging -> not-charging) and check the SOC% to decide whether to alert or not. I think "twizy" Michael does something similar, so you may want to see how he does it and do it the same way.

The temperature is a nice bonus. I wonder what other fun stuff is hiding :-)

Regards, Mark.

On 30 Dec, 2012, at 12:50 AM, mikeljo at me.com wrote:

> Hi,
> 
> Johannes find some interesting stuff:
> 
> send:  7E4      8 06 2C FE 43 69 43 68 00
> return: 7EC      8 02 6C FE AA AA AA AA AA
> Set Configuration to get Voltage and Current
> 
> send: 7E4      8 03 AA 04 FE 00 00 00 00
> return: 5EC      8 FE 4A 6F 00 00 00 00 00 [repeat 160 times]
> 
> Byte 1 (4A) Current
> Byte 2 (6F) Voltage
> Calculation:
> I = Byte 1 * 0.2 in Ampere
> U = Byte 2 / 2 in Volt
> 
> And continue:
> 
> Sending this two sequenzes immediately 
> 7E4      8 10 08 2C FE 43 69 43 68
> 7E4      8 21 80 1F 00 00 00 00 00
> 
> gives with this:
> send:  7E4      8 03 AA 04 FE 00 00 00 00
> return: 5EC      8 FE 4A 6F 64 00 00 00 00  [repeat 160 times]
> 
> Byte 1 and 2 same as before, and in Byte 3 Temperature in °C
> T = (Byte 3 / 2 ) - 40
> This is the Temp. in raw. in Byte 4 could be Temp filtered. Still searching the Sequence for this.
> 
> 
> Strom: 0x4A * 0,2 = 14,8A
> Spannung: 0x6F * 2 = 222V
> Temperatur: (0x64 / 2) - 40 = 10°C
> 
> Current and Temperature are ok. I think the Voltage must have an Offset (8 or 9) too. Cause my Voltage is around 230V.
> 
> It seems that the config send only once (every x Minutes, or so) and the "give me data" ID (7E4 8 03 AA 04 FE 00 00 00 00) every time you want to get it.
> Then you get ~160 times the requested Values in ID 5EC.
> 
> Idea:
> car is off. -> no data on can bus.
> car is off and charging -> can bus wakes every ~30 MInutes up. You can see in my Logs.
> When the can bus is awake (it gets valid SOC Data for example), the Module send the initialization sequence and then the demand sequence.
> It can send the demand sequence every 10seconds until the the can bus go sleep.
> When there are no valid values in 5EC (the rest is valid) (temperature is zero, we normally don't have -40°C), the module sends the initialization sequnece again.
> 
> Bye
> Michael J.
> 
> 
> Am 28.12.2012 um 01:41 schrieb Mark Webb-Johnson <mark at webb-johnson.net>:
> 
>> 
>> Can he provide the logs from the moment the DashDAQ is connected? Perhaps 10 seconds without charging, then start the charge and continue to monitor for 1 minute.
>> 
>> It seems possible that this is enabled by turning on a monitoring mode, but unexpected. This sort of thing would normally just be transmitted as part of the normal message stream.
>> 
>> Regards, Mark
>> 
>> On 27 Dec, 2012, at 11:58 PM, mikeljo at me.com wrote:
>> 
>>> Am 27.12.2012 um 01:11 schrieb Mark Webb-Johnson <mark at webb-johnson.net>:
>>> 
>>>> Now, on to the other messages (I spoke about yesterday in the other thread). I'll try to drum up some interest in the forums to see if anyone can help with the decodes. It would be good if you could do the same.
>>> 
>>> And here some first results from tachy:
>>> 
>>> CANUSB mit DashDAQ kombiniert bringts! Ich habe soeben den Code für das Ladegerät (Ladestrom/Ladespannung) rausbekommen:
>>> 
>>> 5EC Byte 3 Ladestrom Einheit 0.2 A (Bsp: 14.2 A = 47h)
>>> 5EC Byte 4 Ladespannung Einheit 2 V (Bsp: 222V = 6Fh)
>>> 
>>> 
>>> He works with a DashDAQ and a CANUSB, both connected with a ODB2 Y-Cable.
>>> So he find the Charging Current und Charging Voltage:
>>> 5EC Byte 3 Charge Current Unit 0.2 A (Example: 14.2 A = 47h)
>>> 5EC Byte 4 Charge Voltage Unit 2 V (Example: 222V = 6Fh)
>>> 
>>> Fast enough?
>>> 
>>> BUT!!! This IDs doesn't exist in my Logs. i Think the DasDaq send a Command to get this ID.
>>> 
>>> 
>>> Bye
>>> michael
>>> _______________________________________________
>>> OvmsDev mailing list
>>> OvmsDev at lists.teslaclub.hk
>>> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
>> 
>> _______________________________________________
>> OvmsDev mailing list
>> OvmsDev at lists.teslaclub.hk
>> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
> 
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20121230/dcf80002/attachment.htm>


More information about the OvmsDev mailing list