Jumping Jack Flash weblog

Diario elettrico Ecojumbo 5000 – 17/11/2015: finalmente la connessione PC-centralina funziona

Posted in Diario elettrico Ecojumbo 5000, scooter elettrici, Uncategorized by jumpjack on 22 novembre 2015

Dopo aver provato 4 computer diversi, di cui uno sotto Windows 8 e sotto XP, un’altro con solo XP e 2 con Windows 7, e dopo aver provato quattro programmi diversi di “serial port sniffing”, dopo aver provato sia con convertitori USB-serial che con porte seriali vere, montate su PC che avevo in naftalina….
all’improvviso è comparsa la tanto agognata schermata del programma della Kelly!! 🙂

Prima di lanciarlo, avevo avviato uno dei vari programmi di monitoraggio delle porte seriali che ho installato: si chiama “Free Device Monitoring Studio”, che ha alcune funzioni free e alcune che durano solo 21 giorni.
Non so se quella che sto usando per il monitoraggio (“request view”) è free o in prova…. ma fin tanto che funziona, ne approfitto per loggare cosa dice il PC alla centralina:

000001: PnP Event (DOWN), 17.11.2015 18:48:50.957 (1. Device: Porta di comunicazione (COM1))
The device has just been connected to the system.
000002: Create Request (DOWN), 17.11.2015 18:49:00.773 +9.815 (1. Device: Porta di comunicazione (COM1))
Process 0xc74 (Kelly Controller.exe) attempted to open the device
000003: Create Request (UP), 17.11.2015 18:49:00.788 +0.015 (1. Device: Porta di comunicazione (COM1))
Process 0xc74 (Kelly Controller.exe) create request status: 0x00000000
000004: I/O Request (DOWN), 17.11.2015 18:49:00.788 +0.0 (1. Device: Porta di comunicazione (COM1))
IOCTL_SERIAL_SET_QUEUE_SIZE: Set queue size
InSize=512
OutSize=512
000007: I/O Request (UP), 17.11.2015 18:49:00.788 +0.0 (1. Device: Porta di comunicazione (COM1))
IOCTL_SERIAL_GET_BAUD_RATE: Retrieve Baud Rate
Baud Rate=1200

000009: I/O Request (UP), 17.11.2015 18:49:00.788 +0.0 (1. Device: Porta di comunicazione (COM1))
IOCTL_SERIAL_GET_LINE_CONTROL: Retrieve line control
WordLength=7
StopBits=1 stop bit
Parity=No parity

[…]

000022: I/O Request (DOWN), 17.11.2015 18:49:00.788 +0.0 (1. Device: Porta di comunicazione (COM1))
IOCTL_SERIAL_SET_BAUD_RATE: Set baud rate
Baud Rate=19200

000024: I/O Request (DOWN), 17.11.2015 18:49:00.788 +0.0 (1. Device: Porta di comunicazione (COM1))
IOCTL_SERIAL_SET_RTS: Set RTS

000026: I/O Request (DOWN), 17.11.2015 18:49:00.788 +0.0 (1. Device: Porta di comunicazione (COM1))
IOCTL_SERIAL_SET_DTR: Set DTR

000028: I/O Request (DOWN), 17.11.2015 18:49:00.788 +0.0 (1. Device: Porta di comunicazione (COM1))
IOCTL_SERIAL_SET_LINE_CONTROL: Set line control
WordLength=8
StopBits=1 stop bit
Parity=No parity

Quindi alla connessione il programma tenta un “primo aproccio” con parametri “1200,7,n,1”, poi successivamente passa a “19200,8,n,1”.

Quanto al programma, all’avvio ha questi valori:
Throttle effective starting: 20%
Throttle effective ending: 80%
Max motor current: 100%
Max battery current: 50%

La centralina ha anche una funzione di “amplificatore di corrente”, o “DC/DC converter boost”, cioè può erogare piĂą corrente di quanta ne preleva dalla batteria, “convertendo” la tensione in corrente (in parole povere…).
Le correnti per cui è certificata la mia KEB-72801X sono 140A continui (60Vx140=8.4kW) e 350A di picco (60Vx350=21kW). Per mantenere una velocità costante di 90 km/h con uno scooter servono circa 90A continui, e 90/140=0.64, quindi dovrei impostare la corrente del motore su 65%.

