Sprut - A newbies try to design an ECU

Hardware inside and outside of the ECU
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:27 am

InternetAthiest wrote:
Mon Oct 07, 2019 6:33 pm

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.
While technically true, one of the huge advantages of the whole STM32 family is that you can attach a debugger, set breakpoints, inspect memory and registers, etc. just like when developing desktop software. However, that all only works over SWD. If you’re planning on developing your own firmware (or a heavily modified rusEfi variant), it would be a godsend to have debugging available.

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 » Tue Oct 08, 2019 4:07 pm

Is there a link to download? Github, etc? Is that KC5? I'm missing many details right now, but others seem to have found things like a schematic.
Welcome to the friendlier side of internet crazy :)

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 » Tue Oct 08, 2019 4:09 pm

Some other comments, validate your footprints before going for MFG of the board. Print it out 100% scale and put your components on the paper. You'll likely resolve several issues before you have PCB costs and lead time issues.

Enclosure? Heatsink? Do you know you can export to OnShape then you could model other things that are not KC related like an enclosure.
Welcome to the friendlier side of internet crazy :)

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 » Tue Oct 08, 2019 10:21 pm

mck1117 wrote:
Tue Oct 08, 2019 10:16 am
I agree - the F070CB is not enough chip to run rusEfi. There are a few reasons it isn’t enough:

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.
mck1117 wrote:
Tue Oct 08, 2019 10:27 am
While technically true, one of the huge advantages of the whole STM32 family is that you can attach a debugger, set breakpoints, inspect memory and registers, etc. just like when developing desktop software. However, that all only works over SWD. If you’re planning on developing your own firmware (or a heavily modified rusEfi variant), it would be a godsend to have debugging available.
I've looked into some other chips. Essentially if I'd want to have a drop in chip with the current pcb design then the STM32F303CC is the one to use. Otherwise the G4 series has a different pin out but has more flash but at that point I'd rather up size to LQFP64.

Now, SWD seems kinda sweet to have but would require the up size. It would also allow me to add status LEDs and CAN without impacting current I/O. Seems worth re-routing for those features/improvments.
kb1gtt wrote:
Tue Oct 08, 2019 4:07 pm
Is there a link to download? Github, etc? Is that KC5? I'm missing many details right now, but others seem to have found things like a schematic.
I'll update the first post right after posting this.
EDIT: Yes I run KC5 5.1.4
kb1gtt wrote:
Tue Oct 08, 2019 4:09 pm
Some other comments, validate your footprints before going for MFG of the board. Print it out 100% scale and put your components on the paper. You'll likely resolve several issues before you have PCB costs and lead time issues.
I'll do a paper printout tomorrow, thanks for telling me this tip. I guess it will probably work well as it is but who knows?
kb1gtt wrote:
Tue Oct 08, 2019 4:07 pm
Enclosure? Heatsink? Do you know you can export to OnShape then you could model other things that are not KC related like an enclosure.
Yup, I'll be modelling an enclosure in Inventor 2020 then 3d print it on a Ender 3.

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 11:38 pm

InternetAthiest wrote:
Tue Oct 08, 2019 10:21 pm
Otherwise the G4 series has a different pin out but has more flash but at that point I'd rather up size to LQFP64.

Now, SWD seems kinda sweet to have but would require the up size. It would also allow me to add status LEDs and CAN without impacting current I/O. Seems worth re-routing for those features/improvments.
It looks like you have some free space near the MCU, so it'd be a pretty easy change to swap up to LQFP64 or LQFP100. Since rusEfi has no restrictions on which pins are in use (at least for outputs), the remap is as simple as figuring out which order the signals are on the board, then connecting them to the next available pin in the same order. The F405 comes in LQFP64, and is already supported well since it's the same as an F407.

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 » Wed Oct 09, 2019 1:22 am

mck1117 wrote:
Tue Oct 08, 2019 11:38 pm
InternetAthiest wrote:
Tue Oct 08, 2019 10:21 pm
Otherwise the G4 series has a different pin out but has more flash but at that point I'd rather up size to LQFP64.

Now, SWD seems kinda sweet to have but would require the up size. It would also allow me to add status LEDs and CAN without impacting current I/O. Seems worth re-routing for those features/improvments.
It looks like you have some free space near the MCU, so it'd be a pretty easy change to swap up to LQFP64 or LQFP100. Since rusEfi has no restrictions on which pins are in use (at least for outputs), the remap is as simple as figuring out which order the signals are on the board, then connecting them to the next available pin in the same order. The F405 comes in LQFP64, and is already supported well since it's the same as an F407.
Yeah, going to re-route it for LQFP64. Thinking of using the STM32F412RET6 instead.

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 » Wed Oct 09, 2019 1:29 am

InternetAthiest wrote:
Wed Oct 09, 2019 1:22 am
Yeah, going to re-route it for LQFP64. Thinking of using the STM32F412RET6 instead.
Any reason for the F412 over the F405/407? The STM32F405RGT6 is only $4 more, and is fully supported by rusEfi out of the box.

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 » Wed Oct 09, 2019 2:14 am

