DIY Electric Car Forums banner

1 - 20 of 99 Posts

·
Registered
Joined
·
389 Posts
Discussion Starter #1
I have an eltek charger and i have connected it to a Bluetooth ODB 2 scanner
via the can interface.

I have got it to connect to the module using hyper terminal in windows at least i think it has. It gives numbers when the charger is connected to the mains and i issue the ATMA command....

This is the first time i have done any work with can and i am a bit stumped. :confused:

I dont know how to send a message to the charger to enable it. I have attached a load and want to see if i can power it up and control voltage and current.

I have the protocol http://www.evolveelectrics.com/PDF/Eltek/Eltek CANbus Protocol.pdf

I just need some guidance, can anyone help me?
 

·
Registered
Joined
·
389 Posts
Discussion Starter #5
its a Vgate OBD scan, its a little blue box. I was actually planning on getting an usb to can.

I have no idea whether it will work either but it was a freebie so i thought i would give it ago.

I dont know how to convert to hex and how to format correctly with msb and lsb

would i type 02ff or 0x2ff?

then 0 or 1 to enable

how do i work out the next values?

the next two bytes are charger power reference in % divided by 10 so if i wanted 10% the next number i would put in would be 01?
 

·
Registered
Joined
·
220 Posts
If you have basic knowledge (or want to get it) on microcontrollers and programming then any arduino clone + CAN board (~$25 for both) will control your charger. I'm very poor at programming but had first communication after 2 hrs...
 

·
Registered
Joined
·
14 Posts
I have an eltek charger and i have connected it to a Bluetooth ODB 2 scanner
via the can interface.

I have got it to connect to the module using hyper terminal in windows at least i think it has. It gives numbers when the charger is connected to the mains and i issue the ATMA command....

This is the first time i have done any work with can and i am a bit stumped. :confused:

I dont know how to send a message to the charger to enable it. I have attached a load and want to see if i can power it up and control voltage and current.

I have the protocol http://www.evolveelectrics.com/PDF/Eltek/Eltek CANbus Protocol.pdf

I just need some guidance, can anyone help me?
Hi,

So i suppose you use an elm327.

For an elm327 you need to
-at least define the can speed: AT SP6 (speed 500 kb/s, header 11bits)
-monitor the bus: AT MA
-before sending commands, define the header AT SH 00 03 00. I suppose you don't know the charger number, so 0x300 is a broadcast header
-then you can send commands to the charger in order to control voltage/power/enable. 8 bytes need to be send, according eltek power charger doc. These 8 bytes are send in hexa
After sending, usually elm327 stop receiving. So you have to send AT MA after each sending.

(I have not tested all I have write above...Don't have a power charger and don't like elm327. But this could be ok :D)

Eltek Doc:
2.1 Charger control
The EV Powercharger is controlled by the charger control message. The charger control message instructs the charger to turn on/off, deliver a specified amount of
power and not exceed the provided DC voltage and current limit.
Once an EV Powercharger receives a charger control message it starts transmitting its status messages. If the charger suddenly stops receiving charger control messages
from the control system it considers itself logged off . When logged off the charger stops sending status messages and turns off (CHARGER_ENABLE = 0). The charger
communication timeout is 1 second after the last received charger control message.
CAN identifier: Broadcast: Base CAN identifier
Individual charger control: 1 + base CAN identifier + (charger address – 1) * 16 (individual charger control)
Length: 7 bytes
Reception interval: 1000 ms (used for communication timeout)
Sender: Control system
Receiver: Charger
Bit 7 (MSB) Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 (LSB)
Byte 7 RESERVED
Byte 6 CHARGER_MAXDCCURRLIMIT_MSB
Byte 5 CHARGER_MAXDCCURRLIMIT_LSB
Byte 4 CHARGER_MAXDCVOLTLIMIT_MSB
Byte 3 CHARGER_MAXDCVOLTLIMIT_LSB
Byte 2 CHARGER_POWER_REFERENCE_MSB
Byte 1 CHARGER_POWER_REFERENCE_LSB
Byte 0 CHARGER_ENABLE
Table 1 Charger control message
Signal Description Min Max Data conversion
CHARGER_ENABLE Turns the charger on or off (PFC and DC/DC on/off) 0 1 Physical = (HEX)
CHARGER_POWER_REFERENCE Power reference demand in percent of maximum power 0.0% 100.0% Physical = (HEX / 10) [%]
 

