Rich mans ChaDeMo charger (3-phase)
- johu
- Site Admin
- Posts: 6618
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 341 times
- Been thanked: 1484 times
- Contact:
Re: Rich mans ChaDeMo charger (3-phase)
It must be in run mode to read these
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- Posts: 171
- Joined: Sat Aug 22, 2020 6:54 pm
- Location: Finland
- Has thanked: 13 times
- Been thanked: 18 times
Re: Rich mans ChaDeMo charger (3-phase)
As I wrote. Goes to run mode and there are no errors, but still no current reading.
-
- Posts: 171
- Joined: Sat Aug 22, 2020 6:54 pm
- Location: Finland
- Has thanked: 13 times
- Been thanked: 18 times
Re: Rich mans ChaDeMo charger (3-phase)
Is it possible that something goes wrong in my compiling?
Can somebody attach here a precompiled bin?
Can somebody attach here a precompiled bin?
- johu
- Site Admin
- Posts: 6618
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 341 times
- Been thanked: 1484 times
- Contact:
Re: Rich mans ChaDeMo charger (3-phase)
Oh, missed that.
Binary attached. In run mode there are no further conditions for displaying "idc". So it's not il1 or il2 but idc, mapped to Pin A5
EDIT: removed bin as it was defunct
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- Posts: 171
- Joined: Sat Aug 22, 2020 6:54 pm
- Location: Finland
- Has thanked: 13 times
- Been thanked: 18 times
Re: Rich mans ChaDeMo charger (3-phase)
Flashed in that FW and now my Web interface is showing strange things:
When I apply voltage to IN_START -> din_emcystop goes "on" in the spot values.
When I apply voltage to IN_EMCYSTOP -> din_ocur goes "on" in the spot values.
soc is showing the LV supply voltage.
I have 10V supplied as the battery voltage, but udc=0V in the spot values and 10V is shown in uout (changes according to udcgain).
Seems that everything is somehow shifted in the spot values view.
When applying voltage to IN_START, the spot values indicates "RUN" mode, but right away there comes an error message "communication broblem between ESP and STM". Inverter messages in the dash show "STOP - OVERCURRENT".
I even soldered an extra 22uF ceramic capacitor on the ESP 3V3 supply to filter out conducted interference from the PWM. Did not help.
I also placed a metal shield between the ESP and STM to rule out radiated interference. Did not help.
This all happened with only the mainboard. I do not yet have the PWM output connected to any IGBT gate driver and no switching action on any power stage.
-
- Posts: 171
- Joined: Sat Aug 22, 2020 6:54 pm
- Location: Finland
- Has thanked: 13 times
- Been thanked: 18 times
Re: Rich mans ChaDeMo charger (3-phase)
So, as the precompiled FW was acting strange, I reverted to playing around with the one that I compiled myself.
I was suspecting the IIR filter function and took it out from the current value.
Sure enough, I started seeing values in RUN mode. Then I noticed that for some reason, I had a negative value in the idcflt parameter.
Included the IIR filter back in to the code and changed the idcflt to a positive value... WORKS!
Really do not understand what is causing the strange behavior of the precompiled FW, but at least I am able to continue on my experiments now.
I was suspecting the IIR filter function and took it out from the current value.
Sure enough, I started seeing values in RUN mode. Then I noticed that for some reason, I had a negative value in the idcflt parameter.
Included the IIR filter back in to the code and changed the idcflt to a positive value... WORKS!
Really do not understand what is causing the strange behavior of the precompiled FW, but at least I am able to continue on my experiments now.

