Sprut - A newbies try to design an ECU

Hardware inside and outside of the ECU
InternetAthiest
Posts: 16
Joined: Thu Sep 26, 2019 9:59 pm
Soldering skill: yes
Coding skill?: yes

Sprut - A newbies try to design an ECU

Post by InternetAthiest » Thu Sep 26, 2019 11:09 pm

Hello! I'm a 19 year old student from Sweden that is trying to design an ECU.

This is my first attempt at a "large" scale electronics project as I've only done small and specific circuits previously. The goal with this project is to create a fully functioning ECU and to learn more about electronics along the way. It's currently being designed in KiCad and the plan is to release the source files once I've built a running sample. I'd like for it to run RusEFI but the challenge of creating my own firmware for it does sound interesting. As it's my first big project I've used the schematics from other open source projects as inspiration on how other have solved certain problems, especially the many RusEFI hardware projects but also Speeduino.

The ECU (named 'Sprut') is based on the STM3F070CBT which was choosen by a simple calculation of how many GPIO pins where needed to run a fully sequential 4 cylinder engine with a ton of sensors. Turns out that I later during design was able to make space for a 5:th cylinder.

For now the feature list is the following:
  • Fully Sequential Control of a 5 Cylinder Enigne
  • Built-in circuitry for knock sensor
  • Ethanol sensor
  • Wideband (From external controller)
  • CVVT for intake and exhaust cam's
  • Boost control
  • Function switch (Switch maps, increase boost pressure or maybe launch control)
I'd like to hear every single bit of feedback and help that I can get on the project!

UPDATED 2019-10-09
Schematic:
SprutSchematic.pdf
(324.58 KiB) Downloaded 18 times
NOTE: Some notes in the schematic might be in Swedish

Whole KiCad project:
Sprut.zip
(1.56 MiB) Downloaded 2 times
Last edited by InternetAthiest on Tue Oct 08, 2019 10:41 pm, edited 4 times in total.

User avatar
russian
Site Admin
Posts: 9673
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: Sprut - A newbies try to design an ECU

Post by russian » Thu Sep 26, 2019 11:28 pm

Here we have too much HW and too little SW :( If you really need a challenge, how about implementing something really smart for rusEfi? Like spark self-tune or smth :)
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

InternetAthiest
Posts: 16
Joined: Thu Sep 26, 2019 9:59 pm
Soldering skill: yes
Coding skill?: yes

Re: Sprut - A newbies try to design an ECU

Post by InternetAthiest » Fri Sep 27, 2019 12:08 am

I'd be more than happy to contribute SW features but I'll still need something to test the code on ;). I saw that Launch control was on the list of todo, might try to implement that as a first attempt to contribution.

User avatar
kb1gtt
contributor
contributor
Posts: 3469
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: Sprut - A newbies try to design an ECU

Post by kb1gtt » Sat Sep 28, 2019 8:09 am

Could we stear you to contribute to features which we currently have problems with? Frankenso has issues with the knock circuit. Also there are issues with displaying stuff on the dash guages. I dream of the below.
https://rusefi.com//forum/viewtopic.php?f=4&t=775
Welcome to the friendlier side of internet crazy :)

960
contributor
contributor
Posts: 299
Joined: Mon Dec 10, 2018 1:22 am
Soldering skill: yes
Coding skill?: yes

Re: Sprut - A newbies try to design an ECU

Post by 960 » Wed Oct 02, 2019 4:26 pm

Sprut?

Hvorfor ikke DataSprut?

JRD McLAREN
contributor
contributor
Posts: 136
Joined: Mon Mar 04, 2019 10:19 pm
Soldering skill: yes
Coding skill?: yes
Contact:

Re: Sprut - A newbies try to design an ECU

Post by JRD McLAREN » Thu Oct 03, 2019 6:18 am

russian wrote:
Thu Sep 26, 2019 11:28 pm
...how about implementing something really smart for rusEfi? Like spark self-tune or smth :)
What kind of detonation detection method you can use ..??
KNOCK Sensor ..?
Ion Sense ... ??

or angular acceleration computing for the best torque ..??

InternetAthiest
Posts: 16
Joined: Thu Sep 26, 2019 9:59 pm
Soldering skill: yes
Coding skill?: yes

Re: Sprut - A newbies try to design an ECU

Post by InternetAthiest » Thu Oct 03, 2019 12:35 pm

Finally done with the schematic for rev 1 of Sprut! :D

