New 4-cyl ECU design

Your chance to introduce yourself and your vehicle
tmbryhn
Posts: 170
Joined: Wed Feb 12, 2020 2:40 am
Location: Norway

New 4-cyl ECU design

Post by tmbryhn »

I'm contemplating a new 4-cyl ECU design for a business project that involves creating a complete bolt-on EFi conversion kit for old aircooled VW engines. The kits will be marketed and sold through my business. I appreciate the helpful and ever growing RusEFi community, so I'd like to make this design open source and available to anyone who would like to use it for their own work. For the record, I'm a noob when it comes to GitHub, but I assume that's the way to go :)

This thread is thus for the purpose of sharing experiences and ideas along the way, and asking for some guidance to help reaching the goal of making a design that meets the following requirements for a hypothetical use case:

OUTPUTs:
4x Inj (high-Z/saturated only)
4x Ign (passive or "smart" coil control, internal solder selectable)
1x ETB (TLE9201)
4x GPO (low-side, 1x allocated for WBO2 heater)
2x GPO (high-side, 12V)

INPUTs:
1x Integrated WBO2 (I'll implement my own tried and tested circuit)
2x VR/Hall (MAX9926)
4x Analog TEMP: CLT, IAT, Oil-T, Spare
10x Analog VOLT (Digital w. solder config. pullup): PPS1, PPS2, TPS1, TPS2, MAP, BARO, Oil-P, Fuel-P, Batt-V (internal), WBO2 (internal)
1x Software knock (If possible, similar to Proteus, but single channel)
1x USB
1x CAN
1x SD-card (internal)

The MRE is more/less a perfect match (minus the integrated WBO2 controller), but for this design, I'd rather skip the LTE8888 and instead use regular N-FETs w. active clamping similar to what I've done on previous ECU designs. Reason being a combination of components availability, cost and simplicity.

There are a couple of details I need to sort out before I can start on the design though:

In the MRE release firmware, there are settings in TS for disabling the LTE8888 chip;
can the MRE firmware hypothetically run on the STM32F427VGT6 or equivalent/supported LQFP100 packages without the physical presence of the 8888 driver chip?
If this is the case, the only significant feature that's missing is to complete the "software knock" - as far as I can see, all the dialogs etc. seem to be present in TS, but no physical input can be defined as a source for Knock "channel 1" or "channel 2".

If NO, it seems to me that I'd be required to either use another more flexible release version (maybe Frankenso or Frankenstein?), or to compile my own firmware with a key selection of features. What do you guys think?
User avatar
AndreyB
Site Admin
Posts: 14381
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: New 4-cyl ECU design

Post by AndreyB »

I think that you are talking about https://github.com/rusefi/alphax-4chan with on-board not rusEFI WBO

Right now alphax-4chan is being modernized - we are converting it to dual-side assembly, should have some previews within the next week or so.

I would _really_ recommend finding a way to use alphax-4chan as is or maybe a simplified version of alphax-4chan.
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
tmbryhn
Posts: 170
Joined: Wed Feb 12, 2020 2:40 am
Location: Norway

Re: New 4-cyl ECU design

Post by tmbryhn »

Thanks for a good starting point. I spent this morning checked out the AlphaX_chan4 schematics.
After compiling a list of which MCU pins are mapped to which function - eg. Inj1 -> PG7, I realize that it will be impossible to run this particular firmware version on a LQFP100 version of the MCU, given that the LQFP100 chips lack the PF and PG ports found on the LQFP144 versions.

Because of board space limitations, cost, and the fact that my design simply don't require that much I/O, I'd really like to implement a chip similar to what's used on the MRE.

Is the Hellen One design program applicable for 100-pins packages, or does it only cover the 144-pins alternatives?

Ideally, it would be great to create a FW package that will be continuously and automatically updated as RusEFi is developed, that also includes direct references to the ECU connector pin# nomenclature like the lists found eg. in the MRE.ini and AlphaX.ini

What options would you suggest?
User avatar
AndreyB
Site Admin
Posts: 14381
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: New 4-cyl ECU design

Post by AndreyB »

At the moment we do not have a modern 100-pins reference design.

If you create custom board I am happy to merge your pull request for custom firmware similar to other boards at https://github.com/rusefi/rusefi/tree/master/firmware/config/boards

Anything is possible with a budget see https://github.com/rusefi/rusefi/wiki/Standalone-on-Demand
image.png
image.png (20.73 KiB) Viewed 24193 times
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
tmbryhn
Posts: 170
Joined: Wed Feb 12, 2020 2:40 am
Location: Norway

Re: New 4-cyl ECU design

Post by tmbryhn »

Thanks for the feedback. That sounds good!

I spent the morning making a chart for the different MCU package alternatives, and inserted some generic MicroRusEFi pin-definitions to get started on some sort of a template. See attached PDF:
MCU chart.pdf
(179.21 KiB) Downloaded 239 times
I also downloaded and navigated through the f407-discovery.ini TS configuration file, as this seem to be one of the more generic options out there with respect to pin mappings etc. This FW version seem to includes all pins/ports from A-I for digital I/O, and all analog Inputs on ports A-C, thus covering all MCUs up to and including the LQF176 alternative. This also seems to check out with the STM32F40xxx datasheet.

Q1: To get started on a new board design that can actually be used in a practical implementation; is it possible to design a board for eg. the smaller LQFP100 or LQFP64 MCU, download the f407-discovery firmware release as referenced above, upload to MCU and simply define all the I/Os in TS (obviously within the boundaries of the MCU in question) without any obvious issues? Or will this approach require a custom firmware compilation for the final MCU of choice?

Q2: One of the initial requirements was to have a single on-board Software Knock channel. I seem to recall from the Proteus thread that the DSP routine requires a relatively high sample rate, and as a result dedicates the ADC3 module exclusively for this purpose, leaving the ADC1 and ADC2 for all remaining sensor inputs. The smaller 100-pins and 64-pins MCU alternatives within the same F40xxx series don't have the ADC3 module according to the datasheet. Should I regard this option to be off the table for this low-cost ECU design, or do some of you SW gurus have some ideas for a workaround?
Given if my above recollection is true, I realize that this implementation will require a customized firmware release unless I opt for the 144/176 MCU option. The question is if there's any point to design the board with the analog knock filter circuit included for potential future firmware implementation, or not?


EDIT: The smaller LQFP64 and LQFP100 packages also has the ADC3 module, which should allow for Software Knock DSP :)
Last edited by tmbryhn on Sat Mar 18, 2023 8:51 am, edited 1 time in total.
mck1117
running engine in first post
running engine in first post
Posts: 1495
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: New 4-cyl ECU design