mck1117 wrote:
Wed Oct 09, 2019 1:29 am
InternetAthiest wrote:
Wed Oct 09, 2019 1:22 am
Yeah, going to re-route it for LQFP64. Thinking of using the STM32F412RET6 instead.
Any reason for the F412 over the F405/407? The STM32F405RGT6 is only $4 more, and is fully supported by rusEfi out of the box.
Avalibility, currently only have access to certain a few selection of STM32s which is why I chose the F070 in the first place.
Last edited by InternetAthiest on Wed Oct 09, 2019 2:19 am, edited 2 times in total.

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 » Wed Oct 09, 2019 2:18 am

Does Mouser EU not ship to Sweden? They have a few thousand F405RG in stock.

@960 may have tips for EU sourcing of components.

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 » Wed Oct 09, 2019 2:22 am

mck1117 wrote:
Wed Oct 09, 2019 2:18 am
Does Mouser EU not ship to Sweden? They have a few thousand F405RG in stock.

@960 may have tips for EU sourcing of components.
The problem lies within who I can order from.

Looked up the pin out for the F412 and F405 and seems like that VCAP_1 is moved one pin to the right and they replaced pin 48 VSS (on the F412) with VCAP_2 which is just a cap to gnd. Might make it compatible as it is not that different.

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 » Wed Oct 09, 2019 2:27 am

Just add a 0603 between pin 47 and gnd. On the F412 pin 47 is gnd and on the F405 it's VCAP_2 which connects to gnd
Then add a 0603 for both pin 30 and 31 that connects to gnd. F412 pin 30 is VCAP_1 and pin 31 is gnd. On the F405 pin 30 is pb11 which I can leave floating and pin 31 is VCAP_2. Good solution?

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 » Wed Oct 09, 2019 9:32 am

-- 14V on input 1 would result in to much current dumped to the 5V rail. Causing 5V rail to be more like 10V, so it would break things. You want something more like 10k for R115.
-- Suggest you look at the notes on Franksenso knock about calculating the XTAL caps. That circuit has like a 50% failure to start. Basically 5 out of 10 assembled frankenso's, the TPIC XTAL doesn't start unless you touch the XTAL package or something similar to get it started. I think you want some extra pads, such that you can add or change components if so required.
-- Suggest putting some critical or key math on the sheets. For example, ADC low pass filter calcs, or knock XTAL loading caps calcs.
-- See VR notes found here https://rusefi.com/wiki/index.php?title ... tes.2C_etc I think you want a higher voltage capability. AKA 2X 5k ohm 0805 resistors making 10k ohm.
-- I have some really crappy notes about OVP MOSFET vs fly-back typologies at this link. Freaking SF, seems the wiki is broken. Sorry it really sucks, but perhaps you can extract the key info from it. One key note, is that while OVP is more accurate, it also dumps more heat in the ECU. Fly-back dumps more of that heat into the injectors. https://sourceforge.net/p/daecu/code/HE ... heory.wiki
-- Beware thermal management. Plan to add heat sinks to your heat generating chips.
-- See current loop notes http://www.maximintegrated.com/en/app-n ... vp/id/5450 also other notes found here https://rusefi.com/wiki/index.php?title ... sign_rules Those notes include handy references like the below.
Image
Welcome to the friendlier side of internet crazy :)

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 » Wed Oct 09, 2019 10:41 am

kb1gtt wrote:
Wed Oct 09, 2019 9:32 am
-- 14V on input 1 would result in to much current dumped to the 5V rail. Causing 5V rail to be more like 10V, so it would break things. You want something more like 10k for R115.
Input is only for 5V and those resistors are only there to enable different configurations, much like how frankenso works.
kb1gtt wrote:
Wed Oct 09, 2019 9:32 am
-- Suggest you look at the notes on Franksenso knock about calculating the XTAL caps. That circuit has like a 50% failure to start. Basically 5 out of 10 assembled frankenso's, the TPIC XTAL doesn't start unless you touch the XTAL package or something similar to get it started. I think you want some extra pads, such that you can add or change components if so required.
I used the values supplies in the Renesas HIP9011 datasheet which as far as I can tell is exactly the same chip.
kb1gtt wrote:
Wed Oct 09, 2019 9:32 am
-- Suggest putting some critical or key math on the sheets. For example, ADC low pass filter calcs, or knock XTAL loading caps calcs.
Will do in next update!
kb1gtt wrote:
Wed Oct 09, 2019 9:32 am
-- See VR notes found here https://rusefi.com/wiki/index.php?title ... tes.2C_etc I think you want a higher voltage capability. AKA 2X 5k ohm 0805 resistors making 10k ohm.
I'll upgrade the size to 1206 in that case.
kb1gtt wrote:
Wed Oct 09, 2019 9:32 am
-- I have some really crappy notes about OVP MOSFET vs fly-back typologies at this link. Freaking SF, seems the wiki is broken. Sorry it really sucks, but perhaps you can extract the key info from it. One key note, is that while OVP is more accurate, it also dumps more heat in the ECU. Fly-back dumps more of that heat into the injectors. https://sourceforge.net/p/daecu/code/HE ... heory.wiki
OVP are going to be installed on Sprut, has yet to change in the schematics but most if not all DPAK OVP with logic level will fit and work. Fly-back diodes are only there if they are needed for other applications.
kb1gtt wrote:
Wed Oct 09, 2019 9:32 am
-- Beware thermal management. Plan to add heat sinks to your heat generating chips.
Heat generating chips are going to be soldered to the gnd plane. In future PCB's I'll try to heatsink the pcb (if it even works).

