New 4-cyl ECU design

Your chance to introduce yourself and your vehicle
Post Reply
tmbryhn
Posts: 136
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: 13671
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: 136
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: 13671
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 1320 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: 136
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 20 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: 1452
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: 136
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: 136
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: 136
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 23 times
MCU chart_LQFP64.pdf
(182.7 KiB) Downloaded 20 times
jc10000rpm
Posts: 1
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: 1452
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: 136
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: 1452
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: 136
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: 13671
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: 136
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 1067 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.
Post Reply