Post by mck1117 »

The smaller chips have ADC3, but it overlaps some pins used by ADC1/2. They’re missing port F, so they only have the channels that overlap ADC1/2 channels (the bigger chips have those overlapped pins too, but also some more on port F). No reason knock sense won’t work on one of those channels.
tmbryhn
Posts: 170
Joined: Wed Feb 12, 2020 2:40 am
Location: Norway

Re: New 4-cyl ECU design

Post by tmbryhn »

Thanks ;)
I see the "ADC123" now *face-to-the-palm* :oops:
tmbryhn
Posts: 170
Joined: Wed Feb 12, 2020 2:40 am
Location: Norway

Re: New 4-cyl ECU design

Post by tmbryhn »

The two flash chips in the MRU design "W25Q128JVSIQ" and "IS25LP256D-xM":
What's the purpose of these flash chips?
Why are there two of them?
Do they store any mission critical data for regular users?
Should such chips be implemented in a new ECU design?

Regarding the 32.768 kHz "Y2" in the MRU design:
What's the purpose of this additional oscillator?
tmbryhn
Posts: 170
Joined: Wed Feb 12, 2020 2:40 am
Location: Norway

Re: New 4-cyl ECU design

Post by tmbryhn »

Until further notice, I'm going by the assumption that I can use the F407-discovery release FW to get going with a generic design.
Feedback is much appreciated :)

Preliminary schematics. If I can omit the external flash chips used in the MRE design, it seems that I can get away with the LQFP64 package and still have a good bunch of I/Os.
Sch preliminary.PDF
(361.33 KiB) Downloaded 248 times
MCU chart_LQFP64.pdf
(182.7 KiB) Downloaded 234 times
jc10000rpm
Posts: 4
Joined: Tue Jan 24, 2023 10:37 am

