I am trying to implement an automatic heel and toe downshifting mechanism using Arduino. Something similar to this product.
My car has a cable operated throttle so I have installed a servo to open ("blip") the throttle during downshifting.
Also my car has no clutch safety switch so I need to somehow know when the clutch i pressed. I also need to know when the brake pedal is pressed.
So far I have created a prototype on a spare throttle that I have. I am considering of connecting two switches(brake and clutch) in serial so I only need one input in the Arduino. I will apply a generic "blip" not trying to exactly match the revs.
Here is the code for the prototype:
#include <Servo.h>
Servo throttleServo;
const int brakeAndClutchSwitchPin = 2;
// Position of the servo where the throttle is closed
// (the servo is not engaged at all with the throttle)
const int offPos = 42;
// Position of the servo where the throttle is in
// heel and toe state (blip)
const int htPos = 60;
// Last state of the brake and clutch switch
boolean lastState = LOW;
// Current state of the brake and clutch switch
boolean currentState = LOW;
void setup() {
throttleServo.attach(9);
// Make sure that initially the servo will not interfere
// with the throttle
throttleServo.write(offPos);
}
boolean readBrakeAndClutchState() {
boolean newState = digitalRead(brakeAndClutchSwitchPin);
if (lastState != newState){
delay(5);
newState = digitalRead(brakeAndClutchSwitchPin);
}
return newState;
}
void loop() {
currentState = readBrakeAndClutchState();
if (lastState != currentState) {
// brake and clutch switch state changed, so apply throttle
// depending on the current state
if (currentState == HIGH){
throttleServo.write(htPos);
} else {
throttleServo.write(offPos);
}
}
lastState = currentState;
}
I also need to add an ON/OFF switch that will shutdown / disable everything (not implemented yet, in the future I consider reading the vehicle speed sensor and enable the system when the speed is more than 40kmph for example).
Any suggestions, especially on how I can reliably read the pedals state (pressed not pressed)? Should I use "long travel switches", distance sensors or something else?
Also, the servo motor I have has a 4-6 volt range, any pointers/best practice on how to power it via the 12V car power supply (voltage regulator or something else)?
I am not that experienced with electronics so I would appreciate your input.
Might want to check to see if your car was available with ASCD aka cruise control. If so you likely have a factory spot for switch on the clutch, or simp,e replacement of the clutch pedal to the one used by the better model.
In my heyday of gear thrashing, I installed a ignition cut relay and switch to a button on gearshift. I could keep gas floored, pull back on gearshift, hit switch and slam it into next upwards gear all without touching clutch..
You can use the same type of switch as fitted to the Brake pedal.
I started and never finished one of these, but used a vacuum actuator to pull the throttle, didn’t think a servo strong/fast enough.
I was taking an ecu signal for rpm .
Google “ flat shifter “ for inspiration , same sort of thing
I did once see a race car with a bicycle brake lever attached to the gear lever, that was connected to the throttle by a cable so the driver could blip the throttle on down changes
Paul_KD7HB:
What is your time line to get this project operational?
I don't have a strict timeline for the project. I believe that within the next month it will be operational.
Delta_G:
Before going too far with an automotive application, you should be aware of this from the chip manufacturer:
From the Datasheet for the 328P (emphasis added):
I am aware of the safety issues involved. I will add a safety switch that will cut power to the servo, and maybe I will supply power to the servo only when both the clutch and the brake pedals are pressed (so that even if Arduino goes crazy and commands the throttle to open when it shouldn't, the servo will actually will open the throttle when the clutch is pressed). Moreover, I will only use it in my trackday car and not in public roads.
I got some "long travel" switches, that I will install on the pedals, and a Dc to DC converter that will supply 6v to the servo from the 12v car battery.
Also, I am making improvements on the code, if you want to check here is the repo:
Delta_G:
While there are safety issues to consider, that wasn't what I was pointing out. I was showing that the manufacturer of the chip you're using expressly forbids you doing this with their product. Technically you could be sued for it. If you cause an accident you will end up in legal jeopardy fromboth sides as the victim AND atmel both have cause against you.
Point being, you should choose a chip from a manufacturer that doesn't make that restriction.
The language you quoted does not support a claim against one for the use of Atmel products in automotive products. The express foreboding mitigates Atmel from liability in cases where use in automotive products results in loss. For Atmel to have a case against the one who uses their products in automotive products, Atmel would need to prove that they incurred a loss from one doing so. Atmel may very well have a case of loss against one who would use their products in automotive products, but the language quoted does not indisputably supply this burden of proof.
Delta_G:
Oh you're right. It's the next disclaimer in the datasheet that has that actual language. It expressly forbids military, automotive, and life support. If there were a loss and atmel thought their name was besmirched by being involved then they certainly have cause. Will they? Probably not. But they'd have cause.
Atmel is now Microchip, but for sure if there was a headline in the news, "Child Dies! ATmega Malfunction the Cause" you can be sure there they will have cause.
Delta_G:
What's more is that atmel has basically said that their chips aren't suitable for an automotive environment. That would be enough to make me pick a different chip.
The PIC line of microcontrollers has some automotive rated parts, but this is not enough to keep you from being sued (or having your insurance cancelled).
That 1099 GBP price is mostly to cover the costs of required testing and certification.