[help needed] rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

It's all about the code!
Post Reply
amunozho
Posts: 10
Joined: Tue Oct 27, 2020 8:42 am
Location: Spain

rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by amunozho »

Hi everyone!!

I got a rusEFI to control a small air-cooleed engine and I have all ready to run... except one thing.

Because of this engine is air-cooled, the CLT sensor can reach 200ºC-300ºC but when I open the tunnerStudio project to monitorize the EFI, when the CLT temperature is greater than 200ºC, CLT Gauge turn to 0.

I have read some messages from the forum to edit the config.ini file from the TunnerStudio project to change the upper limit and fix it at 350 ºC. I can change the gauges limits but I can't find a parameter to change the 200ºC limit.

How can I do it?

Thanks in advise.
;)
User avatar
AndreyB
Site Admin
Posts: 14331
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by AndreyB »

amunozho wrote:
Tue Oct 27, 2020 8:56 am
Because of this engine is air-cooled, the CLT sensor can reach 200ºC-300ºC
I've created https://github.com/rusefi/rusefi/issues/1914 to track this issue

if you please paste exact screenshots of how TunerStudio is handling things now for you and what are those limits affecting it would be easier for us to test our changes once we make those.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
amunozho
Posts: 10
Joined: Tue Oct 27, 2020 8:42 am
Location: Spain

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by amunozho »

Thanks for help!! :D

For a better explain I tell you my configuration:

- 10k thermistor (with a bias pull up 2.49K resistor) wtih a voltage driver at the entry of the clt's ADC (PC2. STM32F407VG microcontroller)
image.png
image.png (6.31 KiB) Viewed 12740 times
I checked all my conections and It is all OK and at the entry of the CLT's ADC, I measure 2.65 V (it's depends of the temperature) but when I see the CLT volt gauge, It shows above of 4V and if I disconect the thermistor shows around 6V when it may show around 3.3V.

Fuerthermore, when I increasse the temperature beyong of 200 ºC, the Tunner Studio show a CLT error and the gauge turn to 0 V.

You can see it athe the following clip. https://drive.google.com/file/d/150RFGb4BHba3BtAacuXpdVTHGbhZSdP0/view?usp=sharing

Thanks for all! ;)
User avatar
AndreyB
Site Admin
Posts: 14331
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by AndreyB »

please upload your tune to rusEFI online and paste the link here

in rusEFI console please type
tempinfo
and paste output here

I wonder if reading that high is confusing thermistor math
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
mck1117
running engine in first post
running engine in first post
Posts: 1494
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by mck1117 »

I think the only limit imposed by rusEfi is that if the sensor voltage gets too high (or low) we assume that the sensor is disconnected (or shorted). That limit is currently 4.9 volts when using a pullup to 5 volts.
mck1117
running engine in first post
running engine in first post
Posts: 1494
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by mck1117 »

After looking closer at your schematic....is this Frankenso or some other board? I don't see the required voltage divider to divide the 5v input down to the 3.3v usable by the STM32's ADC.
amunozho
Posts: 10
Joined: Tue Oct 27, 2020 8:42 am
Location: Spain

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by amunozho »

Hi everyone!

This is the tune URL: https://rusefi.com/online/view.php?msq=250

I'm sorry, I didn't congufigurate my drive properly. Now the clip is available here: https://drive.google.com/file/d/150RFGb4BHba3BtAacuXpdVTHGbhZSdP0/view?usp=sharing
amunozho
Posts: 10
Joined: Tue Oct 27, 2020 8:42 am
Location: Spain

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by amunozho »

mck1117 wrote:
Tue Oct 27, 2020 6:09 pm
I think the only limit imposed by rusEfi is that if the sensor voltage gets too high (or low) we assume that the sensor is disconnected (or shorted). That limit is currently 4.9 volts when using a pullup to 5 volts.
My pull-up resistor (or bias resistor R11 ) is at VDDA = 3.3 V. VDDA is the ADCs supply voltage.

