Develop a QCA7000 board?

Development and discussion of fast charging systems eg Chademo , CCS etc
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Develop a QCA7000 board?

Post by johu »

I started working on PP enable logic.

I modified the power supply. Formerly EN was floating meaning always on.
image.png
I have now connected a CJ431 reference that will disable the power supply when PP voltage rises above around 3V (can be changed with the resistor values).

To allow for this to work I added an optional PP pull-up to permanent 12V
image.png
I tried to use resistor values already used elsewhere. To restore default behaviour R66 must be removed or we add another solder jumper

Next step would be a high-side driver (aka PMOS) that Clara can enable to power up or trigger the other devices needed for charging. And a GPIO to the EN pin (with diode!) so that Clara can control its own power
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
tom91
Posts: 1308
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 103 times
Been thanked: 216 times

Re: Develop a QCA7000 board?

Post by tom91 »

How would you go about having multiple wake up methods for the power supply? Like a hold from the Micro itself?
Founder Volt Influx https://www.voltinflux.com/
Webstore: https://citini.com/
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Develop a QCA7000 board?

Post by johu »

Connect a uC pin to EN via a diode. Diode because otherwise the body diodes in the uC would inhibit turn-on. Since EN is pulled up the only thing the micro can do is pull it down, i.e. shut itself off.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
celeron55
Posts: 776
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 28 times
Been thanked: 110 times
Contact:

Re: Develop a QCA7000 board?

Post by celeron55 »

Is the CAN protocol used to configure and monitor ccs32clara documented anywhere?

I really despise esp32s and wifi and have had so many bad experiences with them (every time I try to use them I get more and more traumatized and days and days are erased from my expected lifespan) that I want to do the configuration using my Linux PC via a CAN adapter. This would entail e.g. a Python script.

An Arduino sketch that implements the protocol could also work.

If nobody knows how the CAN protocol actually works then maybe just add a serial console on the UART that can accept configuration and monitoring commands?

This is currently blocking my use of ccs32clara. I even spent a day with an esp32 and now I am ready to throw all my esp32s in the bin. The esp32 simply isn't something to depend on.

EDIT: It looks like the esp32 project contains a reasonably encapsulated implementation of the protocol and it even should port quite easily to a regular Arduino. I'll spend some time on that next.
https://github.com/jsphuebner/esp32-web ... oi_can.cpp
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Develop a QCA7000 board?

Post by johu »

Yes you found it. It's CANopen based and partly documented in the wiki
And theres that viewtopic.php?t=2907
It seems there's some scapegoating going on with the esp32. I recently discovered that a wrong resistor value caused the issue with my esp remote module. Plus there are some known bugs in the firmware and web interface

viewtopic.php?p=67270#p67270
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
uhi22
Posts: 601
Joined: Mon Mar 14, 2022 3:20 pm
Location: Ingolstadt/Germany
Has thanked: 91 times
Been thanked: 412 times

Re: Develop a QCA7000 board?

Post by uhi22 »

celeron55 wrote: Fri Feb 16, 2024 4:04 am I really despise esp32s and wifi and have had so many bad experiences with them (every time I try to use them I get more and more traumatized and days and days are erased from my expected lifespan) that I want to do the configuration using my Linux PC via a CAN adapter. This would entail e.g. a Python script.
I feel with you. I summarized my experiences here: viewtopic.php?p=67343#p67343
My conclusion is a different: The approach with the web interface is quite good, and starting a different approach would be more effort than fixing the stability issues of the current approach. But I could be wrong, and I fully understand that you do not want to waste your time fighting with this sh***y ESP. Same for me, at least at the moment ;-)
User avatar
celeron55
Posts: 776
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 28 times
Been thanked: 110 times
Contact:

Re: Develop a QCA7000 board?

Post by celeron55 »

Definitely should mention all these options in the ccs32clara user manual:
- ESP32 web interface (currently mentioned as the only option)
- https://github.com/davefiddes/openinverter-can-tool
- Porting the ESP32 web interface CAN code to any Arduino based system (making this even more portable should definitely be a goal)

Is there anything preventing making the configuration interface available via UART, like in most openinverter boards?
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Develop a QCA7000 board?

Post by johu »

celeron55 wrote: Fri Feb 16, 2024 3:47 pm Is there anything preventing making the configuration interface available via UART, like in most openinverter boards?
Right now the console is used for excessive logging. With that turned off it's a 1-liner to have the console on that pin. But then what are you going to connect to it that you couldn't also connect to CAN?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
celeron55
Posts: 776
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 28 times
Been thanked: 110 times
Contact:

