KTM TBI build

Your chance to introduce yourself and your vehicle
Post Reply
JBR21
Posts: 15
Joined: Fri Dec 08, 2023 10:57 pm

KTM TBI build

Post by JBR21 »

Hello guys,

i am planning on building a STM32F407VGT6 based twostroke efi controller.

The bike where this should be testet will be a KTM SX 125 2023 model- that already comes with an efi oem.

So everything that is needed for the hardware besides the ecu it self (I have a guru currently designing the pcb layout) is already there.

It uses:
TPS, Crankcasepressure, ambientpressure, IAT,CLT and a VR type CPS.
Map switching happens via CAN- it has a 2 button switch on the handlebar.
The Exhaust power valve is controlled via a 4 wire servo (should be working with TPS/RPM).

The bike uses a 39mm Keihin TB with one injector infront and one injector behind the flap.

The original ecu comes from continental (I think it is a Synerject project from backm in the days- SR50-diTech and so on...)

I am currently tuning the oem ecus- but there are so many variables that affect the fueling and ignition, that you can't really stable tune the bikes to better performance than stock (only 34hp!!!!).
You can make better power with the tunes, but anyways there are some days, where the bikes wont run like you want to.

And the Crank case pressure sensor (CCPS lets call this guy so) affects fueling in a heavy way- I think this is next to tps and rpm the sensor with the highest input in the calculs.
I think it will likely work like alphaN+Map based- but I don't know that 100% (The throttle response when hitting redline and then after breaking going back in WOT is pretty difficult to tune I think...Thats why they use the crankcase pressure sensor)

What I noticed- due engine wear (piston running over 10 hours) the bike looses lots of power- this happens because the minimal pressure drop inside the crank case (blowby). This is way heavier than on a carbed model- so the efi restricts the fuel during the changd ccps values.

So my plan is to implement the rusefi into that awesome riding bike and making it perform better.... 8-)

I would like to use all the existing sensors- also the ccps, but I am not 100% sure how to handle it in the software site.

For tuning I would install a LSU4.9 and an EGT (where the EGT is always higher rated than Lambda).
The EGT should stay installed and should also be used for safety reasons during failures of the fueling system.

I am looking for any input I can get- this could get a great project!
Thanks in advance for any useful input!

Keep up the enthusiasm!
User avatar
AndreyB
Site Admin
Posts: 14345
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: KTM TBI build

Post by AndreyB »

JBR21 wrote:
Sat Dec 09, 2023 9:09 am
i am planning on building a STM32F407VGT6 based twostroke efi controller.
Welcome to the forum!

Why yet another hardware board? What specs do you need which are not met by open source https://github.com/rusefi/alphax-2chan for instance? There is also that totally secret for another couple of weeks https://github.com/rusefi/uaefi I wonder if that could be useful at least as a prototype?

Also if you really need a custom hardware maybe consider STM32F405RGT6 :)

What's your background, are you planning to write any custom C/C++ rusEFI code or just Lua?
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
JBR21
Posts: 15
Joined: Fri Dec 08, 2023 10:57 pm

Re: KTM TBI build

Post by JBR21 »

Hey Andrey,

I am going the "harder" way, because I want to use the existing oem wiring harness and plug.
The problem is the space under the seat at all- there is only space for around 150x100mm.

So I am going to print a case, that fits under the seat- just like oem :).

I thought, that I need a custom code to get the map readings interprete correclty. Am I wrong with that? :D

So which processor would you recommend to use mate?

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

Re: KTM TBI build

Post by AndreyB »

All processors are kind of same. I would recommend NOT starting with hardware, I would recommend to hack together whatever you can get cranking quickest and take care of all the firmware before hardware. See https://github.com/rusefi/rusefi/wiki/Plug-In-Board-Process
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
JBR21
Posts: 15
Joined: Fri Dec 08, 2023 10:57 pm

Re: KTM TBI build

Post by JBR21 »

Thanks for the fast replies, Andrey! :)

So I got the bike running with a standalone ecu- Emu Black and Maxecu. But now I want to go my own way.