-
- Posts: 171
- Joined: Sat Aug 22, 2020 6:54 pm
- Location: Finland
- Has thanked: 13 times
- Been thanked: 18 times
Re: Rich mans ChaDeMo charger (3-phase)
Moving on from obsticle to another. Now the inputs seem to work, but I get no PWM output.
I have active low setting, so in off-mode the PWM1-TOP is high. When the system goes to run-mode, PWM1-TOP goes low and stays there.
It even stays there if I artificially generate a current sensor value higher than the idcspnt. There is no PWM in any other PWM output pin either.
Dashboard indicates no errors.
I also made a special mod to the code so that I can directly set TIM_OC1 value with a parameter on the spot values, but still no PWM.
pwm_timer_isr is working as the current value is being updated, but seems like the PWM output is for some reason not enabled...
I have active low setting, so in off-mode the PWM1-TOP is high. When the system goes to run-mode, PWM1-TOP goes low and stays there.
It even stays there if I artificially generate a current sensor value higher than the idcspnt. There is no PWM in any other PWM output pin either.
Dashboard indicates no errors.
I also made a special mod to the code so that I can directly set TIM_OC1 value with a parameter on the spot values, but still no PWM.
pwm_timer_isr is working as the current value is being updated, but seems like the PWM output is for some reason not enabled...
-
- Posts: 171
- Joined: Sat Aug 22, 2020 6:54 pm
- Location: Finland
- Has thanked: 13 times
- Been thanked: 18 times
Re: Rich mans ChaDeMo charger (3-phase)
Not sure if this is in anyway related, but when I cloned the repository, the magical "make get -deps" command resulted in some errors, so I just copied all the internals of the related libopencm3 and libopeninv folders from a working Zombie project. At least the compiling started working like that...
Now I am starting to wonder if I am missing something crucial and decided to try with a fresh clone of the stm32-charger repo.
As I write "make get -deps", I get this kind of an error messages:
Now I am starting to wonder if I am missing something crucial and decided to try with a fresh clone of the stm32-charger repo.
As I write "make get -deps", I get this kind of an error messages:
Code: Select all
Submodule 'libopencm3' (https://github.com/jsphuebner/libopencm3.git) registered for path 'libopencm3'
Submodule 'libopeninv' (https://github.com/jsphuebner/libopeninv.git) registered for path 'libopeninv'
Cloning into '/home/kelju/Documents/Orig_stm32-charger/stm32-charger/libopencm3'...
Cloning into '/home/kelju/Documents/Orig_stm32-charger/stm32-charger/libopeninv'...
Submodule path 'libopencm3': checked out 'b70da8dfc0635192753c9929d715ee6f57f23772'
Submodule path 'libopeninv': checked out 'b9751207b4853c244b107c895d5da83919862ae7'
MAKE libopencm3
make[1]: Entering directory '/home/kelju/Documents/Orig_stm32-charger/stm32-charger/libopencm3'
GENHDR include/libopencm3/stm32/f0/irq.json
/usr/bin/env: ‘python’: No such file or directory
make[1]: *** [Makefile:59: include/libopencm3/stm32/f0/irq.json.genhdr] Error 127
make[1]: Leaving directory '/home/kelju/Documents/Orig_stm32-charger/stm32-charger/libopencm3'
make: *** [Makefile:123: get-deps] Error 2
- johu
- Site Admin
- Posts: 6618
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 341 times
- Been thanked: 1484 times
- Contact:
Re: Rich mans ChaDeMo charger (3-phase)
Read and understand

You don't have python installed
Not sure why you're not seeing PWM. You've already modified the code anyway, you can achieve a fixed PWM by setting pwmmin and pwmmax to the same value.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- johu
- Site Admin
- Posts: 6618
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 341 times
- Been thanked: 1484 times
- Contact:
Re: Rich mans ChaDeMo charger (3-phase)
Yes but it is explicitly looking for the "python" command not "python3". So that you have to fix my copying/linking
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- Posts: 171
- Joined: Sat Aug 22, 2020 6:54 pm
- Location: Finland
- Has thanked: 13 times
- Been thanked: 18 times
Re: Rich mans ChaDeMo charger (3-phase)
Okay, I'll look into that to get that issue sorted.
In the meantime I read the STM32 reference manual section on the timers and specifically the PWM settings.
The idea was to understand the meaning of the code in the hwinit.cpp.
I started experimenting with replacing some of the settings and finally got PWM output.
Then I started testing that what is the issue with the existing code as I do not get PWM.
turns out that it was a single line of code that needed to be commented out...
If I have that line included, the PWM output goes low (active low) immediately as RUN mode is entered.
When I have that line commented out, everything works. I was able to buck a steady 2A current regulated output from a 50V input to the converter.
The purpose of that single line of code is to have a defined output state in an emergency shut down, right? Seems like an important feature...
In the meantime I read the STM32 reference manual section on the timers and specifically the PWM settings.
The idea was to understand the meaning of the code in the hwinit.cpp.
I started experimenting with replacing some of the settings and finally got PWM output.
Then I started testing that what is the issue with the existing code as I do not get PWM.
turns out that it was a single line of code that needed to be commented out...
Code: Select all
// timer_set_break_polarity_high(PWM_TIMER);
When I have that line commented out, everything works. I was able to buck a steady 2A current regulated output from a 50V input to the converter.
The purpose of that single line of code is to have a defined output state in an emergency shut down, right? Seems like an important feature...
- johu
- Site Admin
- Posts: 6618
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 341 times
- Been thanked: 1484 times
- Contact:
Re: Rich mans ChaDeMo charger (3-phase)
Yes for example the current window comparator is connected to that input to immediately shut down when ocurlim is exceeded. With the Prius IPM you might as well leave it commented out as it protects itself flawlessly
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9