Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e-throttle support #457

Open
XPbIM3 opened this issue Sep 20, 2020 · 19 comments
Open

e-throttle support #457

XPbIM3 opened this issue Sep 20, 2020 · 19 comments

Comments

@XPbIM3
Copy link
Contributor

XPbIM3 commented Sep 20, 2020

I've been thinking for a while about e-throttle support.
Seems we have everything ready for that:

1)throttle body TPS sensor reading - already done.
2)Pedal sensor - easily doable - speeduino is capable of handling additional analog sensor
3)Two pwm outputs to control two FETs in full-H bridge. - already have idle1 and idle2 pins, both pwm controlled.

and code part required:

4)An algorithm logic: the simplest algorithm is: when accelerator pedal is operated by foot the TPS must follow pedal sensor position closely , so there is DELTA calculated between two sensor positions. And this delta mapped to PWM signal of two wires controling the H bridge for throttle blade motor. If DELTA is positive - the open FET is operated via pwm, if negative - close FET operated via PWM. When pedal is not pressed and idle conditions are meet the switchover to rpm maintainig algorithm is performed - simply the rpm as a target over coolant temp - as it already present in speeduino.

also a calibration routine should be present - pull throttle blade full open and full close - and flash those values in eeprom.

This would be very usefull on semi-electronic throttle engines like mercedes M111, several 1JZs and some others.

@stevenhowes
Copy link