·
Registered
Joined
·
389 Posts
Discussion Starter #8
Hello all

Yes Tomdb you are right it would be much easier with a CAN to USB, I have on order a module similar to what you linked, its good advice.

z_power this is also a good idea, i do need to learn programming, but i cant help feel like i would be better off getting someone to do it for me, if im going to use the charger i think it would be best to use it with a simple microprocessor rather than windows, can i ask how you have programmed the charger to deactivate when full?

Planitare

The ATI command gives LM327 ver 1.4 or something similar

I set the can speed to 500kbs and 11bits through the ATSP command

the ATMA command gives a chain of numbers starting in 350 which i assume is the broadcast header you speak of.

I think i am actually communicating with the charger, its just what i am entering is gibberish as i don't know the correct syntax and i dont understand MSB and LSB, if i put in stuff starting with 02ff there is communication betwen the module and the charger, i presume its sending an error message saying the data entered is not valid.

What i really need is an example.

the charger is controlled by "ox2ff" would i enter 02ff, 02 ff or 02xff?

the next part is just a zero or a 1 to enable or disable the charger.

say if i wanted a max voltage of 250V and a current of 1 amp what would i write next?

The datasheet says its HEX/10 does that mean i divide the voltage i want by 10 and convert to hex or times the voltage by 10 and convert to hex?

do i need spaces between each of the bytes?

Thankyou all for your suggestions and help :D its much appreciated.
 

·
Registered
Joined
·
14 Posts
Can you give the data the charger send 03 50 ...... ?

When using a can bus you have to send two groups of numbers:
-header (11 bits for the Eltek powercharge)
-data 1 to 8 bytes

11 bits is completed up to 12 with a zero and then send in hexa: xyz (3 numbers/letters). For exemple 2FF for broadcast (or 300 for the charger number 1). Don't send a "x" like 0x2FF. Just send 3 hexa, each for 4 bits. (It was wrong in my previous message)

With some dongle (for exemple canusb) the header and the data are send in one command line
With elm327 I think you have to send first the header with the command AT SH xyz (xyz=3 numbers/letters for the header). Exemple AT SH 2FF
Then send the data in an other line in hexa.

I think the line is 01 E8 03 VV VV CC CC 00
-01 for enable
- E8 03 for the max power range 0 to 1000 decimal, 1000=100%, so 0000 to 03E8 in hexa but you have to reverse 03 and E8
- max current same coding as power. For 1 amp send 10 decimal so 00 0A hex then remplace CC CC by 0A 00
- max voltage same coding as power. I suppose that for 250v send 2500 decimal so 09C4 then remplace VV VV by C4 09
- I am not sure you need to send the last 00.

So the command could be 01 E8 03 C4 09 0A 00 00 or 01 E8 03 C4 09 0A 00

After sending the data send AT MA and you will receive three responses: Status1 Status2 and Error. Hope these 3 messages will not be lost betwen you send the 7-8 bytes data and the following AT MA.

I can not test all this so, I am absolutly not 100% sure.

You have to send more then at least once a second the data 7-8 bytes. If not the charge is stopped.
I think you don't need to repeat the AT SH command. I believe it is stored in the elm327 and automaticaly send.
 

·
Registered
Joined
·
14 Posts
hi, Big mother whale

I found this on Elithion:
Code:
Transmit to charger anchor
ID     Bytes    Byte 0          Byte 1 Byte 2   Byte 3 Byte 4   Byte 5 Byte 6
2FFh	7	Enable (1)	Max power (2)	Max voltage (3)	Max current (4)

Notes:
Period: 100 ms
Control flags. Only 1 bit is used, all others are 0:
Bit 0: 1 to enable charging; 0 to disable charging
Maximum power [0.1 %] little-endian
Fixed at 100 %
Maximum DC output voltage [100 mV] little-endian
Set to the pack voltage when all the cells are full and balanced (Max cell voltage x number of cells in series)
Maximum DC output current [100 mA] little-endian
Set at the Charge Current Limit