Ho due batterie in parallelo da 60V/18Ah, quindi 36Ah; in teoria non dovrei tirarne fuori piĂą di 40A continui (28%,1.1C) per non rovinarle, però 40Ax60V fa solo 2.4 kW; anche considerando la tensione reale di 66V si arriva al massimo a 2.6 kW, quindi direi che sto piuttosto sovraffaticando le batterie. Dovrei comprarne un’altra, ma costa 800 euro… Preferirei aspettare di fare qualche migliaio di km per ammortizzare le due giĂ  acquistate…
Però con questa centralina ora posso decidere io quanta corrente massima tirare fuori dalle batterie. Solo che una corrente bassa corrisponde, oltre a una velocità massima inferiore, anche una accelerazione inferiore, quindi complessivamente prestazioni inferiori.

Immagino che dovrò giocherellare parecchio con questi parametri per trovare il giusto mezzo tra prestazioni e preservazione delle batteie.

Spero solo che la congiunzione astrale che ha permesso al programma della Kelly di avviarsi sia ripetibile in futuro!

Riassumo la mia configurazione:
Windows 7
Niente antivirus
Programma installato in C:
Porta seriale reale (COM1)
Centralina alimentata a 19V tramite i pin del connettore di segnale (PWR e GND) (i limiti di funzionamento sono 18-72V).
Monitoraggio seriale tramite HDD Device Monitoring Studio ( Binary File, Serial Port, USB, Network Developer Software for Windows)

Diario elettrico Ecojumbo 5000 – 13-11-2015: risposte della Kelly a domande sulla centralina

Posted in Diario elettrico Ecojumbo 5000, scooter elettrici, Uncategorized by jumpjack on 22 novembre 2015

Non riesco a collegare la centralina al PC,nè tramitemcavo USB-seriale nè trite connessione seriale diretta. Ho chiesto chiarimenti alla Kelly, ecco le risposte e i miei commenti:

Please let us know SN of this controller. -> ok ora glielo mando
What is the pop-up window when the controller can not be connected to user program? –> gli manderò uno screenshot
NO.If you just want to program the controller,you just need to apply 24V for J2 pin1 and B-. –> e questo era chiaro da vari forum
The COM port is set in the computer.It is nothing to do with the user program.You may set it in the device manager of the computer. –> sì come no… Non hanno nemmeno capito di cosa parlo…
No,we don’t have the diagnostic program to be disclosed for customers. –> quindi c’è ma non me lo possono dare..
Sorry,the RS232 port is still based on setting the existing parameters in the user program.It can not accept the executive commands. –> niente comandi manuali, solo da programma
NO.The KEB doesn’t need Kelly SCI converter to support at all. –> ok, confermato, non servono ulteriori adattatori

Yes,a few tips to note.
1.You need download the latest user program from our website. –> e chissĂ  da dove l’ho preso invece?!?
Manual & Software – Kelly Controls, LLC
2.You need to download USB driver for the USB port in your computer. –> questo è un grosso problema: Windows 8 autoinstalla il driver appena lo disinstallo , e quelli ufficiali Prolific sono fatti apposta per NON funzionare con cavi non originali.
3.Please don’t install the user program in C disk.Or you can not install the program in the driver where the antivirus software was installed.Please close all the antivirus software before operating the user program. –> Cioè il loro programma va in conflitto con l’antivirus se lo installo nello stesso hard disk dove è installato l’antivirus?!? Cmq non avevo provato a spegnere l’antivirus, vediamo se serve. Non mi piace avere sul PC indifeso un programma cinese dichiaratamente “incompatibile” con l’antivirus… forse sarĂ  meglio anche staccare internet…
4.You may not try to connect the controller to the computer while the motor is running. –> si sapeva
5.The power supply can not be turned off during the communication. –> vabbè
6,Please note only KDS/KDHD needs Kelly SCI converter to support.Kelly SCI converter is useless for other controllers from Kelly. –>quindi è confermato
The baud rate is 19200 —> FINALMENTE UN’INFORMAZIONE UTILE!!!
7,It is better to use Win XP or 2000 for the user program.Win7 or 8 may not be compatible with the GUI. –> pessima notizia…. e se non avevo un PC vecchio??!?
8.You need reset the power supply after finish the settings –> magari arrivarci, fin qui!.