Re: New 4-cyl ECU design

Post by jc10000rpm »

Just curious, why would you use CLT input, on air cooled project ??
mck1117
running engine in first post
running engine in first post
Posts: 1495
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: New 4-cyl ECU design

Post by mck1117 »

jc10000rpm wrote:
Sun Mar 19, 2023 10:45 am
Just curious, why would you use CLT input, on air cooled project ??
As far as the ECU is concerned, CLT is just a proxy for CHT. It's used to estimate air density at the valve, since the intake/head are hot and transfer some heat to the air as it passes by, particularly at low flow (idle/low throttle/etc).
tmbryhn
Posts: 170
Joined: Wed Feb 12, 2020 2:40 am
Location: Norway

Re: New 4-cyl ECU design

Post by tmbryhn »

"CLT" is regarded as standardised aftermarket EMS terminology; for all aircooled builds I use a CHT sensor as the dedicated engine temp input.
This ECU will most likely be used on multiple platforms, including aircooled engines.

Spent the day tidying up the schematics a bit, and started routing the board.

Still waiting for final confirmation on above mentioned case regarding using generic firmware on F407xxxx LQFP64 MCU. Would love to have some peace of mind on that particular issue before I get in too deep 😅🤞🏼
Last edited by tmbryhn on Sun Mar 19, 2023 8:02 pm, edited 2 times in total.
mck1117
running engine in first post
running engine in first post
Posts: 1495
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: New 4-cyl ECU design

Post by mck1117 »

tmbryhn wrote:
Sun Mar 19, 2023 8:00 pm
Still waiting for final confirmation on above mentioned case regarding using generic firmware on F407xxxx LQFP64 MCU. Would love to have some peace of mind on that particular issue before I get in too deep 😅🤞🏼
The generic firmware will work fine.

It really is worth adding your own configuration for this board though, if nothing else it will get you correct out-of-the-box defaults and such.
tmbryhn
Posts: 170
Joined: Wed Feb 12, 2020 2:40 am
Location: Norway

Re: New 4-cyl ECU design

Post by tmbryhn »

Cool! Thanks for the feedback.
I'd love to make a specific board config for a more clean and comprehensive Tuner Studo experience with regards to I/O nomenclature and sofort, as well as the fact that I need to get the single knock circuit mapped to a dedicated ADC3 pin. All in good time I guess.

At least now I know that I can start testing the board once it's ready 🤓👍🏼
User avatar
AndreyB
Site Admin
Posts: 14381
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: New 4-cyl ECU design

Post by AndreyB »

tmbryhn wrote:
Sun Mar 19, 2023 8:00 pm
F407xxxx LQFP64 MCU.
Please spell out exact part number you plan to use. Should have 1mb of flash, are those easily available today?
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
tmbryhn
Posts: 170
Joined: Wed Feb 12, 2020 2:40 am
Location: Norway

Re: New 4-cyl ECU design

Post by tmbryhn »

AndreyB wrote:
Sun Mar 19, 2023 8:27 pm
tmbryhn wrote:
Sun Mar 19, 2023 8:00 pm
F407xxxx LQFP64 MCU.
Please spell out exact part number you plan to use. Should have 1mb of flash, are those easily available today?
Based on this:
STM_ordering info.jpg
STM_ordering info.jpg (83.44 KiB) Viewed 23940 times
I get the following alternatives w. 1Mb flash in the 405/407 series (LQFP64 does not exist in the 407 series):

LQFP64:
STM32F405RGT6
STM32F405RGT7

LQFP100:
STM32F405VGT6
STM32F407VGT6
STM32F405VGT7
STM32F407VGT7

None of them are currently in stock at Mouser, but luckily we have a thriving Chinese chip market that can supply parts of varying quality...
Multiple of these part numbers are currently available through the likes of AliExpress.

On another note; I'm open to other STM32Fxxx series that can be delivered in LQFP64 package, that meet he 1Mb flash requirement, and that also has native RusEFi support without firmware tinkering.
tmbryhn
Posts: 170
Joined: Wed Feb 12, 2020 2:40 am
Location: Norway

Re: New 4-cyl ECU design

