Hand throttle for Vehicle drive by wire

Ok this is my post and i have no idea about arduino.
i have operated PLC's before, that is about the extent of my knowledge.

i have a vehicle drive by wire set up that i want to be able to record then mimic the pedal outputs, 2x voltage 0-5v (it has 2 circuits for fail safe)to
3 input buttons;

  1. to increase voltages
  2. to decrease voltages
  3. to set/recalibrate
    1+2 to turn on/off
    if brake is pressed (12v signal) resets to idle
    LCD to show;
    mode
    incriment of throttle position

Any idea of what parts i need to begin and coding, or better ideas?

note the the 2 pedal outputs arnt the same voltages they start and finish at different voltages.

Cheers for any help

Is this a real vehicle or a model?

If it's real then this

Ok this is my post and i have no idea about arduino.
i have operated PLC's before, that is about the extent of my knowledge.

Is a big problem.


Rob

yes its a real vehicle, i have no problem doing this with a DS1669, but it has no display function, some said to have a crack with aruino, so im here to learn, if you don't want to pass on knowledge please don't waste my time with pointless replies.
I don't work in this field, however if you what to insult my intelligent then again don't waste my time with pointless replies.
if you must know, i am a heavy diesel mechanic (cert 4) so for you educated people out there you would understand that there is a large engineering component to this. yes its not as high as some people on here, but i can put my pride aside and ask for help, since this is one of the best ways to learn.
So Graynomad thank you for nothing #####

Moderator edit: Keep it civil. First warning.

Listen [rude word redacted], I was merely enquiring. And for your information any control facility added by a non-expert in a field like this is asking for trouble in a big way. Even Toyota can't get it right and do you think their software development is done by diesel mechanics with Aduinos and a $59 budget?

So let's look at a scenario

Button 1 is pressed but the handling code goes into a loop adding 10 to the speed variable because the LCD function used the String object which is buggy and didn't free RAM correctly therefore trashing the up/down value or maybe a flag that tells the loop to stop, or maybe you test for == 100 rather than <= 100 because that's what a beginner programmers often do.
The car accelerates, potentially out of control.
The brake pedal is pressed but either the wire came off, the switch is faulty, or the above-mentioned loop doesn't allow the program to read the input anyway. Or maybe just at that time there was a load dump situation that fried everything except the digital pot that is happy to stay at full tilt.

And that's just the first combination I can think of.

if you must know, i am a heavy diesel mechanic (cert 4)

You could be the prince of Persia, makes no difference.

a large engineering component to this. yes its not as high as some people on here

You're actually a lot higher qualified than me, I didn't finish school let alone get any formal higher education.

It's pretty standard on this and other forums to warn newbies against potentially dangerous projects like controlling vehicles and mains voltage.

As such I would not have aided and abetted this anyway, even without the attitude. This is a very polite forum and to get a tirade from someone on their second post is not the norm that's for sure.

ask for help, since this is one of the best ways to learn.

That's true, I just don't think this is an appropriate project to learn on.

or better ideas?

After 30 years designing embedded hardware and software I have plenty of ideas, but you'll not be hearing them.


Rob

dmn_jimmi wrote:
Ok this is my post and i have no idea about arduino.
i have operated PLC's before, that is about the extent of my knowledge.

It is ok to say that you have no idea about Arduino, and that you have operated PLC's before, there are many other people out there who could say the same, and often do.

My first question to you is, when you say you have operated PLC's do you mean you have operated PLC driven machinery or you have actually designed and programmed PLC equipment for a specific function, say for instance, controlling hydraulics or electric motors? Understandably, I think you will agree, there is a big difference between the two.

When I read your initial post I am not quite clear on what you are saying, and that may be confusing for others here as well.
From what I understand, you want to be able to record and then to simulate the pedal movements in a real on road vehicle, is that correct?

It would serve you well if you were more clear and concise in explaining the various aspects of your abilities and the project you wish to undertake. Doing so, helps us help you, without you becoming seemingly irritated.
Try to remember that we can not read your thoughts, though we are working on it as we speak, so careful what yee have thoughts of.

With your comments in your reply post #2, it sounds to me that you think yourself maybe not as educated as folks here, or you would have not mentioned that you proudly hold a cert 4 as a diesel mechanic. Hey, that's great, really, I am sure there are many here that don't even have that, but I wouldn't hold that against anybody, and I hope that view would be supported by others.