It took some time but finally I've selected all components and is currently creating all missing footprints. During some browsing on digikey I found the JAE MX34 series which are automotive style connectors which seem nice and are cheap, like really cheap. During this weekend I'll probably try to start and finish the PCB design of Sprut. The goal is to have the PCB finished before 10th of October inorder to sent it to a manufacturer.


kb1gtt wrote:
Sat Sep 28, 2019 8:09 am
Could we stear you to contribute to features which we currently have problems with? Frankenso has issues with the knock circuit.
Per your request I've made the knock circuitry on Sprut, which is almost the same setup as the Frankenso, more accessible for testing and experimenting with. As I do not own a RusEFI myself yet (I've built two for a friend of mine) I'll have to wait until I'm finished designing the PCB for Sprut.

960 wrote:
Wed Oct 02, 2019 4:26 pm
Sprut?

Hvorfor ikke DataSprut?
På svenska säger vi oftast endast 'Sprut' när vi menar eftermarknads styrsystem, men DataSprut funkar det med!

In English so the rest understands:
In Swedish we often just use the word Sprut (means spray) when talking about aftermarket ecu instead of DataSprut/Styrsystem which often means factory ecu. But DataSprut works just as good for a name.

JRD McLAREN wrote:
Thu Oct 03, 2019 6:18 am
What kind of detonation detection method you can use ..??
KNOCK Sensor ..?
Ion Sense ... ??

or angular acceleration computing for the best torque ..??
I don't know if that question was for me, but currently it supports 2 knock sensors for detonation detection, just like the Frankenso.

User avatar
russian
Site Admin
Posts: 9673
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: Sprut - A newbies try to design an ECU

Post by russian » Thu Oct 03, 2019 12:42 pm

InternetAthiest wrote:
Thu Oct 03, 2019 12:35 pm

I don't know if that question was for me, but currently it supports 2 knock sensors for detonation detection, just like the Frankenso.
Just like Frankenso, it has HARDWARE for knock but no SOFTWARE to detect or respond to knock.