Post by tmbryhn »

Just ordered a couple of STM32F405RGT6 from two different sources on Aliexpress. Let's hope they're of decent quality.

I've attached the schematic. Input is much appreciated :) Unless I should make any adjustments to the schematic, the Gerbers are ready to be sent to JLC.
TMB_TMB_mini_48_RusEFi_rev_a.PDF
(1.15 MiB) Downloaded 246 times
User avatar
AndreyB
Site Admin
Posts: 14381
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: New 4-cyl ECU design

Post by AndreyB »

Something is so odd here. Why are you sourcing parts manually? JLC has assembly service and they have STM32F405RGT6 in stock.
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
tmbryhn
Posts: 170
Joined: Wed Feb 12, 2020 2:40 am
Location: Norway

Re: New 4-cyl ECU design

Post by tmbryhn »

I assemble all my PCBs in-house.
User avatar
MHTSOS
Posts: 74
Joined: Sun Jun 02, 2019 6:46 pm
Github Username: MHTSOSVOODOO
Slack: Dimitri C

Re: New 4-cyl ECU design

Post by MHTSOS »

I took a quick look at the schematics.
I have three remarks.
1. You should add capacitors at the crystal oscillator.
2. I would avoid using a MAX9926 as a VR conditioner since it has trouble working with trigger wheels that have low teeth count.
3. The use of simple mosfets as low side drivers is for cost reduction? It's highly advised to use smart low side drivers that have overtemperature and overcurrent protection among other features. There are parts that are quite cheap if you are not looking for insane current capabilities.

Στάλθηκε από το CLT-L09 μου χρησιμοποιώντας Tapatalk

tmbryhn
Posts: 170
Joined: Wed Feb 12, 2020 2:40 am
Location: Norway

Re: New 4-cyl ECU design

Post by tmbryhn »

Thanks for the great feedback, man! :)

1: The crystal I use in my designs has caps integrated.

2: It's a good input. I've become quite used to the convenience and robustness of the 9926 over the years on my other ECU designs.
However, single tooth cam triggers w. VR has shown to be a bit problematic below 1200-1100 rpm as of late. I can only assume it's the "85ms watch dog" kicking in, changing the adaptive trigger level threshold to, what is it, 20mVPP or something thereabout?
I'm in the process of coming up with some propositions to comprehensive software workarounds regarding that particular issue. Or one could always go with hall-effect on such cam triggers.
I guess I could also study the MRE trigger circuit and see if I can gather some inspiration there? Isn't it more software controlled?

3: Do you have a list of some parts I could check out? I'm aware of the ones used with MRE and Proteus.
User avatar
MHTSOS
Posts: 74
Joined: Sun Jun 02, 2019 6:46 pm
Github Username: MHTSOSVOODOO
Slack: Dimitri C

Re: New 4-cyl ECU design

Post by MHTSOS »

Yes, the main problem with MAX9926 is the 85ms watchdog. You could disable adaptive trigger but then what's the point in using this part? Its sole purpose is to provide noise immunity and you lose that by disabling it. MRE is using the VR conditioner integrated inside TLE8888 that doesn't have a watchdog.
You could copy this board https://github.com/mck1117/vr-interface and integrate it in your ECU. It's used on many of the latest rusEFI ECUs and it works great. Adaptive triggering is controlled by software.
As for cheap low side drivers check the BSP78 from infineon. It's only 3A but it's fine for most loads. For higher current you have to put something like VND14NV04 or one of the drivers used in MRE and Proteus.

Στάλθηκε από το CLT-L09 μου χρησιμοποιώντας Tapatalk

tmbryhn
Posts: 170
Joined: Wed Feb 12, 2020 2:40 am
Location: Norway

Re: New 4-cyl ECU design

Post by tmbryhn »

Got the first prototype assembled, loaded latest release of Discovery_F407 FW and hooked up my stim.
Almost everything is working as intended :D

Only snag I've come across so far is the choice of 5V reg - I managed to get one that's only rated for 100mA, so the voltage drops to around 4,8V once the package has warmed up :lol: I managed to solder a TO220 7805 into the board to get stable 5V for the time being until I can re-spin rev.B.
I also managed to forget to implement the FP logic signal to the MCU that mananges the WBO2 conditioning, so the heater control logic doesn't cut out when the engine is considered off. Nothing that holds me back from further testing though.