You see, your last comments directed toward Graynomad in the way you did, apart from being totally unwarranted, may now unfortunately lead to less assistance from members of the forum that might have otherwise taken an interest in what you are wanting to do.

I guess your using a DS1669 might be looking like a solution after all, even better that it is no problem for you?

dmn_jimmi:
yes its a real vehicle, i have no problem doing this with a DS1669, but it has no display function, some said to have a crack with aruino, so im here to learn, if you don't want to pass on knowledge please don't waste my time with pointless replies.

It's not a pointless reply - it's asking whether you know enough to do this safely. You don't mention any experience of designing safety critical systems so I assume you don't have any. Making something that works is easy. Making something that remains safe regardless of any hardware or software failures is a lot harder. Do you suppose the original designers would have gone to the trouble of adding twin throttle pots if it wasn't necessary for safety reasons? I don't think you have any idea what is involved in designing a safety critical system, let alone have the skills and knowledge to do it yourself. What you're proposing would compromise the safety features of the existing control system (by introducing your new controller as a single point of failure) and introduce a whole new set of potential failures, any of which could leave the vehicle out of control. You just don't want to go there. This isn't intended as an insult and it's not a comment on your intelligence - it's a comment on your skills and experience. I admire your willingness to have a go, but this is NOT a job for somebody to just muddle through.

I have to agree with the OP to some degree here (though not as indignant as him or with the profanity). 9 times out of 10 people just want to respond with their little opinions about safety, etc... That's all well and good, but it isn't what the posters are asking for. As far as I am concerned, that stuff is their responsibility, not mine. Simply throwing out an irrelevant opinion without offering some contribution to the actual topic is pointless. He never asked if someone thought he COULD do it with his experience. He asked what parts were needed.

Since when do people need to justify why they are doing a project? We are responsible for our own actions. Noone here is your mommy. Unfortunately 9 times out of 10, that is what I see nearly every discussion turning into around here. Very little ACTUAL help and very little ACTUAL relevant replies, just opinions unrelated to the question or asking for complete details about the project that noone bothers to read anyway because it is just "too long" once they ask for it.

I have pretty much stopped asking for help in these forums. It's futile, mostly. Either it is populated by people that have no clue what they are doing or they just come here to share an opinion rather than knowledge. I mainly stick around to attempt to help others when I can, since that is pretty rare and discouraging around here. I need to find a better forum, for sure.

I don't think anyone is trying to be a jerk, just that maybe they can't control themselves enough to keep an opinion or nanny-ing thoughts to themselves. You don't HAVE to share an opinion, you know. And if you do, at least try to also contribute something. Or just move on... It IS a waste of everybody's time, otherwise.

Now, back to the original question... OP it is a bit unclear exactly what you want to do. I am assuming that you have some type of sensor on the throttle and brake pedals (a potentiometer) and all you want to do is record them and play them back. For this, you need to take samples over time. So, for example, you read the analog inputs every 100ms. Then when you play it back, you update the outputs every 100ms. By using a set time, you are only storing the values.

As far as parts, I see an LCD display, an optocoupler to interface with the 12V brake signal, and buttons. Outside of that, I don't see much other hardware needed. Maybe connectors to fit your sensors, and perhaps a power supply suitable for vehicle voltages. An Arduino Uno should be capable of this.

Perhaps it would be smarter to log the RPM output and speedometer instead of the pedals or to tap into the cruise control system if available?

cheers Retroplayer,
the problem with rpm vs speed is if i want to run this with the stationary, high idle to run hydraulic pump at speed, alternator, air compressor.

safety side of the house:
the arduino would run parallel with the existing output from the pedal, isolate it with something like an Optoisolators, or just a simple 2pst relay.
the 2 circuit set-up is a fail safe so if the circuit don't match set parameters the vehicle goes into limp home mode, cuts throttle input.
the throttle pedal in a drive by wire system has 6 wires, 3 and 3 (2 circuit fail safe). it doesn't use a potentiometer as Toyota had major recalls because of these, do they redesigned the pedal position sensor to induce voltage so there were no parts to wear or fail.
its a maual, so if it stay at "full tilt" clutch in
its for off road use only im not using this as cruise control