We have a problem here that... people enjoy creating boards while not much firmware progress is made :(
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

InternetAthiest
Posts: 16
Joined: Thu Sep 26, 2019 9:59 pm
Soldering skill: yes
Coding skill?: yes

Re: Sprut - A newbies try to design an ECU

Post by InternetAthiest » Thu Oct 03, 2019 12:49 pm

russian wrote:
Thu Oct 03, 2019 12:42 pm
Just like Frankenso, it has HARDWARE for knock but no SOFTWARE to detect or respond to knock.

We have a problem here that... people enjoy creating boards while not much firmware progress is made :(
Thanks for elaborating, was a bit lost. I'll take a crack at it when I've got something to test it with. :)

JRD McLAREN
contributor
contributor
Posts: 136
Joined: Mon Mar 04, 2019 10:19 pm
Soldering skill: yes
Coding skill?: yes
Contact:

Re: Sprut - A newbies try to design an ECU

Post by JRD McLAREN » Thu Oct 03, 2019 6:01 pm

InternetAthiest wrote:
Thu Oct 03, 2019 12:35 pm
JRD McLAREN wrote:
Thu Oct 03, 2019 6:18 am
What kind of detonation detection method you can use ..??
KNOCK Sensor ..?
Ion Sense ... ??

or angular acceleration computing for the best torque ..??
I don't know if that question was for me, but currently it supports 2 knock sensors for detonation detection, just like the Frankenso.
This question is for all developers.

There are many ways to detect KNOCK.
...and the "acoustic" Knock sensor is the worst one ..

JRD McLAREN
contributor
contributor
Posts: 136
Joined: Mon Mar 04, 2019 10:19 pm
Soldering skill: yes
Coding skill?: yes
Contact:

Re: Sprut - A newbies try to design an ECU

Post by JRD McLAREN » Thu Oct 03, 2019 6:07 pm

The best way to do "the self learning ignition table" is measuring "in cylinder" pressure.
(we need to do measure and recognize unneeded spikes during "fire cycle")

Other ways are angular acceleration measurement and/or Ion-Sense.

JRD McLAREN
contributor
contributor
Posts: 136
Joined: Mon Mar 04, 2019 10:19 pm
Soldering skill: yes
Coding skill?: yes
Contact:

Re: Sprut - A newbies try to design an ECU

Post by JRD McLAREN » Thu Oct 03, 2019 6:17 pm

russian wrote:
Thu Oct 03, 2019 12:42 pm
.....Just like Frankenso, it has HARDWARE for knock but no SOFTWARE to detect or respond to knock.

We have a problem here that... people enjoy creating boards while not much firmware progress is made :(
VEMS have the same TPIC8101DW chip, but it can't 100% work for some engine.
(it can't work for me and my engine, never. SW and HW issues)

Knock frequency can be calculated, by this formula:
Knock frequency (kHz) = 900/(Pi * d * 0.5) where d = the bore in millimeters
(my engine has 86 or 87mm bore)

..but reality is different ...
Attachments
knock_CR11_8.jpg
knock_CR11_8.jpg (252.72 KiB) Viewed 281 times

puff
contributor
contributor
Posts: 2733
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: Sprut - A newbies try to design an ECU

Post by puff » Thu Oct 03, 2019 8:23 pm

you mean, expected freqency is 6.66kHz?
what's on that screenshot? how did you get that image? what are those red regions at 2kHz and at 15kHz?
probably, there is some noise from tappets and something else? How can you be sure that you indeed had knock events?

JRD McLAREN
contributor
contributor
Posts: 136
Joined: Mon Mar 04, 2019 10:19 pm
Soldering skill: yes
Coding skill?: yes
Contact:

Re: Sprut - A newbies try to design an ECU

Post by JRD McLAREN » Thu Oct 03, 2019 8:46 pm

...cause ...
It is knock noise - detonation

On screen is FFT analyze ..
"first half" is normal slow engine rev. form idle to redline..
"second half" is the same, but ignition is advanced (+10deg) .. and detonation occur..
..
this is the one of method to "detect" detonation....

and it is the "basic understanding" to know, what is detonation, how it can be detect and analyze ... :arrow:

puff
contributor
contributor
Posts: 2733
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: Sprut - A newbies try to design an ECU

Post by puff » Thu Oct 03, 2019 9:07 pm

still, what is the esssence of "FFT analyze"?
looks like as if it highlights the frequencies with higher amplitude? (more distinct?)

couple of concerncs:
- you forget about 'knock windows'
- are you sure about the accuracy of your measuring equipment/software?

and once again, there are other sources of noise in the engine. i've read, that knock sensors are inefficient in old-style engines without hydraulic tappets just because of that reason: valves produce too much noise.

JRD McLAREN
contributor
contributor
Posts: 136
Joined: Mon Mar 04, 2019 10:19 pm
Soldering skill: yes
Coding skill?: yes
Contact:

Re: Sprut - A newbies try to design an ECU

Post by JRD McLAREN » Thu Oct 03, 2019 9:37 pm

puff wrote:
Thu Oct 03, 2019 9:07 pm
couple of concerncs:
- you forget about 'knock windows'
no "windows" is needed
- are you sure about the accuracy of your measuring equipment/software?
my "measuring equipment" can be my ears .. (or eyes)
...and "software" is my stupid brain ...
there are other sources of noise in the engine.
- YES
i've read, that knock sensors are inefficient in old-style engines without hydraulic tappets just because of that reason: valves produce too much noise.
- NO

...try to think little bit more ...

User avatar
russian
Site Admin
Posts: 9673
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: Sprut - A newbies try to design an ECU

Post by russian » Fri Oct 04, 2019 2:32 am

good content in the wrong thread is bad content.

whatever is said here on the wrong thread is wasted information.
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

JRD McLAREN
contributor
contributor
Posts: 136
Joined: Mon Mar 04, 2019 10:19 pm
Soldering skill: yes
Coding skill?: yes
Contact:

Re: Sprut - A newbies try to design an ECU

Post by JRD McLAREN » Fri Oct 04, 2019 6:23 am

So, just cut it ... and paste it to another one ..
( - - here - -)

somethink like "All about Knock detection" in MISC section ... :roll:

InternetAthiest
Posts: 16
Joined: Thu Sep 26, 2019 9:59 pm
Soldering skill: yes
Coding skill?: yes

Re: Sprut - A newbies try to design an ECU

Post by InternetAthiest » Mon Oct 07, 2019 3:31 pm

Yay Sprut routing is complete! :D

The PCB is a 100x100mm 2 layer board with the aim of making it possible for a hobbyist to make it at home. PCB is now fully routed and almost ready for manufacturing. The only thing left that I need to sort out is the silkscreen and possibly add text if needed for help or other stuff.

It was a tedious process routing it but now it's finished. I reflected upon the difficulty with routing and came to the conclusion that I had chosen parts with bigger footprints then necessary (For example: the injector mosfets which are DPAK), this made routing more difficult as space on the PCB was running out.

Any suggestion before I send the gerbers for manufacturing?

TOP SIDE
SprutPCBTopSide.PNG
SprutPCBTopSide.PNG (144.31 KiB) Viewed 205 times
BOTTOM SIDE
SprutPCBBottomSide.PNG
SprutPCBBottomSide.PNG (110.25 KiB) Viewed 205 times
EDIT: Saw problem with R57 just after posting which I now have fixed.

User avatar
russian
Site Admin
Posts: 9673
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: Sprut - A newbies try to design an ECU

Post by russian » Mon Oct 07, 2019 5:35 pm

What are the pros and cons against viewtopic.php?f=4&t=1215?

I would also add way more silkscreen at least on the connector pinout.

How many power LEDs? How many firmware status LEDs?

Do you have reset button? Do you have SWD header? Do you have boot0 button if you have USB connector?
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
russian
Site Admin
Posts: 9673
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: Sprut - A newbies try to design an ECU

Post by russian » Mon Oct 07, 2019 5:36 pm

PS: do not see USB connector, how do you communicate with this board?
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

DonaldBecker
Posts: 16
Joined: Mon Aug 19, 2019 10:40 pm
Location: Los Gatos CA USA
Soldering skill: yes
Coding skill?: yes

Re: Sprut - A newbies try to design an ECU

Post by DonaldBecker » Mon Oct 07, 2019 5:50 pm

A few questions:

What injector drivers are you planning on using?
Why do you have freewheeling diodes?

Generally you don't want freewheeling diodes or snubbing circuits. They delay the injector closing by allowing the current to decay, and that delay introduces fueling inconsistency. Instead you want specialized drivers that have clamps -- they allow the low side voltage to spike to +40V-70V, then turn on the transistor just slightly to hold it there until the energy dissipates. That snaps the injector shut cleanly.

Plus drivers with clamping circuits better protect the MOSFET from over-voltage with a disconnected V+ rail and also usually include other protection e.g. over-current and thermal. The protection circuit often signals the fault by pulling the gate input low, so you need the proper gate resistor. But in exchange you generally don't need a pull-down resistor, as the gate doesn't "float" half-open.

Clamping rather than freewheeling diodes has become the preferred way to drive most relays and other magnetic actuators as well.

Your "launch switch" input should have a high value resistor in series, and probably a diode in series. Imagine what will happen when 12V is applied. The diode clamp will vanish in milliseconds.

26pf seems a little high for the 8MHz crystal. Generally 12-20pf is appropriate for a regular crystal on a 2 layer board.

Why did you select those specific gate drivers for the ignition? Local availability?
They already have pull-downs, and the series resistors are pointless.
Increase the physical size of the output resistors. Calculate their power burn when shorted to ground or +14V. If you know the coils you will be using, you are better off using a specific circuit (e.g. a PNP+diode) rather than gate drivers.

Do you mean to specify a MAX9924 rather than the MAX9925? The '25 doesn't have the gain resistors on the opamp, expecting them to be provided externally.
You might consider switching to the lower cost dual-channel 9926, and configure the second channel with a different input structure. It's easier to change the config to use the second channel than change SMD resistors on the road.
You can omit the 10K pull-up on the output if you configure the input pin with internal pull-up.
Last edited by DonaldBecker on Tue Oct 08, 2019 12:57 pm, edited 1 time in total.

InternetAthiest
Posts: 16
Joined: Thu Sep 26, 2019 9:59 pm
Soldering skill: yes
Coding skill?: yes

Re: Sprut - A newbies try to design an ECU

Post by InternetAthiest » Mon Oct 07, 2019 6:33 pm

russian wrote:
Mon Oct 07, 2019 5:35 pm
What are the pros and cons against viewtopic.php?f=4&t=1215?
I see Sprut as a fun project for learning both electronics and efi. It is not meant to be a "be all, do all". Essentially Sprut is designed to be running a Volvo T5 engine which muddies the waters a bit when comparing them side by side.

The "pros" of Sprut
  • 2 layer PCB -> Can make at home.
  • Can operate up to a 6 cylinder engine with various features or a 5 cyl with CVVT on both cams and boost pressure control
  • "Easy" parts to get in Sweden
The Prometheus is better in alot of ways but they're suited for different engines and tasks. But if you would list the big cons of Sprut then they are:
  • Larger size, but only just. I could probably make Sprut the same size as Prometheus with some more time routing it.
  • Does not have integrated coil drivers / "smart" drivers nor high impedance injector drivers. I didn't need to have it as the T5 use COP and low impedance injectors.
  • Does not support stepper motor IACs, only supports 2-3 pin PWM IACs.
  • Does not have O2 circuitry, only allows for external input
  • Does not have CANbus
  • Does not have extra features such as microSD or bluetooth. (But is really the bluetooth a feature?)
I would guess that Sprut is cheaper to build but I have not compared the two BOMs
russian wrote:
Mon Oct 07, 2019 5:35 pm
I would also add way more silkscreen at least on the connector pinout.
I was thinking of doing that, maybe also some warning text that this is a DIY efi system -> not on roads? :)
russian wrote:
Mon Oct 07, 2019 5:35 pm
How many power LEDs? How many firmware status LEDs?

Do you have reset button? Do you have SWD header? Do you have boot0 button if you have USB connector?
There are currently no LEDs at all. I'm currently using 100% of the pins available on a STM32F070CBT, which is a 48 pin package. I might add a power led or maybe a USB status led.

The STM32F070CBT comes from factory with the capability of flashing firmware via USB without changing the bootloader. This means that I do not need a SWD header. I do have reset and boot0 button, they are located next to the right edge at about center height. I was just too lazy to model them as KiCad didn't have them.
russian wrote:
Mon Oct 07, 2019 5:36 pm
PS: do not see USB connector, how do you communicate with this board?
The SMD pad arangement in the top right corner on the top side is a smd usb type b connector. I was too lazy to model it and KiCad didn't have a type b smd connector

puff
contributor
contributor
Posts: 2733
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: Sprut - A newbies try to design an ECU

Post by puff » Mon Oct 07, 2019 6:44 pm

What about the firmware? I doubt that rusefi will run on your microcontroller of choice.
I wonder, how difficult it is to reroute the board for a different connector?

User avatar
russian
Site Admin
Posts: 9673
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: Sprut - A newbies try to design an ECU

Post by russian » Mon Oct 07, 2019 6:48 pm

InternetAthiest wrote:
Mon Oct 07, 2019 6:33 pm
I'm currently using 100% of the pins available on a STM32F070CBT, which is a 48 pin package.
I assume that would be 100% custom code running this board?

128Kb flash and 16kb RAM would probably make no sense to try to make custom rusEfi code? viewtopic.php?f=4&t=1516 runs with 64Kb but I believe some features had to be disabled.
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

InternetAthiest
Posts: 16
Joined: Thu Sep 26, 2019 9:59 pm
Soldering skill: yes
Coding skill?: yes

Re: Sprut - A newbies try to design an ECU

Post by InternetAthiest » Mon Oct 07, 2019 7:35 pm

Alot of questions, I'll try to answer all of them! :)
DonaldBecker wrote:
Mon Oct 07, 2019 5:50 pm
What injector drivers are you planning on using?
Why do you have freewheeling diodes?
Seems as I forgot to update the nmos specs to the drivers that I was thinking of using :oops:
The freewheeling diodes are just if you're using something that needs them.
DonaldBecker wrote:
Mon Oct 07, 2019 5:50 pm
Generally you don't want freewheeling diodes or snubbing circuits. They delay the injector closing by allowing the current to decay, and that delay introduces fueling inconsistency. Instead you want specialized drivers that have clamps -- they allow the low side voltage to spike to +40V-70V, then turns on the transistor just slightly to hold it there until the energy dissipates. That snaps the injector shut cleanly.

Plus drivers with clamping circuits also usually include other protection e.g. over-current and thermal. These often signal the fault by pulling the gate input low, so you need a larger gate resistor. But in exchange you generally don't need a pull-down resistor, as the gate doesn't "float" half-open.
Hmm, did not know. Thanks for mentioning!
DonaldBecker wrote:
Mon Oct 07, 2019 5:50 pm
Your "launch switch" input should have a high value resistor in series, and probably a diode in series. Imagine what will happen when 12V is applied. The diode clamp will vanish in milliseconds.
The launch switch is meant to pull down 5v via a high value resistor to gnd or supply 5v from sensor supply. Might be a dumb solution.
DonaldBecker wrote:
Mon Oct 07, 2019 5:50 pm
26pf seems a little high for the 8MHz crystal. Generally 12-20pf is appropriate for a regular crystal on a 2 layer board.
I followed ST's technical document on crystal design for the STM32 and this is the result I got.
DonaldBecker wrote:
Mon Oct 07, 2019 5:50 pm
Why did you select those specific gate drivers for the ignition? Local availability?
They already have pull-downs, and the series resistors are pointless.
Increase the physical size of the output resistors. Calculate their power burn when shorted to ground or +14V. If you know the coils you will be using, you are better off using a specific circuit (e.g. a PNP+diode) rather than gate drivers.
I chose the NCP81071B due to availability but thanks for mentioning the internal pull down, must have skipped that part.
I'm using the ESR03EZPJ101 (Digi: RHM100DCT-ND) which have a 1/4W power rating there, I've not updated the schematic in the first post yet.
DonaldBecker wrote:
Mon Oct 07, 2019 5:50 pm
Do you mean to specify a MAX9924 rather than the MAX9925? The '25 doesn't have the gain resistors on the opamp, expecting them to be provided externally.
You might consider switching to the lower cost dual-channel 9926, and configure the second channel with a different input structure. It's easier to change the config to use the second channel than change SMD resistors on the road.
You can omit the 10K pull-up on the output if you configure the input pin with internal pull-up.
Yeah it's a MAX9924 that's supposed to be used and this ecu won't be road driven so changing config isn't something to worry about. Totally forgot about internal pull-up of the STM32.

Thanks for correcting me, I really appreciate the help! ;)
Last edited by InternetAthiest on Mon Oct 07, 2019 8:47 pm, edited 2 times in total.

InternetAthiest
Posts: 16
Joined: Thu Sep 26, 2019 9:59 pm
Soldering skill: yes
Coding skill?: yes

Re: Sprut - A newbies try to design an ECU

Post by InternetAthiest » Mon Oct 07, 2019 8:03 pm

The idea is to run rusEFI on it, even if I have to maintain the firmware just for it specifically. But there are about 10 other STM32 ICs that are pin compatible and have integrated USB and more flash. As long as they are using DFU in the bootloader (See 4.2 AN2606) they should work.

User avatar
russian
Site Admin
Posts: 9673
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: Sprut - A newbies try to design an ECU

Post by russian » Mon Oct 07, 2019 8:31 pm

i believe RAM is your biggest risk. I would strongly recommend looking into rusEfi RAM and flash usage before ordering this PCB.
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

DonaldBecker
Posts: 16
Joined: Mon Aug 19, 2019 10:40 pm
Location: Los Gatos CA USA
Soldering skill: yes
Coding skill?: yes

Re: Sprut - A newbies try to design an ECU

Post by DonaldBecker » Mon Oct 07, 2019 9:37 pm

The "launch control" switch will probably be OK, but add a series input resistor will make it more robust. The STM32 internal pull up is equivalent to 20K-100K (nominally 40K, and typically 30K-50K), so a 4.7K or even 10K series resistor is OK to be under 30%. The old rule of thumb is that you want at least 1mA of "wetting" current through a switch for reliability, but you can ignore that with a switch that "wipes" it contacts.

Double-check that crystal loading cap calculation, remembering that the circuit board alone will have capacitance, often enough to not add capacitors.

mck1117
running engine in first post
running engine in first post
Posts: 241
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish
Soldering skill: yes
Coding skill?: yes

Re: Sprut - A newbies try to design an ECU

Post by mck1117 » Tue Oct 08, 2019 10:16 am

russian wrote:
Mon Oct 07, 2019 8:31 pm
i believe RAM is your biggest risk. I would strongly recommend looking into rusEfi RAM and flash usage before ordering this PCB.

I agree - the F070CB is not enough chip to run rusEfi. There are a few reasons it isn’t enough:
  • It has no FPU. Since the firmware relies heavily on floating point math, performance will be very very bad. Emulating float ops on an integer only CPU is slower by a factor of up to 200.
  • Only 128K of flash. The configuration alone is currently 20KB, and the firmware image (code) is currently around 300KB. This will grow by perhaps 20% on an F0 because the CPU uses a slightly less dense instruction set (and also has to emulate floating point ops in software)
  • RAM: that configuration is loaded in to ram at startup so you can edit the tune in real time while the engine is running. 16KB of RAM isn’t even enough to load the tune. Current ram usage on a default firmware build is around 170KB. This could be reduced somewhat by removing features, but not by over 90%.
While the f070cb could absolutely run an engine, it would require a rewrite of the firmware. I would strongly suggest switching to an f405/407 if you intend to run rusEfi on this board. The f407vg is the best supported today, since it’s the one found on the F4 discovery board that plugs in to Frankenso.

For the smallest/cheapest chip with an FPU, you’d have to go up to an STM32F3.

Post Reply