Page 3 of 4

Re: Johannes in a Blue Pill

Posted: Wed Sep 25, 2019 8:16 am
by johu
Well, it would seem the Blue Pill has a little layout problem. So no matter if you set the break input active high or low it trips out as soon as the PWM runs, even though the break input is tied to ground or VCC, respectively. If the break function is disabled per timer register, all runs ok.
Now, I disabled the PWM1N output which is adjacent to the break input. Et voila: no trip.
Next I tried to enable the internal pull-up of break input and this also leads to avoiding false trips. Now the pin can even be left floating and as soon as it's pulled to GND the PWM stops.
When scoping the open pin you can see some cross talk but only about 150mV peak-to-peak and far away from the low threshold voltage. So still not 100% sure where the cross talk happens.

EDIT: binary attached

Re: Johannes in a Blue Pill

Posted: Wed Sep 25, 2019 10:00 am
by Jack Bauer
Cool. Will test this asap.

Re: Johannes in a Blue Pill

Posted: Fri Sep 27, 2019 8:56 am
by Bigpie
It may be me doing something wrong, but I've flashed the above to bluepill, I've got GND and 3.3V connected as well as UART. Scope probe on PB_13 and issued start 2 (inverter started), set fslipspnt 10 (set OK), set ampnom 10 (set OK) and I don't get any output on PB_13

Re: Johannes in a Blue Pill

Posted: Fri Sep 27, 2019 9:36 am
by Jack Bauer
@bigpie You need a direction selected.

solved the encoder noise issue and we are now running an induction motor in closed loop mode with bluepill and prius inverter.

Re: Johannes in a Blue Pill

Posted: Fri Sep 27, 2019 10:46 am
by Bigpie
@Jack Bauer :D I've got PWM now.

What's the bare minimum needed to start in mode 1? I don't want to bother with voltage, current and temperature sensors at the moment.
I want to next move on to running my 3D printed motor without position feedback.

Re: Johannes in a Blue Pill

Posted: Thu Oct 24, 2019 9:07 am
by yaroslav
Good day, I do not see the brake signal, I checked the circuit and the resistance of 4.7 K and 1.2 K, but when applying + on PB9 nothing happens, in the web interface the brake signal is 0

Re: Johannes in a Blue Pill

Posted: Thu Oct 31, 2019 10:11 pm
by johu
So pull high PB1 and PB7 and momentarily, PB6.
Confirmed, theres a problem with PB9.
EDIT: found it, it was remainders of the user_pwm output on PB9. Will update on github.

So I had another idea. I could delete the uaux/mprot min and instead use it as exciter/tim_ch3 pin. The latter would enable the usage of hall sensors.

Is monitoring the "12V" voltage a commonly used feature? Personally I do check it from time to time.

Re: Johannes in a Blue Pill

Posted: Mon Nov 04, 2019 11:37 am
by yaroslav
I do not use mprot at all because in my projects it is not present, and here 12V it is possible and to leave, for control

Re: Johannes in a Blue Pill

Posted: Mon Nov 04, 2019 11:40 am
by yaroslav
Still there was one problem, sometimes at a certain position of the encoder the engine without load starts with a delay, when the encoder is slightly cranked the problem goes away

Re: Johannes in a Blue Pill

Posted: Fri Jan 31, 2020 3:48 pm
by yaroslav
I do not know what the problem is but it started with the installation of firmware 4.55 and higher, no matter what frequency I put fmax does not work the engine speed limit turns without load up to 12000rpm goes to accelerate

Re: Johannes in a Blue Pill

Posted: Sat May 16, 2020 3:04 pm
by konstantin8818
Trying to programm blue pill on a gen2 board with attached contactors, I've bumped into a problem. Every time I connect 12V to a board, precharge contactor cycles "on/off" three times and one time "on" in one second. I believe it cycles every time controller faces an error. There are three errors show up:
20200515_190302.jpg
And if I connect "start" to 12V, precharge contactor turns off as intended, but main does not turns on.
Am I the only one to face such a problem? Have I done something wrong?

Re: Johannes in a Blue Pill

Posted: Tue Jun 16, 2020 6:14 pm
by bexander
I'm new to this forum, to this inverter and to STM32/ESP8266...
Trying to use a "blue pill" and an Olimex Mod-wifi-esp8266 to do some testing.
I have programmed the ESP with arduino ide and can axcess the web interface ok.
It sends out serial data when I use the "send custom command". Basically the ascii code of what I put in to send.
I have also programmed the STM32 with the lates firmware (stm32_sine.bin (4.85)) using stm32flash but I can not get any response from it in the web interface or any PWM output.
I have tried to pull PB1, PB7 and momentarly PB6 high but no PWM.
Also tried sending "start 2", then "set fslipspnt 10" and finally "set ampnom 10". Also with the above pins high.
I do not get any response in web interface when sending the commands? Are there suppose to be any response message?
I have tried reversing the rx/tx pins from the esp with no change.