basically the pedal position sensor provides 2 output to the ecu to move the throttle body
input is 5v to the pedal.
the 2 circuits provide a start voltage, say 2.1v and 1.8v, at idle.
at wide open throttle (W.O.T.), pedal flat to the for the voltage is , say 4.5 and 4.8.
the voltage increase is linear.
normally when you calibrate a new pedal to the system to set and idle and W.O.T.
so i would like to sample at idle and W.O.T. to get the 4 values.
then work out in, say in 10, increment, the volt for each increment.
then a similar set-up to cruise control, up down off/on set.

there is one kit similar to this but for Jeep, and it only has a 1 circuit not dual like mine

the problem with using the cruise control for drive by wire is cost $1000.
then you can do the same thing at idle in calibration mode. but it the car moves it switches off, and cruise control doesnt work under 40km/h.

i can achieve high idle with no adjustment, so input a set voltage and rpm is faster.
a couple of guys have tried dual potentiometer, but they arn't accurate enough and throw a fault code.
one guy did achieve adjustment but only idle to 2000rpm

Interesting. It really sounds like you understand all the requirements, so I guess the question is what do you need help with? The arduino is all you need to read a voltage, you know that you need an LCD and some buttons (I would recommend external pullups). The only real extra part is the optocoupler to connect your 12V brake pedal signal to the Arduino. There are actually several different ways to do that, though.

i want to be able to record then mimic the pedal outputs

I'm still not clear about this bit though, although it might be covered somewhere in the clutter of this thread...

It's not a real time operation then, is that what that means? Record and mimic sounds to me like record and re-play.... does that mean a human driver will drive this vehicle to "program" it for want of the better word, and next time round the same route the Arduino will drive it?

so upon installing into the system the arduino need to learn the outputs from the pedal, 2 sets of min/max voltage.
it then need to feed, say 10, different sets of voltages to the ecu, to mimic a pedal position voltage, to achieve and rpm.

Ah ok, so that's more of a calibration thing, and then later on it is real time control.

yes thats what im aiming for i guess, is that something i can do, or not. i still dont know all the limits of arduino.

The only limitation is on sending the voltages back to the ECU. Though a DAC (digital to analog converter) would take care of that. The voltages are between 0 and 5V? What about the brake, will you need to feed that back in to the ECU? That's just straight on/off so a simple relay can take care of that.

So add a DAC chip to your shopping list.

because there are 2 inputs to the ecu i need 2 DAC right?
and run the off th PWM outputs?

i still dont know all the limits of arduino.

Well I doubt if anyone does.... If you think of it in the simple sense of a "black box" that you hook sensors to on one side and drive actuators on the other, with the "black box" containing the program which represents your knowledge, are there any limits? (Sure, there are physical limits which depend on the Arduino model... number of pins, memory, allowable voltages (like the Due being 3.3 not 5...) and so on.)

i have no idea about arduino.

You can learn the programming pretty easily by following tutorials like these and or these. If I were you I'd get at least those basics under my belt before looking at the specifics of your project, although working through the basics with a project in mind is sure to guide your learning path

dmn_jimmi:
because there are 2 inputs to the ecu i need 2 DAC right?
and run the off th PWM outputs?

Yes, two DACs. No, not off the PWM outputs (unless there is a method I am not aware of.) Usually a DAC will have a parallel or SPI/I2C type interface to them. Adafruit has a few different ones. This one is a 4 channel (which means you only need the one module) that uses I2C. There are libraries for it in the description:

cheers for all the help guys, this should keep me busy for a while

Hi again, retroplayer the link you sent is for a four channel ADC, so i can not use this rite?
i looked at LCD bit as well and it takes up a little too much room so im goin to scrap that.
instead of running buttons i was thinking of a just using a rotary encoder, and a kill toggle switch.
can i run something like the Ardunio micro? the smaller the better.
still goin to purchase a uno and a starter kit for practice.

oops, you are correct. You need a DAC, not an ADC. For some reason I was looking at this: MCP4725 Breakout Board - 12-Bit DAC with I2C Interface [STEMMA QT / qwiic] : ID 935 : $4.95 : Adafruit Industries, Unique & fun DIY electronics and kits , but then somehow ended up looking at the ADC and mixed up the specs.

You can LCDs quite small, how much data do you need to display? Would a 1 line by 8 character display work? Or how about a small cell phone LCD?

As far as using something like an arduino but smaller, look at the pro mini, arduino minis, arduino nanos, etc...