It's come up a lot of times in the past but there has been much resistance because of the safety aspect of it. I'm not convinced that a vehicle with brakes (which I'd think was a vast majority) has much of an issue here, but it could be a thing. Having had sticking throttle cables in the past (at WOT) I don't think a malfunctioning throttle is anything exclusive to e-throttles.

@XPbIM3
Copy link
Contributor Author

XPbIM3 commented Sep 21, 2020

The danger is real. Especially for those who have mighty engine and automatic tranny.
I've also had an experience with stuck WOT on rb25det - it was scary as F.

But ability to drive an e-throttle is a valuable bit for customizable ECU.

@stevenhowes
Copy link

I have to say I've only had one car that's an auto, but I seem to recall it had neutral?

@XPbIM3
Copy link
Contributor Author

XPbIM3 commented Sep 21, 2020

Correct.

@DeeEmm
Copy link

DeeEmm commented Sep 21, 2020 via email

@digmorepaka
Copy link

I think it is important to support electronic throttles. In my opinion it is much safer for the throttle to be controlled by the speeduino firmware as it is extensively tested and audited unlike something you hack together on a weekend with only your own limited testing. This would also open up compatibility with some engines that use don't use an idle bypass valve but rather just control the main throttle(for example 1ZZ in 04-08 corolla verso).

You as the driver should have the ability to shut down the engine/decouple it from the rest of the drivetrain regardless of the ECUs state, especially when doing extensive modifications(like replacing the entire ECU).

@XPbIM3
Copy link
Contributor Author

XPbIM3 commented Sep 22, 2020

For safety purposes we can implement some stuff like:

  • having more than 10% deviation between TPS and PPS on non-idle for more like 3s - shutdown e-throttle control
    This can be a part of Engine Protection System maybe?

E-throttle control alongside with ignition cutoff can became a rev-matching for gear-switching.

@ReubenHoona
Copy link

ReubenHoona commented Sep 23, 2020 via email

@DeeEmm
Copy link

DeeEmm commented Sep 23, 2020 via email

@digmorepaka
Copy link

@dascons

There are aftermarket controllers. I think one of the speedy retailers
actually have a kitset available.

If that's the case, maybe that module could be incorporated into the main pcb?

@DeeEmm

FMEA analysis is critical

And if a feature that could potentially be seen as 'very dangerous when fails', it's only better if it's in such a large project where this is feasible to evaluate

But when Johhny's moms expensive lawyer is pulling you apart in the dock because Johnnys mom wants someone to pay for the loss of little Johnny

Project is distributed as GPL-2.0 as far as i can tell, which strips the creator of any liability for failures/damages.

@DeeEmm
Copy link

DeeEmm commented Sep 23, 2020 via email

@ElDominio
Copy link

2019_ETC_FMEA_Template_(1).xlsx

Maybe start here, fill this out and something could eventually start getting its bearings!

@eddnshoulders
Copy link

Hi all,

I've only just come across this project, but I've worked in automotive engine and transmission controls R&D for a good while and I wondered if some comments on this might be useful.

The (D)FMEA is the right approach. What this would tell you is that you can easily detect sensor, actuator and wiring faults and create a safe reaction. A correctly configured MCU watchdog will protect for any processor hang/crash since a watchdog reset will switch off the external relay controlling 12v actuator supply.

The remaining risk (which is very very unlikely) is that you get a hardware fault in the PWM driver module within the MCU or the actuator driver (can be an h-bridge, but since an intake throttle will be sprung closed it can just be a low-side or high-side driver), the worst case being a short to 12v (i.e., throttle stuck fully open). This can be monitored by measuring the output voltage of the h-bridge using an MCU ADC channel and comparing vs expected.

The way the most recent OEM controllers handle this is to have a microcontroller that runs in lockstep - 2 cores running the exact same code in parallel and any variation monitored for (e.g., Bosch MED17 uses Infineon Tricore).

The way I would handle this with something like Speeduino is to have an external supervisor monitoring the MCU and controlling the actuator supply relay. The MCU would generate an output square wave when it was running which the supervisor would monitor. If the signal stopped, the actuator supply would be switched off. I would generate the rising and falling edges of this signal inside the throttle position and actuator drive output functions (respectively) themselves. This way, if either didn't run for whatever reason, the throttle would be closed. The actuator supply enable outputs from the MCU and the supervisor would be run through an AND gate into the actuator supply relay so that both had to be happy (and working correctly) for the throttle to be driven. This above solution would go a long way to mitigating the biggest risk of implementing e-throttle into Speeduino - that of you using someone else's code base.

Whatever the solution, extra testing would be required to ensure each code release worked safely under each of the failure cases from the (D)FMEA. This would need to be done by running the code on the target hardware rather than just abstract unit-testing. You would need test scripts to flash and run test cases on ECU hardware with a throttle body connected. Dedicated HiL rigs are used for this in a commercial setting, but the same could be achieved by extending the functionality of Ardustim a little. This is probably the biggest drawback of implementing e-throttle on Speeduino, since it is quite a bit of extra work.

Finally, in case it's useful, OEM ECUs have the following diagnostic checks for e-throttle sensor, wiring and actuator faults:

  1. Sensor signal range check - is the sensor signal within the expected range? An analog sensor has a range a little within the supply rails to allow for shorts to be detected. E.g., a pedal or actuator position sensor with a 5v supply will have a normal range of typically 0.5-4.5v. If the value is outside that, an open or closed-circuit fault is detected.
  2. closed-loop controller deviation - if the actuator position goes outside of a window set around the set-point position (or actuator drive voltage, if measured) the actuator is determined to be not responding correctly.
  3. The pedal and throttle position sensor have 2 signals with inverse voltages - when one is 0.5v, the other is 4.5v. This allows detection of gnd/12v shorts that might occur on both simultaneously. Comparison of the 2 signals (within a tolerance window) when within range allows checking for correct signal.
  4. If the h-bridge output has current detection, you can check that the drive current is within an expected range given the driven voltage/duty. This checks for a sticking actuator.

All the above checks can be run through a leaky bucket or other type of filter so they don't react inappropriately to any incorrect readings caused by interference or otherwise.

You also need to detect and adapt the fully open and fully closed positions of the throttle plate. The fully closed position is the critical one since it usually controls idle which is very sensitive to throttle position. This end-stop learning as it's called, usually happens after key-off and engine stop. You might hear it on your cars as the throttle cycles between fully-open and fully-closed positions a few times and the resulting voltages stored in NVRAM to be used on next engine start as the ends of the sensor range.

The final things will be a pedal maps to calibrate throttle response. This is usually 1 2D map for each gear with X and Y scales as engine speed and pedal position. The values in the map will be load or torque depending on the chosen control quantity. You will also need a function to control the transition between the idle speed controller having control on the throttle to the pedal having control on the throttle as the engine speed drops down to the idle speed.

As you can see from the above, this is a lot of work and rather changes the scope of your project as well a introducing significant extra testing requires for each release. There are significant benefits to having e-throttle control, but it's not an easy thing to implement. This might well explain any reluctance to go down this route.

@772033
Copy link

772033 commented Jul 12, 2021

So why do aftermarket ecu manufacturers like haltech and others have the ability and let users decide whether they want to use electronic throttle bodies or not? Certainly there just has to be some form of liability recognition on behalf of the programmer/tuner when choosing to go this route!
Pretty much all cars these days have fly by wire and electronic throttle bodies.
And here I was hoping to get a speeduino set up with my existing sensors in my Honda Accord.

@eddnshoulders
Copy link

Cos they'll have implemented everything I mentioned above and they will have designed their hardware to be suitable from the start. This isn't taking anything away from the efforts here and other open-source controllers, but e-throttle (as well as others like cruise control and traction control) is a higher level of risk and development/testing effort.

Commercial stuff has to meet safety standards regardless of waivers, etc. Plus, even then any failures could still be very bad for brand reputations.

You still have options for your Honda. You can get standalone e-throttle controllers that you could use with speeduino. There are quite a few options, but this look like it could be a good pairing - https://lowcostracingsolutions.co.uk/fly-by-wire-controller/52-electronic-throttle-etc-fly-by-wiredrive-by-wire-standalone-controller.html

@772033
Copy link

772033 commented Jul 13, 2021

Thanks eddnshoulders. I will look into the stand alone controllers as you suggest.

@digmorepaka
Copy link

digmorepaka commented Jan 3, 2022

https://speeduino.com/forum/viewtopic.php?f=15&t=4952&p=54505 Here's a good stop-gap solution as a separate module, sadly no cruise control or traction aids but that could be augmented with some extra work.

@smwoodward
Copy link

I can also agree that TBW is needed to be added in the future sooner rather than later.

@piotrcurious
Copy link

Safety drama is IMO a hoax.
First, if safety would be really concerned, additional mechanical choke can be installed, either in series or just pulling the throttle back, overriding stepper motor.
2nd - speeduino is actually safer than mechanical throttle, as mechanical throttle can get stuck by mechanical means (f.e. return string getting rusty and perishing) , and then no ECU can actually know that sth is wrong.
Stuck or malfunctioning DBW throttle with speeduino will throw check engine light very quick as AFR defined for certain TPS wil be invalid. If speeduino will detect throttle malfunction, it can actually decrease power by other means, like delaying ignition and starving engine of fuel .
So all this safety drama is actually something fishy.
Last not least installing DBW or speeduino on multimillion dollar muscle cars is something fishy too .
Speeduino is mostly used in cheap environments, like converting lawnmower, generator or old carburetor car, perhaps by ricers too but that's off-road use anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants