For any add-on boards such as VR conditioners, optos and OEM interface boards
User avatar
By DStage
#65130
I've just added the VERY beta version of SW for v2.2 - the FW for Arduino Nano and PC application: https://github.com/DStageGarage/Electro ... TC%20v2/SW You are all welcome to test it.

The PC app gave me a real headache. I don't like coding for PC and actually never used C# before. I had to significantly slow down the UART transmition as loading data from Arduino to PC was very unstable. Now it's only "a bit" unstable so I do not advise using the "Read" button many times. If anyone would like to improve it be my guest. Also it still needs adding saving and reading the map from file.

The Arduino code is commented in a way that it will ignore RPM signal and work as if it is always 2000 RPM so you have to fill in map data accordingly. This can be easily changed in the code and RPM reading should work together with the full map. This of course means you have to provide 5V RPM signal to pin D3 of the Arduino (there is an extra pad on ETC PCB).

The MIN and MAX RPM values should correspond to real expected min and max for better calculation results. Speaking of the calculation, program will approximate the throttle position based on the RPM and gas pedal input. The approximation takes 4 closest points in the map and it will calculate weights for those points depending on the proximity.

The 0% and 100% values of the gas pedal position in the map cannot be changed. user should also do the calibration first. This is not about the analog calibration that of course should be done according to the procedure in spreadsheet first. It's an extra digital calibration of gas pedal top and bottom position read by ADC and it should be stored in EEPROM (now I thing I actually forgot to test if those values are stored correctly or not).

The Arduino code is not the prettiest and I was lazy so it's all in one file. I really did not test it appropriately yet.
Attachments
v0.01 beta.png
v0.01 beta.png (27.89 KiB) Viewed 11011 times
#65460
First off, awesome work! I've been lurking this thread since early on. This is a very cool project you've got going and I'm planning on using it in my car when I get to the point where a throttle would do anything...

I'm also an embedded software engineer professionally so I can actually contribute meaningfully to this project now that there's a digital controller involved!

So going over the schematic, it looks like it's set up to be either digitally controlled via the Nano or controlled directly by the pedal position, and that is determined by a 0 Ohm, Z1/Z2? So under a fail condition the output should just be totally disabled by way of T5. I don't like that Z1 is placed in a position that cuts ACC_DIG off of the accelerator pedal position sensor (APPS)/TPS comparator circuitry and relies wholly on the FAULT line. It's worse given that the FAULT line is driven by the Nano and not some sort of monitor circuit.

Let's talk about the comparator stuff. Is the intention that even during Nano operation that the TPS should still be compared to the APPS? Seems like more aggressive mapping could fault the circuit out in weird ways. I think this would override any digital comparison done with the TH_ADC line. Digital comparison is still a good thing to have, it just shouldn't be used as a failsafe. I'd prefer to see some sort of switch circuit rather than Z1/Z2. Maybe a 2x1 mux? If the Nano outright dies then it would just switch over to APPS input? Could be a problem if the map does less throttle than the APPS input, so maybe that's not the right choice either. Maybe just have a big capacitor so the Nano FAULT cuts out throttle and a second later the pedal takes over? Some sort of attenuator on the ACC_POS line to make a 25% max throttle "limp mode"? These are just the first ideas that come to me.

As for the Nano FAULT line, I don't like that the single core processor is in charge of setting its own safety-critical fault line. This could cause unintended acceleration. (Side note, the BARR group who discovered the Toyota software issue that led to unintended acceleration publicizes an embedded C coding standard which is a good reference for a project like this.) I wonder if some sort of RCS circuit along side pulses on the FAULT line could be a decent analog way to make sure we're getting signals as often as expected? Another option could be either a second Nano as a redundancy/watchdog. At the very least, using something dual core like the ESP32 in addition to some sort of external circuit would be much better than what you've currently got.

Anyways, once these hardware concerns are cleared up or fixed I'd love to contribute to the throttle control software. And I hope you don't take this feedback as an insult or rude criticism, like I said I'm hugely impressed and would 100% use this without the Nano in its current form. Just trying to offer a schematic review. Let me know if anything I mentioned doesn't make sense or I worded it poorly.
User avatar
By PSIG
#65555
JLC can likely suggest a list of similar DPAK (TO-252) 5V 1A regulators for you to choose that they have available. This would usually be the preferred path.

You can do something similar to choose a different one online and check with them, such as going to a poplar site and searching for the original part. Then, the site will usually list "similar items" for you to check into.

One example is Digi-Key, where a search for that part number produced a list of similar parts such as L78M05ABDT-TR, NCV7805, NJM7805 and L78M05CDT-TR as a few of 88 :shock: "similar" examples they have in-stock.

Another option is to search for the original part on OctoPart, to find distributors that carry the exact part. However, that means you will be installing the part yourself instead of JLC. Don't forget that sometimes the best search is for the part family, rather than a specific version that may only be different packaging. Good luck!
By Mappie
#65557
PSIG wrote: Tue Oct 31, 2023 7:57 pm JLC can likely suggest a list of similar DPAK (TO-252) 5V 1A regulators for you to choose that they have available. This would usually be the preferred path.

You can do something similar to choose a different one online and check with them, such as going to a poplar site and searching for the original part. Then, the site will usually list "similar items" for you to check into.

One example is Digi-Key, where a search for that part number produced a list of similar parts such as L78M05ABDT-TR, NCV7805, NJM7805 and L78M05CDT-TR as a few of 88 :shock: "similar" examples they have in-stock.

Another option is to search for the original part on OctoPart, to find distributors that carry the exact part. However, that means you will be installing the part yourself instead of JLC. Don't forget that sometimes the best search is for the part family, rather than a specific version that may only be different packaging. Good luck!
thank you! i will take a look :D
#65569
niall280zx wrote: Fri Oct 27, 2023 7:46 pm As for the Nano FAULT line, I don't like that the single core processor is in charge of setting its own safety-critical fault line.
This is an issue that I have raised before with Arduino based ETCs and even Speeduino itself. The Mega has a watchdog timer and a brownout detection circuit but they are never implemented and the datasheet is quite clear that a brownout can cause corruption of the programme counter which can lead to runaway code.
I worked in ECU design in the automotive industry for a number of years, I have designed an ETC but using an ASIL D processor and an H-bridge with its own watchdog.
#67771
I was just about to get this controller ordered, but:
the following 3 items are not available at jlcpcb.
Can someone suggest alternative parts please?
Microchip Tech MCP6004T-E/SL
WILLSEMI(Will Semicon) RB521S30-2/TR
Lelon HBW271M1VTR-1010K
  • 1
  • 8
  • 9
  • 10
  • 11
  • 12
Injected 2 stroke Bultaco

Alternator testing. Its a 3 phase circa 200w alter[…]

BMW E23 M30B28

Okay, I managed to start the engine. The &quot[…]

NO2C crank signal issues

Once again PSIG, thank you. Note this is set up fo[…]

I've managed to dig up a few obscure wiring diag[…]

Still can't find what you're looking for?