Re: Develop a QCA7000 board?

Post by celeron55 »

johu wrote: Fri Feb 16, 2024 4:12 pm Right now the console is used for excessive logging. With that turned off it's a 1-liner to have the console on that pin. But then what are you going to connect to it that you couldn't also connect to CAN?
It is true that if the CAN configuration interface is easy to set up in various environments, there is not much need for UART.

So far, to me, it has not been, but I'm now going to try openinverter-can-tool and see how it goes.
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Develop a QCA7000 board?

Post by johu »

celeron55 wrote: Fri Feb 16, 2024 4:21 pm So far, to me, it has not been, but I'm now going to try openinverter-can-tool and see how it goes
Yes and please pester Dave to implement the CAN mapping :)
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
celeron55
Posts: 776
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 28 times
Been thanked: 110 times
Contact:

Re: Develop a QCA7000 board?

Post by celeron55 »

I posted about my problems in the OIC thread. The problem could be in ccs32clara too, I don't really have a clue: viewtopic.php?p=67380#p67380
User avatar
celeron55
Posts: 776
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 28 times
Been thanked: 110 times
Contact:

Re: Develop a QCA7000 board?

Post by celeron55 »

To avoid off-topic in the OIC thread, I'll continue here:

Wait what? I thought I pulled, compiled and flashed the latest clara!

This is supposed to be 0cb9745a3bea0e8171c03f190f38181dfb1a5f1c, and I built it on 9th February, just a week ago. The hex file I used has that date on it.

My OpenOCD script for flashing the firmware looks like this. Is there something wrong with this? Well, it's probably wrong, because the board still has the old firmware.

Code: Select all

source [find interface/stlink.cfg]
source [find target/stm32f1x.cfg]
init
targets
reset halt
flash write_image erase stm32_canloader.hex 0x08000000
flash write_image erase ../stm32_ccs.hex 0x08001000
reset run
shutdown
User avatar
celeron55
Posts: 776
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 28 times
Been thanked: 110 times
Contact:

Re: Develop a QCA7000 board?

Post by celeron55 »

Ah the frigging hex files already included the address offset. OpenOCD was trying to flash above 0x10000000 and that's no good. So, this is much better:

Code: Select all

source [find interface/stlink.cfg]
source [find target/stm32f1x.cfg]
init
targets
reset halt
flash write_image erase stm32_canloader.hex
flash write_image erase ../stm32_ccs.hex
reset run
shutdown
EDIT: Now OIC works:

Code: Select all

$ oic -n 22 listparams
udcdivider [dig/V] - min: 0 max: 100 default: 10
economizer [%] - min: 0 max: 100 default: 100
inletvtgsrc [0=ChargerOutput, 1=AnalogInput, 2=CAN] - min: 0 max: 2 default: 0
lockpwm [dig] - min: -100 max: 100 default: 30
lockruntm [ms] - min: 0 max: 10000 default: 1500
lockclosethr [dig] - min: 0 max: 4095 default: 0
lockopenthr [dig] - min: 0 max: 4095 default: 0
tmpsnsnom [Ohm] - min: 1 max: 1e+06 default: 10000
...
User avatar
uhi22
Posts: 601
Joined: Mon Mar 14, 2022 3:20 pm
Location: Ingolstadt/Germany
Has thanked: 91 times
Been thanked: 412 times

Re: Develop a QCA7000 board?

Post by uhi22 »

Yeah, now it's alive. Congrats :-)
User avatar
celeron55
Posts: 776
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 28 times
Been thanked: 110 times
Contact:

Re: Develop a QCA7000 board?

Post by celeron55 »

Here's the CAN log for "oic -n 22 serialno", for future reference. I did censor my serial number, but trust me, it was pretty boring:

Code: Select all

 (000.000000)  can0  616   [8]  40 00 50 02 00 00 00 00
 (000.001659)  can0  596   [8]  43 00 50 02 XX XX XX XX
 (000.001862)  can0  616   [8]  40 00 50 01 00 00 00 00
 (000.003666)  can0  596   [8]  43 00 50 01 XX XX XX XX
 (000.003795)  can0  616   [8]  40 00 50 00 00 00 00 00
 (000.005767)  can0  596   [8]  43 00 50 00 XX XX XX XX
User avatar
celeron55
Posts: 776
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 28 times
Been thanked: 110 times
Contact:

Re: Develop a QCA7000 board?

Post by celeron55 »

johu wrote: Fri Feb 16, 2024 4:33 pm Yes and please pester Dave to implement the CAN mapping :)
Yeah I think my next problem will be exactly that. Clara is quite useless without CAN mapping.
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Develop a QCA7000 board?