In altra mail scrivono anche che sulle centraline KEB il led verde rimane spento finchè quello rosso continua a lampeggiare

Appunti su OpenLog (e ArduLog)

Posted in Programmazione by jumpjack on 29 marzo 2013

Tempo fa ho acqustato un Openlog della Sparkfun, un logger seriale arduino-based.

Non sono mai riuscito a farlo funzionare, però nel frattempo tanta gente ci si è rotta la testa trovando un sacco di problemi, e risolvendoli alcuni; le soluzioni sono sparse nellalunghissima pagina dell’openlog, provo a riassumerle qui sotto; nel frattempo, ho ordinato invece un ARDUlog, che essendo un successore sembra un po’ migliore: ha dei fori per avvitarlo a un supporto, e ha vari pin analogici di ingresso, quindi è predisposto a livello hardware per diventare un logger standalone, anche se ancora non esiste un firmware adatto.

 

Openlog:

Ardulog 1.0:

 

 

Ardulog 2.0 (notare l’inversione di TX e RX per coincidere con la board FTDI):

PROBLEMA 1 – Condensatori di disaccoppiamento sull’alimentazione:

Member #124829 | about 3 months ago 1

I am using the open log to log weather and cosmic ray data once a minute. I have an Atmega 328 connected on the bread board to the open log for data logging, and to a FTDI header for programming. The open log log’s data fine when I have the FTDI adaptor (DEV-09716) attached, but doesn’t log anything when It isn’t attached. I assume I have a hardware failure, and I forgot to connect something to the open log that the FTDI is connecting for me, but I checked and the TX and RX pins are connected properly, and so are GND and VCC. Right now my only guess is that the FTDI is putting more capacitance on the power supply that causes it to start working, but I haven’t tested it yet. However when I measured the voltage W/ the FTDI adaptor both the TX and RX lines sat at 4.7 to 4.9V and W/O it was 3.3 for both of them. Can I please get some help?

I fixed the problem, there wasn’t enough capacitance and the bypass caps on the FTDI were making the open log work. Make sure you have bypass caps on your power supply, I added a 10uf about 10cm of wire away and a 0.1uf right on the header of the open log and it started working perfectly.

PROBLEMA 2 – Livelli a 5V o 3,3 V?

tsm | about a month ago * 1

I’m getting a stream of 1s back from the data logger over serial.

I’m using a 5V Arduino, powering the OpenLog off of its 5V pin, and sending serial over to it and getting serial back. When the TX from the Arduino is not connected to the RX on the OpenLog, the OpenLog reports “12<”. However, when I connect the Arduino’s TX pin to the OpenLog’s RXI pin, I only getting “11111111….”

While the datasheet says that the RXI pin can take up to 6V, I notice that the schematic shows regulation of VCC down to 3.3V, while the RXI pin undergoes no translation and is connected directly to the ATMEGA. This makes me think that in fact a 5V TTL signal from the Arduino is too high and is causing the ATMEGA to result. Just a guess though.