Receive from charger anchor
The BMS controller looks for battery current information on the CAN bus from a single charger. 
(If multiple chargers are used, and they use different CAN IDs, the BMS can only read current from only one charger.)


ID	Bytes	Byte 0	Byte 1	Byte 2	Byte 3	Byte 4	Byte 5	Byte 6	Byte 7
305h	8		Current (1)	

Notes:

[100 mA], + = into battery, little-endian.
So I think my previous post is ok.:) Forget the 7 after the 2FFh because this is the length of the data (Enable, Power, Voltage, Amperage). Elm327 send it automaticaly. So I think the data is 7 bytes, not 8 so you have to send 01 E8 03 C4 09 0A 00

:)
 

·
Registered
Joined
·
389 Posts
Discussion Starter #12
I have tried what you suggested and i cant get it to work, everything seems to check out and i think what you have worked out is correct, I have a can to usb on order im sure it will work with what you suggest with that.

thank you for your help you have been most kind.

I will let you know when the can to usb arrives and tell you how i get on with it.
 

·
Registered
Joined
·
220 Posts
This is strange, planetaire's instructions seem OK and should do the job.

I'd start with listening to te bus - powered charger sends periodic (~1 sec.) message with its serial number and base CAN ID. Even without your own activity you should read this msg from the bus. If your device doesn't read valid messages try changing bus speed setting, your charger might have had it altered in the past from standard 500 kbps to one of the others possible.

Do you have oscilloscope? It IS very hepful :) First part of this publication: http://www.keil.com/download/files/canprimer_v2.pdf is a good tutorial on CAN basics and gives some good debugging hints.
 

·
Registered
Joined
·
389 Posts
Discussion Starter #14
The ATMA command gives the serial number without a problem.

350 10 10 71 12 58 09
the first bit is the address? the second part is written on the outside of the charger.

i seem to have one way communication at least.

i do have a scope yes i could use it to check if anything is being sent from the module.

I hope im inputting the right commands, it could be user error.
 

·
Registered
Joined
·
14 Posts
May be it is because you don't repeat the 7 bytes. On elithion they say each 100mS.
I have a eltek flatpack and it need several second to jump to the amperage/voltage that I send.
 

·
Registered
Joined
·
389 Posts
Discussion Starter #16
May be it is because you don't repeat the 7 bytes. On elithion they say each 100mS.
I have a eltek flatpack and it need several second to jump to the amperage/voltage that I send.

Yes this could be it. i had a look to find if there was any way to repeat the command after a time interval but i found nothing.

this is what im inputting in hyperterminal once i have connection:

AT SH 2FF folowed by enter

i get an OK

01 E8 03 C4 09 0A 00 enter

is this correct?

it seems to either say "no data" or it repeats the serial number.
 

·
Registered
Joined
·
14 Posts
In my opinion what you send is ok. Just repeat severall times per second the
01 E8 03 C4 09 0A 00 enter

But what you receive is strange for me:

...350 10 10 71 12 58 09
the first bit is the address? the second part is written on the outside of the charger....
How can you get 350 ? According eltek powercharge doc this would be 308 318 ...3E8...3F8.
And you would receive 8 bytes not 6.

Is 10 10 71 12 58 09 the serial number of you device ?
 

·
Registered
Joined
·
389 Posts
Discussion Starter #18
yes its the serial number and its written on the outside of the charger.

as for the 350 i have no idea.

i would say the reader is giving me bad data but the serial is exact.
 

·
Registered
Joined
·
389 Posts
Discussion Starter #19
I have now got a USB to can bus module like the one suggested.

It reads from the charger, and gives the same as the Bluetooth module. with 350 and the charger serial number for the data

I have tried entering 2ff in the ID and 01 E8 03 C4 09 0A 00 in the data and
repeating it on a cycle every second, i am still getting nothing from the charger,

I have a meter connected to it to measure its output

i can post some screenshots of how i have set it up, im not sure what i am doing wrong :confused:
 

·
Registered
Joined
·
220 Posts
It reads from the charger, and gives the same as the Bluetooth module. with 350 and the charger serial number for the data
What is the identifier value of received message? This 350 value, is it hex or decimal? It could be programmed base CAN ID, so you can try sending 350 instead of 2FF and then 01 E8 03 C4 09 0A 00.
 
1 - 20 of 99 Posts
Top