So basically I know how to get that engine running- and now I want to build it smaller and plug and play.
I did not try it with a rusefi ECU yet- just because I had these two ecus in my workshop and dont needed to buy a new one.

So all wiring and research is done- and also well documented... :D

What will make me some headache is bringing the MIL blinking LED to produce the right blinks, if an error occures- the oem ecu uses a "morse code" for indicating different erros for example 4 short 2 long and so on....
But I think this can be done in the FW maybe?

And the Map switch is done via can bus- it has 2 different buttons that light up for the map you are currently riding with ( green or white) If the can messages are wrong, both lights are always active...So I need to hack into it, to see, how it handles the different situations.

The part, currently struggeling with the most is the map sampling for getting good throttle response after WOT ( without going too lean...)

Best regards
User avatar
AndreyB
Site Admin
Posts: 14345
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: KTM TBI build

Post by AndreyB »

JBR21 wrote:
Sat Dec 09, 2023 11:33 pm
So basically I know how to get that engine running- and now I want to build it smaller and plug and play.
KTM SX 125 2023 do you have a photo of stock ECU? do you know connector part number? can you share any pinout etc info please?
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
AndreyB
Site Admin
Posts: 14345
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: KTM TBI build

Post by AndreyB »

looks fancy

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
JBR21
Posts: 15
Joined: Fri Dec 08, 2023 10:57 pm

Re: KTM TBI build

Post by JBR21 »

Hey Andrey,

The bike comes with the cmc 64 Pin molex style connector.
The stock ecu: Continental M4C.

Bike overall is awesome, just the power is so down to earth :D The carby models had around 40ish hp- these tbi bikes only produce around 34-35 from stock....
User avatar
AndreyB
Site Admin
Posts: 14345
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: KTM TBI build

Post by AndreyB »

Keep up posted and let me know if you would need help from rusEFI LLC :)
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
JBR21
Posts: 15
Joined: Fri Dec 08, 2023 10:57 pm

Re: KTM TBI build

Post by JBR21 »

Thanks mate!

I will for sure need some help, when it keeps to rund the firmware.
Is there anything already running on a twostroke with crankcase pressure sensor sampling?

An example would be great! Currently I am struggeling a bit on which FW I should choose- is there any yt "how to" for dummys? :D

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

Re: KTM TBI build

Post by AndreyB »

Not aware of anyone doing anything with crankcase pressure. Not sure what would be FW for dummies :(

The LLC provides paid consultancy services up to developing the complete product see https://github.com/rusefi/rusefi/wiki/Standalone-on-Demand
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
JBR21
Posts: 15
Joined: Fri Dec 08, 2023 10:57 pm

Re: KTM TBI build

Post by JBR21 »

Hey guys,

is there any chance by chaning the fw to set tps without tunerstudio?

So lets say the flags are:

ECU powered
Engine not running
tps 3 times WOT to closed (snap the throttle)
= get the current closed tps value as 0%

The original ecu can do this when you plugin a delivered dongle that powers up the ecu while the bike is not running.

It would be awesome, if we could figure that out!

Thanks guys :)
User avatar
AndreyB
Site Admin
Posts: 14345
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: KTM TBI build

Post by AndreyB »

https://xyproblem.info/?

please elaborate
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
mi-hol
Posts: 39
Joined: Sun Jun 05, 2022 10:37 pm
Location: Tübingen, Germany
Github Username: mi-hol

Re: KTM TBI build

Post by mi-hol »

Mechanical TPS wear is a common issue.
As an example Benelli motorcycles show strange behavior when TPS is not properly calibrated.
Building a solution for end users requires a simple TPS recalibration procedure without additional investment into TunerStudio or similar software.

I've encountered likely the same requirement in doing connector mapping in firmware/config/boards/Benelli_Walbro/connectors/Benelli_Walbro.yaml
There the "type" TPS is not yet defined but code in firmware/config/boards/mre_meta.h and other source files has apparently hard coded the TPS
// tps = "20 - AN volt 5" PC3
#define MRE_IN_ANALOG_VOLT_5 EFI_ADC_13
#define MRE_IN_TPS MRE_IN_ANALOG_VOLT_5