Has anyone else seen this? The closest thing I found was unanswered (https://github.com/sparkfun/OpenLog/issues/138).

For reference, everything works correctly when I use a 3.3V FTDI.

I just soldered up a TTL logic level shifter (the Sparkfun one), taking my 5V TTL on the Arduino side down to 3.3V on the OpenLog side, and now it’s working. It looks like the 5V serial signal in fact is unacceptable to the ATMEGA, despite that the datasheet suggests it can accept 6V. Big debugging nightmare! Does anyone k

PROBLEMA 3 – Malfunzionamento a batterie

This is working when using USB power, but not battery power. Setup:

5V Arduino’s TX –> logic level shifter –> OpenLog’s RX

OpenLog’s TX –> resistor –> Arduino RX

Arduino’s reset pin –> logic level shifter –> OpenLog’s reset pin

tsm | about 2 weeks ago 1

I had a high-current device on the same bus. Interestingly, a separate mistake was drawing the 3.3V bus to 5V, but when the high-current device was on the line, it was pulling too much current and bringing the bus back down closer to 3.3V. When I used the battery, which delivered more current, this didn’t happen, and so the OpenLog would reset. Nasty problem. Fixed with a separate bus for that current-hungry component.

PROBLEMA 4 – flashing firmware con AVRDUDE:

gek | about 3 years ago 1

I’m using a FTDI 3.3v (DEV-09717) cable connected to my OpenLog. Using teraterm on COM10 I can make a connection to the device. all is good.
to upgrade the firmware I’m using the follow cmd:
avrdude.exe -p atmega328p -P COM10 -c stk500v1 -b 57600 -Cavrdude.conf -U flash:w:main.hex
and get this response:
avrdude.exe: ser_open(): can’t open device “COM10”: The system cannot find the file specified.
I have put libusb0.dll in the system32 directory.
is the problem that arvdude can’t handle high number com ports?
thank you
gek

I did a little hacking with regedt32 and changed the comport from 10 to 3. I can now update the firmware.
see:
http://www.ftdichip.com/Documents/AppNotes/AN_132_Re-Assigning_COM_Port_Numbers_Using_Registry.pdf
The registry remembers all FTDI converters that have been used. The driver does not reassign unused comport numbers. In some cases that a good thing. It would be nice to be able to “reserve” a set of comport numbers to be reused as devices are used and removed.

PROBLEMA 5 – flashing firmware

kzwinn | about 2 years ago 1

Hi,
Anyone encountered this problem while flashing the firmware? Thanks!

C:\openlog>avrdude.exe -p atmega328p -P COM6 -c stk500v1 -b 57600 -Cavrdude.conf
-U flash:w:main.hex
avrdude.exe: stk500_getsync(): not in sync: resp=0x00
avrdude.exe: stk500_disable(): protocol error, expect=0x14, resp=0x51

  • ok..solved. you need to connect all pins of FTDI Basic board and openLog. Not just TX/RX/5V/GND won’t be able to download.
    https://github.com/nseidle/OpenLog/wiki/Datasheet
    Under this topic
    How do I attach a FTDI Basic board to OpenLog for configuring and bootloading?

    PROBLEMA 6 – output 1, no prompt, no logging

    Lubin | about a year ago * 1

    Hello,

    I get an OpenLog with firmware v1.51 as I remmeber. I have a standard FTDI cable.

    I downloaded newer firmware through the git repository. I can upgrade sucessfully to any firmware version. I Only have Rx-Tx wires with Vcc-GND. I power up openlog whild pressing enter with: avrdude -p atmega328p -P COM2 -c stk500v1 -b 57600 -Cavrdude.conf -U flash:w:main.hex

    It’s programming without error. However, open log is only showint one 1 at hyperterm when starting. I do not have anymore 12>.

    What’s going on ? any ideas ?

    • Find out : the computer corrupted the Sd card. reformating the card make its working with latet firmware.

CONSIGLIO 1

Just got it working! Very nice.
Couple of hints for others.
—Default baud is 9600 8n1.
—Make sure your card is formated as fat16.
—If you hook it directly up to FTDI Basic don’t forget to cross the rx and tx lines.

CONSIGLIO 2:

to format FAT16 with dos in xp:
c:>format e: /fs:fat

INFO:

STAT1 LED is the LED right of the word OpenLog and is sitting on PD5 (Arduino D5). This LED toggles on/off every time a new character is received. This LED helps troubleshoot and indicate serial communication is working.
STAT2 LED is the LED left of the word OpenLog and is sitting on PB5 (Arduino D13). This LED is attached to the SPI Serial Clock line. You will see this LED flash rarely. It only turns on when the SPI interface is active and this is rare as the OpenLog buffers 512 bytes at a time before recording to the SD card. Recording 512 bytes is very fast so the LED is on for very little.

Nate | about 3 months ago 1

OpenLog expects TTL voltage levels. RS232 will not work and could (maybe) harm the OpenLog (probably not though). You’ll need a MAX3232 or a shifter circuit.

UPLOAD FIRMWARE SENZA AVRDUDE:

Hobbytronics | last year 1

If you want to upgrade the firmware on this board with the latest version, you don’t have to go through the hassle of installing a custom version of Arduino as suggested. The compiled hex file is included in the download. There is a great little program called XLoader (http://xloader.russemotto.com/) which you can use to download the firmware into the openlog. (No avrdude knowledge required)