Because of this pull up resistor, if i disconect the thermistor, the voltage at the entry opf the adc (or at the output of de voltage driver) must be VDDA = 3.3V.

Why the TunnerStudio shows 6V?
Last edited by amunozho on Wed Oct 28, 2020 9:13 am, edited 1 time in total.
amunozho
Posts: 10
Joined: Tue Oct 27, 2020 8:42 am
Location: Spain

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by amunozho »

mck1117 wrote:
Tue Oct 27, 2020 6:12 pm

After looking closer at your schematic....is this Frankenso or some other board? I don't see the required voltage divider to divide the 5v input down to the 3.3v usable by the STM32's ADC.
Hi! :D
image.png
image.png (23.08 KiB) Viewed 12705 times
[/img]

It Is a custom board based on Frankenso (STM32F407VG microcontroller).

Regards :D
amunozho
Posts: 10
Joined: Tue Oct 27, 2020 8:42 am
Location: Spain

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by amunozho »

AndreyB wrote:
Tue Oct 27, 2020 5:34 pm
please upload your tune to rusEFI online and paste the link here

in rusEFI console please type
tempinfo
and paste output here

I wonder if reading that high is confusing thermistor math
Hi! :D

Here is the results of typing "tempinfo":
image.png
image.png (317.78 KiB) Viewed 12703 times
Last edited by amunozho on Thu Oct 29, 2020 3:07 pm, edited 1 time in total.
User avatar
AndreyB
Site Admin
Posts: 14331
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by AndreyB »

amunozho wrote:
Wed Oct 28, 2020 8:32 am
Why the TunnerStudio shows 6V?
because rusEFI firmware expects same voltage divider on all analog inputs
image.png
image.png (18.44 KiB) Viewed 12700 times
if you do not have same dividers on all analog inputs (with exception of VBatt) you would need custom firmware to handle this custom hardware setup.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
mck1117
running engine in first post
running engine in first post
Posts: 1494
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by mck1117 »

Can you share the full schematic?
amunozho
Posts: 10
Joined: Tue Oct 27, 2020 8:42 am
Location: Spain

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by amunozho »

AndreyB wrote:
Wed Oct 28, 2020 9:14 am
amunozho wrote:
Wed Oct 28, 2020 8:32 am
Why the TunnerStudio shows 6V?
because rusEFI firmware expects same voltage divider on all analog inputs

image.png

if you do not have same dividers on all analog inputs (with exception of VBatt) you would need custom firmware to handle this custom hardware setup.
Thanks AndryB!!

I have changed the value of the analog divider ratio to 1.66V and CLT and IAT sensor show the temperature correctly.

But when I see the voltage raw, the voltage of the IAT is OK but the raw of voltage of the CLT is wrong:

image.png
image.png (425.59 KiB) Viewed 12693 times
[/url]

In my case, for the IAT and the CLT I have the same pull up resistor but the thermistor are diferent:

- IAT sensor is a 2K thermistor at 25ºC.
- CLT sensor is a 10K thermistor at 25ºC.

Here is the current view of my tunner Studio where you can see the volages of the sensors:
image.png
image.png (24.36 KiB) Viewed 12693 times
AndreyB when you said that we should need the same dividers, it means I need the same thermistors with the same resistance too and if we use different thermistors we need to change something at the sofware of the config.ini file of the TunnerStudio project or the rusEFI firmware. Is it correct?

Actually with this config, I can saw temperatures up to around 250ºC.

Again, thanks you very much! :D
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by kb1gtt »

This divider is what was referenced.
Capture.PNG
Capture.PNG (8.83 KiB) Viewed 12683 times
Sharing the full schematic helps us understand what kinds of issues may be happening. We can look at it and know what voltages to expect. etc.
Welcome to the friendlier side of internet crazy :)
amunozho
Posts: 10
Joined: Tue Oct 27, 2020 8:42 am
Location: Spain

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by amunozho »

