Go Down

Topic: Cruise Control with the Arduino (Read 5817 times) previous topic - next topic

Snabark

Hello sir
Nice to find some one intrest in this topic
I want to do exact same project
This my post
https://forum.arduino.cc/index.php?topic=560154.0
I ommitted the speedometer option

Do you do it
Does it function well
Can you tell us the full details
So we can replicate your work

Thanks

walttheboss

Hello @Snabark.  Thanks for your reply.  If you read through the post the responses were very strong against the project.  Whether or not I did it I will not say for fear that some well meaning person will go after me or remove me from the forums altogether.  My ComSci class is writing a book on the Arduino and it just might appear in that book in a hidden form.  If you find me in another way or personal message I will reply more in detail.

gmcmurry

Its interesting how you can ask a simple question and all of us try to put on lawyer hats.

Cruise control is actually quite difficult.  Forget all the (how do you turn it off stuff for a minute).

Think about how much do you need to accelerate when you are not going the desired speed:

What if you are going up hill?
What if you are going down hill?
How powerful is your motor?
How much "gas" do you give it when you are falling behind?

I have a project where I have been trying to tweek these things and it is difficult.

For any vehicle, it is different depending on what speed you are going...  You can give more acceleration at low speeds than you can at high speeds.

Its loads of fun to play with this type project.  The interface to your 0-5v is the EASY part.

https://en.wikipedia.org/wiki/PID_controller

PID is what it is all called.  Great reading, etc.

Google PID for more.

Try asking us here for more specific interface info, like-- "how do I generater a 0 - 5 volt signal to adjust the throttle on my engine?"

How do I measure the speed of a rotating shaft and turn it into MPH?



Greg


Delta_G

#18
Aug 10, 2018, 05:52 am Last Edit: Aug 10, 2018, 05:53 am by Delta_G
put on lawyer hats.
Not so much lawyer.  More like guy-with-some-common-sense. 

I don't know where this guy is trying out his new cruise control, so I have to worry that it might be near to where I am driving.

Then I see:

Quote
I am a mechanical engineer and Math and Science teacher.
Followed by:

Quote
WHAT is the way to tie my arduino ground to the car's computer ground
and I know that this guy is either 1. a liar  2. stupid  or 3.  the worst engineer ever. 


Either way, it doesn't instill a lot of confidence and I know that I might have to drive around some idiot trying to build a cruise control on a highway.  If it isn't this guy it will be some other numb-skull who reads this thread and decides it's all good to control a 2 ton machine at 70 miles per hour with a $2 hobby microcontroller. 

All I'm saying is, Do your testing on a track and not the street.

That's it.  And I don't think that is too much to ask.  Please consider my safety and not just your own desire to do something stupid. 
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

walttheboss

All well said.  As to which of the three choices I am(liar, stupid, worst engineer) only time will tell. I don't mind any of those names.  Except liar I suppose.

As to how the program works there is a learning cycle/program.  With an accelerometer I can help the controller to pick the right numbers.  When going uphill or downhill.  When the unit is installed it will learn the right parameters quite quickly.  So a 5 liter engine or 1.3 will configure itself with different numbers.  Once you have those numbers you lock them in.

So when the car begins going uphill the program kicks in faster and more agressively.  If you begin to crest a hill the increment numbers decrease so you don't launch over the crest of the hill. 

Its been a great project.  Keep your helmets on all of you!! :)

Delta_G

Again, please test far away from me.  On a track.  Like a real engineer.  Not on the highway like an idiot where someone can get hurt. 
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

walttheboss

Again, please test far away from me.  On a track.  Like a real engineer.  Not on the highway like an idiot where someone can get hurt. 
Again, please test far away from me.  On a track.  Like a real engineer.  Not on the highway like an idiot where someone can get hurt. 
Absolutely.  I will test up on a lift at a shop first. Then on an abandoned highway near my house. (GMT+8).  Then maybe on the road if I am happy with it.  Or maybe I already did all of this.  Say no more.

Thanks for keeping me honest @Delta_G  I appreciate it.

srnet

Is the standard Arduino, such as the UNO, suitable (and safe) for use in a harsh automotive environments ?
http://www.50dollarsat.info/
http://www.loratracker.uk/

KawasakiZx10r

Firstly ATmel has been bought my Microchip so with that out the way here's an interesting thing there is a 328p and 328p-automotive

ATMEGA328P-AUTOMOTIVE

ATmega328P

both have the same specs but i assume one has been far more tested, can anyone spot something that is different between the two ?
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

Albert Einstein

wvmarle

Usually the main difference is in the operating temperature range, which is much greater for automotive versions.

I'd be impressed if you can measure the slight slope of a highway (usually <4% incline) with an accellerometer - as the signal is easily drowned in the noise of the vibrations of the car's engine, the bumps in the road, etc.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

gmcmurry

Here is a good article, though written for Basic Stamp, about using PID.  Believe me, this part of your project will be the most interesting.

http://learn.parallax.com/tutorials/language/pbasic/pid-control/proportional-integral-and-derivative

I have built many devices that ride around in all sorts of vehicles.  You will not have a problem there. 

You need a speed pickup, which could be something like a Cherry KB15MKW01 Gear Sensor.  It can sense a piece of metal flying by and generates a nice open collector signal.  Just attach it to your Arduino and use a pull up resistor.  It is a hall effect device and any sort of rotating shaft with a bolt in it (or similar) will give you a nice speed reference.

I would buffer your Analog throttle output with another OpAmp.  Always nice to have a couple of pots on there to adjust the range without having to get out your computer.  And use use a simple double throw relay to switch out your gas pedal and in your Cruse Control.  That way, your emergency / kill system could easily just revert to your gas pedal when you take away power from the relay.

An Opto Isolated pick up off your brake light will give you a signal to release the Cruise Control when you touch the brake.

Then a couple of buttons to turn things on and off.  You might also like to use a pot to set your speed in your first model, instead of trying to capture your current speed with a button press.  Do both, simple logic.

I have done all this but my programming ability is limited and the PID work I have done needs some help.

Forget the accelerometer and stuff like that.  Your software should just keep track of how fast your system responds to corrections.  Its a classic servo loop you have to close and all well written about on the internet.

Its a great project.

Greg

Go Up