I've redesigned Sprut to use a LQFP64 now. But as the deadline for ordering the PCB is tomorrow it will be ordered in the state that it is now with the redesign

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 » Wed Oct 09, 2019 4:12 pm

-- 5V is only 5V until you say oops, then replace the entire board. We've all made mistakes, and a 12V tolerant input is a beneficial feature.
-- HIP9011 and TPIC8108 have a history of headache here. AKA don't believe datasheets. I suggest some pads to allow changes I have have done. The TPIC seems to want the MCU to drive the clock, not an XTAL. If you can get the HIP, then it's probably problem solved.
-- when 1206 is thermally cycled, it has about a 50% failure rate. While 0805's are far closer to 0% failure rate. I suggest double 0805's to prevent stress failures caused by thermal expansion issues.
-- I agree you should allow optional flyback diode. Things like the alternator controls often want the sluggish control.
-- The hi/lo drivers are very limited by heat. The 3A datasheet is more like 0.125A because of thermal issues.
Welcome to the friendlier side of internet crazy :)

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 » Wed Oct 09, 2019 4:34 pm

kb1gtt wrote:
Wed Oct 09, 2019 4:12 pm
-- The hi/lo drivers are very limited by heat. The 3A datasheet is more like 0.125A because of thermal issues.
This is worth repeating. Gate drivers are designed for driving MOSFET gates, not continuous current loads. Gates are basically capacitors, so there is a brief surge of current to charge, then they present a negligible load. For reasonable efficiency, the charge/discharge time is going to be under 5% in most applications. Thus a "1.5A" gate driver might be suitable for a 40mA continuous load.

The same is true for most raw MOSFET ratings. The advertised current is the limit that the part can sustain with perfect conditions, including a perfect heatsink. The advertised voltage rating doesn't take into account the inductive aspects of real-life mounting. The ratings are useful for comparison, but aren't a nominal value for design.

'Protected' parts such as OmniFETs have much more realistic ratings e.g. a 70V clamp part probably has a 120V transistor.

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 Oct 11, 2019 8:18 am

Sorry for not responding until now!

I've ordered a batch of rev 1B boards which should arrive within this month. Now, just an hour after ordering them I found some bugs in the schematic of 1B, these bug are fortunetly fixable with some mod wire and are going to be fixed in 1C.

Rev 1A to Rev 1B changelist:
  • Changed MCU to a STM32F412RET with support for the F405
  • Changed VR input resistors to 1210 size.
  • Added 2 more analog inputs by wiring up the last 2 unsued opamps in the third MCP6004.
  • Added another draining output (Protected MOSFET).
  • Added 2 more sourcing outputs (DRIVERS) to support up to 6 logical ignition coils with 5v tach and diagnosis light signal.
Essentially the changes enables Sprut to actually run RusEFI firmware (Thanks for informing me on the ram and flash usage!) and allowes Sprut to run a Volvo T6 engine.

Rev 1C is essentially going to be the bugfixing version of 1B. I'll order 1C once I've got a running 1B. Currently the changelist for 1C is:
  • Replaced TPIC8108 XTAL circuit with clock signal from MCU. Suggested by @kb1gtt.
  • Fixed Int/Hold not being connected to MCU. (1B use modwire).
  • Added full duplex SPI communication between TPIC8108 and MCU, only had TX line before.
  • Change VR input resistors to dual inline 0805 resistors as mentioned by @kb1gtt.
  • Added SWD header, (Avalible on 1B with connector attached via mod wires).
  • Added status LEDs.
  • Added pull down resistors to gate drivers inputs. Enables usage TC4427 instead of NCP81071
kb1gtt wrote:
Wed Oct 09, 2019 4:12 pm
-- The hi/lo drivers are very limited by heat. The 3A datasheet is more like 0.125A because of thermal issues.
They should still work fine for this application as they are only being used as logic signals for VAG coils and tach/dash. I've only got access to the NCP81071 but I do not see/understand why the TC442x series chips are any better for this scenario.

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 Oct 11, 2019 8:24 am

Note that the current rev 1C is not up to the PCB design rules that are in the wiki, this will hopefully be fixed in a later rev.

Going to upload rev 1B schematic and KiCad project files later today.

Post Reply