kb1gtt wrote:
Wed Oct 28, 2020 12:41 pm
This divider is what was referenced.
Capture.PNG

Sharing the full schematic helps us understand what kinds of issues may be happening. We can look at it and know what voltages to expect. etc.
Thanks for your answer! :D

I don't have a divider after the OPAMP. This is all:
image.png
image.png (38.43 KiB) Viewed 12677 times
image.png
image.png (103.89 KiB) Viewed 12677 times
In my case VDDA = 3.3 V, so cf I didn't conncet anything, the output voltage of the OPAMPs may be VDDA = 3.3 V or a little bit lower.

This is due to this pull-up resistance, a voltage divider after the OPAMP is not necessary since the maximum output voltage is limited by this resistor at 3.3V.

Wouldn't that be so?

Regards.
Last edited by amunozho on Wed Oct 28, 2020 2:19 pm, edited 1 time in total.
User avatar
AndreyB
Site Admin
Posts: 14331
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by AndreyB »

My perception is that you have refused to share full schematics, this could affect my motivation to help going forward.

default rusEFI firmware expects same voltage divider on all analog inputs and all calculations are affected by that parameter.

At this point I would suggest we do not debate if that's necessary or not necessary, I would suggest focusing at this fact and the consequences of that fact on your setup.

Since you have ignored the request to share full schematics I am not able to help you effectively.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by kb1gtt »

It would appear you do not understand certain things about opamps. Opamps have many characteristics that are important. However with out knowing this level of information I cannot help you. It's not a question of if I want to help you, I simply don't have enough information to be able to help you.
Welcome to the friendlier side of internet crazy :)
amunozho
Posts: 10
Joined: Tue Oct 27, 2020 8:42 am
Location: Spain

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by amunozho »

AndreyB wrote:
Wed Oct 28, 2020 2:37 pm
My perception is that you have refused to share full schematics, this could affect my motivation to help going forward.

default rusEFI firmware expects same voltage divider on all analog inputs and all calculations are affected by that parameter.

At this point I would suggest we do not debate if that's necessary or not necessary, I would suggest focusing at this fact and the consequences of that fact on your setup.

Since you have ignored the request to share full schematics I am not able to help you effectively.
Hi everyone!

First of all, I want to apologize, I didn't pay attention to the line in which you asked me for the full schematics, It's was my fault.

Here are all :

- Analog:
image.png
image.png (85.05 KiB) Viewed 12627 times
- Power:
image.png
image.png (80.34 KiB) Viewed 12627 times
- Inputs / Outputs:
image.png
image.png (84.92 KiB) Viewed 12627 times
- uC:
image.png
image.png (132.67 KiB) Viewed 12627 times
Again, I beg your pardon.

Regards. :D
User avatar
AndreyB
Site Admin
Posts: 14331
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by AndreyB »

When running rusEFI on on 3 volt stm32 chips all our boards have same voltage divider ratio on all analog inputs - the ratio is 2:1 on Frankesno and 1.66:1 on microRusEFI

We have corresponding setting which in your case you would have to set to "1" - setting screenshot above. This way you would have to account for your custom per-channel voltage divider in your calibrations. While we have not done so I guess it should be possible?
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
amunozho
Posts: 10
Joined: Tue Oct 27, 2020 8:42 am
Location: Spain

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by amunozho »

AndreyB wrote:
Thu Oct 29, 2020 11:55 am
When running rusEFI on on 3 volt stm32 chips all our boards have same voltage divider ratio on all analog inputs - the ratio is 2:1 on Frankesno and 1.66:1 on microRusEFI

We have corresponding setting which in your case you would have to set to "1" - setting screenshot above. This way you would have to account for your custom per-channel voltage divider in your calibrations. While we have not done so I guess it should be possible?
Actually the only configuration that throw a coherent temperature measure is setting the parameter Analog divider = 1.66.
image.png
image.png (365.68 KiB) Viewed 12607 times
The Clt thermistor is disconected in this picture, if I connect it, the clT temperature gauge show the same temperature than the IAT gauge and its the same than the real temperature.