Does this help to explain the reason?
Best Regards
Michael
--------
Benelli Tornado 900 Tre
Benelli TNT 1130 (rebuilding)
User avatar
AndreyB
Site Admin
Posts: 14345
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: KTM TBI build

Post by AndreyB »

mi-hol wrote:
Sat Dec 16, 2023 3:59 pm
Mechanical TPS wear is a common issue.
As an example Benelli motorcycles show strange behavior when TPS is not properly calibrated.
Building a solution for end users requires a simple TPS recalibration procedure without additional investment into TunerStudio or similar software.

Does this help to explain the reason?
Yes thank you!!!
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
AndreyB
Site Admin
Posts: 14345
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: KTM TBI build

Post by AndreyB »

mi-hol wrote:
Sat Dec 16, 2023 3:59 pm
#define MRE_IN_ANALOG_VOLT_5 EFI_ADC_13
#define MRE_IN_TPS MRE_IN_ANALOG_VOLT_5
Those are only soft suggestions just to unify wiring but totally not hard requirements. Same as https://rusefi.com/docs/pinouts/proteus/?connector=black35&pin=20 is recommended fuel pump output unless you have 10 cylinders.
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
AndreyB
Site Admin
Posts: 14345
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: KTM TBI build

Post by AndreyB »

CJ125 :(
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
JBR21
Posts: 15
Joined: Fri Dec 08, 2023 10:57 pm

Re: KTM TBI build

Post by JBR21 »

mi-hol wrote:
Sat Dec 16, 2023 3:59 pm
Mechanical TPS wear is a common issue.
As an example Benelli motorcycles show strange behavior when TPS is not properly calibrated.
Building a solution for end users requires a simple TPS recalibration procedure without additional investment into TunerStudio or similar software.

I've encountered likely the same requirement in doing connector mapping in firmware/config/boards/Benelli_Walbro/connectors/Benelli_Walbro.yaml
There the "type" TPS is not yet defined but code in firmware/config/boards/mre_meta.h and other source files has apparently hard coded the TPS
// tps = "20 - AN volt 5" PC3
#define MRE_IN_ANALOG_VOLT_5 EFI_ADC_13
#define MRE_IN_TPS MRE_IN_ANALOG_VOLT_5

Does this help to explain the reason?
Thanks mate, that brings a bit of light into it! Awesome!!
JBR21
Posts: 15
Joined: Fri Dec 08, 2023 10:57 pm

Re: KTM TBI build

Post by JBR21 »

AndreyB wrote:
Mon Dec 18, 2023 1:08 am
CJ125 :(
Hey Andrey,

Yeah- I saw that post. Is there any other possibility in using an onboard Lambda controller? I tried the search function, but am not really sure about it.

Or is an external the way to go?

Thanks for that input!
User avatar
AndreyB
Site Admin
Posts: 14345
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: KTM TBI build

Post by AndreyB »

https://github.com/rusefi/uaefi is still the answer to your question, documentation was improved since I've posted it previously
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
JBR21
Posts: 15
Joined: Fri Dec 08, 2023 10:57 pm

Re: KTM TBI build

Post by JBR21 »

AndreyB wrote:
Mon Dec 18, 2023 3:44 pm
https://github.com/rusefi/uaefi is still the answer to your question, documentation was improved since I've posted it previously
Thanks Andrey, I will have a look!!
JBR21
Posts: 15
Joined: Fri Dec 08, 2023 10:57 pm

Re: KTM TBI build

Post by JBR21 »

Hey guys,

is there a way to implement staged injection to the firmware? I am currently trying to research- but I can't find that much.

It is needed for that project :o

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

Re: KTM TBI build

Post by AndreyB »

JBR21 wrote:
Tue Dec 26, 2023 10:20 pm
It is needed for that project :o
Do you have skills or funding to offer?
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
Post Reply