I'm experimenting a bit with the SD logging functions while I have the ECU on the bench connected to the stimulator.
It seems that the regular SD log is missing a lot of variables, including everything trigger related. I assume the dedicated logging profile is limited for the intention of saving space and also writing to the SD card with limited band width?
If that's the case; would a similar approach be possible to implement as an option when using the UART port for eg. Bluetooth communication to increase the refresh rate above the current typical 5Hz one would get with a regular HC-05 module?

I've also tried the dedicated "trigger" function for logging, running a couple of RPM sweeps before turning off the ECU and connecting the USB cable again. Although the log is written to the SD card as a ".teeth" file, the file itself is of 0 kb size. What gives?
User avatar
AndreyB
Site Admin
Posts: 14381
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: New 4-cyl ECU design

Post by AndreyB »

Some assumptions here are not exactly right. With so many unrelated things on the same thread I am very confused what to respond to :(
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
tmbryhn
Posts: 170
Joined: Wed Feb 12, 2020 2:40 am
Location: Norway

Re: New 4-cyl ECU design

Post by tmbryhn »

AndreyB wrote:
Mon Jul 03, 2023 1:01 pm
Some assumptions here are not exactly right. With so many unrelated things on the same thread I am very confused what to respond to :(
If you feel like spending the time, I would appreciate if you would clarify what assumptions are incorrect, and shed some light on the related logging topics mentioned above - I still have a lot to learn about RusEFi, and when I can't find information regarding eg. the dedicated trigger logger mode elsewhere on the forum, it'd be nice to have some input on how it works as it seems to me that it could be a useful feature during troubleshooting.
User avatar
AndreyB
Site Admin
Posts: 14381
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: New 4-cyl ECU design

Post by AndreyB »

https://iocdf.org/wp-content/uploads/2014/10/OCPD-Fact-Sheet.pdf has some insight on why it's so uncomfortable for me to discuss logging implementation on the "New 4-cyl ECU design" topic.

TL,DR: many limitations are consequences of software engineering resource. We just do not have software developers to have a better firmware.
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
tmbryhn
Posts: 170
Joined: Wed Feb 12, 2020 2:40 am
Location: Norway

Re: New 4-cyl ECU design

Post by tmbryhn »

That's understandable - I can somewhat relate to your OCD. I'll stick around and see if some other forum posts will emerge that covers logging specifically. Maybe there's some info on the discord too.

Anyway. I'm already working on getting RevB ready for the board house.

Once the hardware is ready, confirmed working and documented through schematics; is it possible to generate a specific FW build basically based on the Discovery_F407 release, but with specific references to the pin names that corresponds with the schematics?
I'm thinking similar idea to eg. Proteus build.
User avatar
AndreyB
Site Admin
Posts: 14381
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: New 4-cyl ECU design

Post by AndreyB »

https://en.wikipedia.org/wiki/Moon_landing proves that a LOT is possible with proper resource allocation. I would not be available to volunteer with custom board management.
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
tmbryhn
Posts: 170
Joined: Wed Feb 12, 2020 2:40 am
Location: Norway

Re: New 4-cyl ECU design

Post by tmbryhn »

mck1117 wrote:
Sun Mar 19, 2023 8:01 pm
The generic firmware will work fine.

It really is worth adding your own configuration for this board though, if nothing else it will get you correct out-of-the-box defaults and such.
Once rev.B is tested and confirmed with respect to final MCU pinout and schematics naming/labeling etc, I'd like to arrange for a specific configuration bundle_build similar to eg. Proteus and alphax-4chan to be made for this board.
I don't know how the community normally would go about this with respect to having custom builds made and uploaded to the online database, but I'd like to be advised what kind of approach I should take in order to make this happen; payment options, Feature Bounty Program or similar.

Thanks for the help.
User avatar
AndreyB
Site Admin
Posts: 14381
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: New 4-cyl ECU design

Post by AndreyB »

You would have to put a bounty on that I guess? No idea if bountysource website would help or not. There is also https://rusefi.com/forum/viewtopic.php?f=5&t=1642
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