What have I missed?

Re: Johannes in a Blue Pill

Posted: Tue Jun 16, 2020 7:46 pm
by johu
Are you on correct UART? PB10, PB11.
Yes there is always a response to valid commands.

Re: Johannes in a Blue Pill

Posted: Wed Jun 17, 2020 7:09 am
by bexander
Yes, uart3.
If I flash the bootloader the stm32 sends 0x2D, as expected.
The firmware does not require the bootloader, correct? The firmware can be flashed directly on the blue pill bootloader?

I will create some simple arduino sketch to verify that the uart3 is working correctly and post when done.

Re: Johannes in a Blue Pill

Posted: Wed Jun 17, 2020 5:09 pm
by johu
It does require the boot loader. It is started at reset and starts the actual firmware when no update is requested.

Re: Johannes in a Blue Pill

Posted: Wed Jun 17, 2020 6:56 pm
by bexander
Ok, thanks, that explains alot!
I've just tested the hardware and it works.

Please, can you tell me how I upload first the bootloader and then the firmware, without erasing the bootloader, using stm32flash.
I guess -s option is needed but at what adress?

Re: Johannes in a Blue Pill

Posted: Wed Jun 17, 2020 7:38 pm
by johu
It's 11 years ago that I used stm32flash :) Boot loader is on 0x08000000 and firmware at 0x08001000

Re: Johannes in a Blue Pill

Posted: Wed Jun 17, 2020 7:40 pm
by bexander
Hm, I've made some progress, I think.
Did:
stm32flash -w stm32_loader.hex -b 115200 /dev/ttyUSB0
stm32flash -w stm32_sine.hex -e 0 -b 115200 /dev/ttyUSB0
Now the onboard green led blinks!

Update:
It works!

Thank you for all your help!!

Re: Johannes in a Blue Pill

Posted: Thu Oct 29, 2020 6:52 am
by aravinth
I have flashed my Bluepill with a USB Bootloader and when I flash it with stm32_sine.bin the green led stays on.
Where do I find the bootloader which supports stm32_sine firmware ??

Re: Johannes in a Blue Pill

Posted: Thu Oct 29, 2020 7:11 am
by bexander

Re: Johannes in a Blue Pill

Posted: Sat Oct 31, 2020 1:28 pm
by aravinth
Hello, I've got response from the bluepill.
My Current setup is Bluepill connected with USB to TTL Convertor, I used Putty on linux ubuntu for serial terminal.
I cant seem to start inverter in manual mode, typing start 2 on the terminal gives response as Inverter started, set fslipspnt 10 , set ampnom 10 and response is Set ok, and when I try to select the direction as set dir 1 it says value out of range, so I couldn't see any pwm pulses on any pwm pins.

Someone please tell me how to select the direction.
Thank you.

Re: Johannes in a Blue Pill

Posted: Sat Oct 31, 2020 4:32 pm
by Isaac96
Pull the FWD pin to positive (3.3v).
Not sure which pin that is, check the schematics.

Re: Johannes in a Blue Pill

Posted: Sat Oct 31, 2020 4:38 pm
by Bigpie
Usart seems funky on my bluepills. Not sure why, if I use USB TTL the communication works, using Olimex mod wifi or demos d1 the communication doesn't work.

Anyone any idea why? These cheap bluepills seem very hit and miss.

Re: Johannes in a Blue Pill

Posted: Sat Oct 31, 2020 5:05 pm
by bexander
Bigpie wrote: Sat Oct 31, 2020 4:38 pm Usart seems funky on my bluepills. Not sure why, if I use USB TTL the communication works, using Olimex mod wifi or demos d1 the communication doesn't work.

Anyone any idea why? These cheap bluepills seem very hit and miss.
What do you mean with seial communication doesn't work with WiFi-module. Please be more specific, is there no transmissions, signals are there but can't receive anything etc.
Have you tried to reverse postion of Tx and Rx when using the WiFi-modules?

Re: Johannes in a Blue Pill

Posted: Sat Oct 31, 2020 6:01 pm
by Bigpie
Oops, I get an error on index.html, cannot parse json.

If I look at request or hit 'http://x.x.x.x/cmd?cmd=json' I get

Code: Select all

j��)
I've tried with the Olimex Mod-WiFi that I know works as I pulled it from my inverter.