Post by johu »

Now back to the ESP32 with the firmware you already found ;)
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
celeron55
Posts: 776
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 28 times
Been thanked: 110 times
Contact:

Re: Develop a QCA7000 board?

Post by celeron55 »

I tried it, it works a bit but absolutely sucks. Can mappings don't work at all and the dashboard is blank, and everything is unresponsive and completely confidence destroying. I refuse to use it.
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Develop a QCA7000 board?

Post by johu »

The dashboard is targeted at inverter firmware, forget it. Enter node id 22, refresh the page and you should be good.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
celeron55
Posts: 776
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 28 times
Been thanked: 110 times
Contact:

Re: Develop a QCA7000 board?

Post by celeron55 »

I would prefer it if the configuration and integration parameters were built into the firmware binary and were unmodifiable at runtime. In my world view, source code is configuration.

The second best option is OIC.

An ESP32 wifi web interface is one of the worst possible options imaginable to me. Stop trying to make me use it, it's awful even at the concept level.

Is there an easy way to set unmodifiable parameters and CAN mappings into ccs32clara at build time?
User avatar
muehlpower
Posts: 575
Joined: Fri Oct 11, 2019 10:51 am
Location: Germany Fürstenfeldbruck
Has thanked: 12 times
Been thanked: 103 times

Re: Develop a QCA7000 board?

Post by muehlpower »

How do I get the latest version as a hex file? I can't get the toolchain to compile it myself to work. ( too stupid)
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Develop a QCA7000 board?

Post by johu »

Ok, I remember you use vi for coding, so yes a web interface must be terrifying for you :)

You can erase the last flash page, it contains the saved parameters. Then you edit param_prj.h (with vi !) and change the default values to what you need them to be. Then recompile. Option one achieved :)
muehlpower wrote: Sat Feb 17, 2024 9:25 am How do I get the latest version as a hex file? I can't get the toolchain to compile it myself to work. ( too stupid)
Will draft a random release in a moment, you'll find it here: https://github.com/uhi22/ccs32clara/releases

What is the most github-ish way to built a binary of every commit or something?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
celeron55
Posts: 776
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 28 times
Been thanked: 110 times
Contact:

Re: Develop a QCA7000 board?

Post by celeron55 »

johu wrote: Sat Feb 17, 2024 9:29 am You can erase the last flash page, it contains the saved parameters. Then you edit param_prj.h (with vi !) and change the default values to what you need them to be. Then recompile. Option one achieved :)
How can I set the CAN mappings?

EDIT: I suppose I can just add a bunch of

Code: Select all

canMap->AddSend();
canMap->AddRecv();
at the end of main()

It would be best to have an official place to put user-defined defaults at compile time. I'll see if I'll make a PR about that.

EDIT: And no it's not Vi, it's Vim. I'm modern like that. I can see in Wikipedia that by the time Vim was released in 1991, WaveLAN, the precursor to Wifi already existed!
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Develop a QCA7000 board?

Post by johu »

Two ways:
a) hard code them into main(). E.g. before the while(1) loop you add

Code: Select all

canMap->AddSend(Param::udclimit, 123, 16, 8, 1, 0);
123: id, 16: bit position, 8: bit length, 1: gain, 0: offset

b) use cansend

Code: Select all

cansend can0 616#23.01.30.00.02.01.00.00
cansend can0 616#23.01.30.01.E0.07.00.01
cansend can0 616#23.01.30.02.00.00.00.00
The first 4 bytes are the SDO specific things, the last 4 bytes the data
1st byte says you want to write something
2nd and 3rd byte is index 0x3001 specifying a CAN rx mapping (tx is 0x3000)
4th byte is the subindex and specifies what part of the mapping is contained in the data. So:
1st message specifies you want to map to id 0x102
2nd message specifies Param UID in first two bytes (0x7E0), then bit position (0), then length (1)
3rd message specifies gain in first 3 bytes times divided by 1000 and offset in last byte (all 0 in example because dummy message)

use oic to save the mapping when you're happy

corresponding code: https://github.com/jsphuebner/libopenin ... o.cpp#L353
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
celeron55
Posts: 776
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 28 times
Been thanked: 110 times
Contact:

Re: Develop a QCA7000 board?

Post by celeron55 »

johu wrote: Sat Feb 17, 2024 9:43 am b) use cansend
Yeah that's what I was probably going to get to next. I can implement this now in OIC now that I can cross check between your explanation and the ESP32 source code.

As long as OIC becomes fully featured, I have no need to mess with the firmware build and no need to complain about ESP32.
Post Reply