The only thing that is diferent is the voltage raw gauges. These are refered to 5V and I have the reference with the pull-up resitor at 3.3V.

I hope that my information helps you.

Thanks you so much!
User avatar
AndreyB
Site Admin
Posts: 14331
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by AndreyB »

amunozho wrote:
Thu Oct 29, 2020 1:40 pm
I hope that my information helps you.
I do not see any questions, I do not see "tempinfo" detailed output.

Do you have any questions? What are your questions?
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by kb1gtt »

What opamp are you using? Opamps do not go to the rails, as well there are things like offset, and gain which are important.

What program is this done in? Could you share the native file format? I'm assuming your program can do things like highlighting a net, which is handy when trying to track tagged nets like VDDA.

For @Andrey, he's using the 3V for his bias voltage to things like CLT etc, not 5V, so his output can only go up to 3V. He has the divider on the input instead of the output. His circuit is not 12V tolerant, if he shorted that accidently, the ECU is toast, it will probably blow the STM32. However his inquiry is about the scaling of the signals. His scaling is very non-linear and is very much not like any of our boards. I think he's asking how to scale his voltage so he can get a number in engineering units.
Welcome to the friendlier side of internet crazy :)
mck1117
running engine in first post
running engine in first post
Posts: 1494
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by mck1117 »

kb1gtt wrote:
Fri Oct 30, 2020 1:22 am
What opamp are you using? Opamps do not go to the rails, as well there are things like offset, and gain which are important.
Plenty of opamps can actually drive to the rails - the MCP6004 used on Frankenso, MRE, and Proteus can, for example. The opamp's open loop gain is largely unimportant, as nobody runs an opamp without feedback. Offset is important, but is usually small enough we don't care for stuff like this.

kb1gtt wrote:
Fri Oct 30, 2020 1:22 am
His circuit is not 12V tolerant, if he shorted that accidently, the ECU is toast, it will probably blow the STM32. However his inquiry is about the scaling of the signals. His scaling is very non-linear and is very much not like any of our boards.
Yes, this is my actual concern here. VDDA shouldn't be anywhere near an output pin. 2.5k without any clamping is practically a short circuit when presented with ESD or noise from the ignition system.
kb1gtt wrote:
Fri Oct 30, 2020 1:22 am
I think he's asking how to scale his voltage so he can get a number in engineering units.
Set the analog input divider to 1.0, and the stm32 vref to 3.3. That should get the thermistors working okay. The MAP and TPS might require "technically wrong" calibration values, but they can be made to work just fine if the actual voltages are divided by the ratio of the dividers on those inputs.
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: rusEfI based on STM32F4 (Frankenso) for air-cooled small vehicles

Post by kb1gtt »

mck1117 wrote:
Fri Oct 30, 2020 10:12 am
kb1gtt wrote:
Fri Oct 30, 2020 1:22 am
What opamp are you using? Opamps do not go to the rails, as well there are things like offset, and gain which are important.
Plenty of opamps can actually drive to the rails - the MCP6004 used on Frankenso, MRE, and Proteus can, for example. The opamp's open loop gain is largely unimportant, as nobody runs an opamp without feedback. Offset is important, but is usually small enough we don't care for stuff like this.
Many years ago, I measured the MC6004 (and several other rail to rail opamps) to have issues around 10mV to 20mV from the bottom rail. For Frankenso I choose this opamp because it was far closer to the rails than several others that we tried, and most of the issues for the MC6004 were at the top end, which we intentionally avoid. I guess the skewing near th rails, or offsets near the rails or simply not getting to rail, when near the rails is considered close enough to be rail to rail, but keep in mind you typically can't hit the rails, the question is how close you can get. As well the circuitry used to get close to the rails can cause instabilities, oscillations, etc, which do not exist when you're in the middle of the opamps range.
Welcome to the friendlier side of internet crazy :)
Post Reply