Using electric motor to control engine speed on gas motor

My project is to develop a load-based high idle control system. It might sound complicated, but I think it should be pretty easy. Just want someone to take a look at it for me.

The mechanical portion is already in place. The vehicle's cruise control actuator is the perfect setup for doing this. I've unplugged it from the rest of the vehicles electrical system, so it is no longer being used for "cruise control".
Basically, it's just a 12v electric motor that has a cable that runs to the gas engine's throttle body.

So, to control that electric motor, I need an H-bridge controller. I'll post up my parts list here in a minute.

I'm wanting to use an Arduino to control this project. I run an air compressor off of the engine, which requires more engine speed than the typical ~850rpm that an engine idles at. This is where I need high-idle capabilities.

Overview:

Arduino is set to hold 1500 engine rpm
Arduino reads tach signal from engine (tap into tach signal wire)
Arduino uses PWM to control H-bridge, which controls electric control motor

Benefit of doing it this way, is that the engine will hold 1500rpm no matter what the load is. As the air compressor cycles, the load changes. Therefor, a set throttle position (say 20%) may hold 1500rpm with no load, but as soon as that compressor kicks on, it may drop down to 1200rpm or less.

Your thoughts on this?

Sounds like a plan to me.

You need a way for the arduino to monitor engine RPMs.
I'll be looking into this myself, over the summer, as I want to make a cruise control system.

What vehicle are you running this system on?
Does it use a cable throttle, or Drive By Wire?

Off the top of my head, ideas to grab the engine revs.
-Tach signal off the distributor (not sure if this would be at a high voltage though)
-Voltage off of the gauge needle motor.
-OBDII interface.

Some sort of failsafe would be good. Perhaps a switch that kills power to the arduino unit?
Something automated that kills Arduino power if the motor starts to race [Perhaps when you get fuel-cut at the rev limit?]

In terms of powering the Arduino off of ~14.4v car voltage, I was planning on using a (LM7809CT-ND) to pull the voltage down to 9v, and have the Arduino voltage regulator drop it to 5v.
Not sure if this is the best way though.

If I were you I'd follow the approach which is conventional for engine management systems to control idle speed - fit an idle control valve - basically a stepper motor controlled air bleed valve - to provide an air bleed past the throttle plate. This avoids interfering with the cruise control system. By designing the air bleed to provide a suitable restriction, you avoid any issues about giving the engine excessive throttle. (When it is off load and at small throttle openings the engine is extremely sensitive to small changes in throttle position.)

The Megasquirt web site suggests some sources for the idle control valve and describes how to drive them. They are inexpensive, easy to plumb in for most installations, and electrically straight forward.

Panici:
Sounds like a plan to me.

You need a way for the arduino to monitor engine RPMs.
I'll be looking into this myself, over the summer, as I want to make a cruise control system.

What vehicle are you running this system on?
Does it use a cable throttle, or Drive By Wire?

Off the top of my head, ideas to grab the engine revs.
-Tach signal off the distributor (not sure if this would be at a high voltage though)
-Voltage off of the gauge needle motor.
-OBDII interface.

Some sort of failsafe would be good. Perhaps a switch that kills power to the arduino unit?
Something automated that kills Arduino power if the motor starts to race [Perhaps when you get fuel-cut at the rev limit?]

In terms of powering the Arduino off of ~14.4v car voltage, I was planning on using a (LM7809CT-ND) to pull the voltage down to 9v, and have the Arduino voltage regulator drop it to 5v.
Not sure if this is the best way though.

I appreciate your response! The vehicle is an older Toyota with a big ol' straight 6 engine. It's a cable driven throttle body, and the cruise control actuator is mounted on the passenger side fender, and has a cable that runs straight to the throttle body.
That's why I want to use it for this project. It's already hooked up, and I know it has enough power to actuate the throttle body.

As for a safety, I've already got that lined out too. Other than the Arduino reading a tach signal, the entire system will be separated from the vehicles electrical system. It will be armed (powered) by a master toggle switch on the dash. Therefor, if a problem were to arrise, I can simply kill the power to the high-idle system, and be on my way.

I'm glad you brought up the voltage issue! I was wondering about that as well.
I've ordered the Arduino Uno R3, and the power specs for it only go up to 12v. My rig runs right at 13.8v at a high idle.
Looks like we're both curious if anyone else has suggestions on power?

For the tach signal. My rig is OBD-1, so I may be able to pull a signal off of that. If not, there is a tach signal wire somewhere, just need to refer to the wiring diagram.
Also has a tach in the factory gauge cluster.

PeterH:
If I were you I'd follow the approach which is conventional for engine management systems to control idle speed - fit an idle control valve - basically a stepper motor controlled air bleed valve - to provide an air bleed past the throttle plate. This avoids interfering with the cruise control system. By designing the air bleed to provide a suitable restriction, you avoid any issues about giving the engine excessive throttle. (When it is off load and at small throttle openings the engine is extremely sensitive to small changes in throttle position.)

The Megasquirt web site suggests some sources for the idle control valve and describes how to drive them. They are inexpensive, easy to plumb in for most installations, and electrically straight forward.

I appreciate your help! I had actually thought about using an air bleed system, or even tapping into the vehicles ISC module.
However, with my rig, reliability is key, and I don't want to compromise any part of the electrical/engine management system. That's why I've decided to control the cruise actuator, as it's simply "pressing the gas pedal" for me. That allows for the engine management system to remain in full control, and untouched.
If my system has a problem, I'll simply unplug it, without having to worry about what else it may be affecting. Just trying to limit myself somewhat!

You may want to look at using a servo for the throttle control.

zoomkat:
You may want to look at using a servo for the throttle control.

Can you elaborate on this, please?

Can you elaborate on this, please?

A servo can be commanded to push/pull linkage to specific positions (or rotate to specific positions). May be easier than using a stepper motor.

zoomkat:

Can you elaborate on this, please?

A servo can be commanded to push/pull linkage to specific positions (or rotate to specific positions). May be easier than using a stepper motor.

I understand that. However, my point is that the cruise control actuator that came installed on my vehicle from the factory, does exactly what I'm wanting to do. Whenever you are driving down the road with the cruise control on, it is holding the vehicles speed by controlling the throttle. As the load increases (you start going up a hill), the actuator will apply more throttle to hold that speed.

The only thing that I am wanting to do differently, is hold a set RPM instead of a set Speed. Instead of monitoring the vehicles speed sensor to vary the throttle, I just want to monitor the tach signal, and actuate the throttle accordingly. That is just a change on the coding side, and should have nothing to do with the mechanical side (actuator), as we already know that it can actuate the throttle.

When I first thought about this project, I did contemplate using a simple RC servo, but then I would run into issues of it being powerful enough, sealing it from the elements, hooking up a cable assembly to run to the throttle body..ect. I just didn't see a point in reinventing the wheel (so to say) on the mechanical side of this.

I'll post up pictures of the motor assembly tonight.

Here is my parts list to order:

Arduino Uno - R3 - http://www.sparkfun.com/products/11021

Pololu Motor Controller - Pololu Simple High-Power Motor Controller 18v15 (Fully Assembled)

Does anyone see any problem with using the Arduino Uno R3 with that motor controller?

Also, take a look at this video I found on Youtube. This guy is using the Arduino and a home-made H-bridge to control a cruise control actuator. This is exactly what I am wanting to do, except have the Arduino sense a tach signal instead of the potentiometer that he is using in the video:

Thanks for your suggestions, and keep them coming! 8)

Have you got a reliable tach signal? That's something that can prove quite tricky to get accurate, because the coil LT signal is very dirty. This is another area where the Megasquirt site has some very useful suggestions and circuit diagrams.

Instead of monitoring the vehicles speed sensor to vary the throttle, I just want to monitor the tach signal, and actuate the throttle accordingly.

What are the technical differences between the speed sensor output and tach outputs? In what form is the speed sensor output?

PeterH:
Have you got a reliable tach signal? That's something that can prove quite tricky to get accurate, because the coil LT signal is very dirty. This is another area where the Megasquirt site has some very useful suggestions and circuit diagrams.

I'll take a look at the megasquirt site. I would think there is at least one place to get a reliable tach signal on my rig, since the ECU is controlling the ignition, and driving a tachometer that is in the factory gauge cluster. That's my next step.

Ok, I pulled off my factory cruise control actuator, and in true Land Cruiser fashion, it's WAY overbuilt.

Here are pics:

All of the drive gears are metal, the electric motor (huge) uses very nice bronze bushings for the worm gear, and that worm gear is actually driving a massive round gear that is located underneath the plastic cover (where you're seeing all of the wires).
The plastic gears that you are seeing are only part of the encoder system (I'm guessing that's an encoder system, anyone know for sure?).

Here is the wiring diagram for that system:

I just happened to have a cruise control actuator from a newer toyota truck laying in my garage :stuck_out_tongue:

This unit appears to be the exact same unit that the guy in the youtube video is using. There is a NOTICEABLE difference in quality. Everything is plastic, the cover had to be pried off by breaking some little plastic tabs, all of the gears are plastic, the electric motor is about 1/4 of the size..ect. But, it does work...

Here are some pics/comparison shots:

As you can see, the newer cruise actuator only has a 4-wire electrical connector. Appears to be much more simple, but I'd rather use my original if possible...

What are your thoughts on all of this? Recognize anything in those pics?

Each actuator has what looks to be a standard electric motor that has 2 electrical connectors. The rest of the wires appear to be for an encoding system.

Question for you: What is the maximum authority of that cruise control system? I mean, if your control algorithm messes up or a wire falls off or whatever, and the control goes to its mechanical end stops, how much throttle are you going to get? My guess is that if you have enough authority to maintain cruising speed there's going to be a lot of throttle there, enough to get you into a lot of trouble if this thing throws a wobbler while you're driving.

The alternative approach of putting an idle control valve on it, feels like a much safer bet to me. In fact, I think it's pretty certain that you already have an idle control valve since it's obviously a modern vehicle.

PeterH:
Question for you: What is the maximum authority of that cruise control system? I mean, if your control algorithm messes up or a wire falls off or whatever, and the control goes to its mechanical end stops, how much throttle are you going to get? My guess is that if you have enough authority to maintain cruising speed there's going to be a lot of throttle there, enough to get you into a lot of trouble if this thing throws a wobbler while you're driving.

The alternative approach of putting an idle control valve on it, feels like a much safer bet to me. In fact, I think it's pretty certain that you already have an idle control valve since it's obviously a modern vehicle.

The cruise control actuator can provide ~80% throttle, if required. I've stated that this will only be used as an "active" high-idle circuit to run an air compressor that requires ~1500 engine RPM to be efficient. Therefor, the problem that you're referring to does not apply in this case, as the high-idle circuit is only used when the vehicle is parked. Say the actuator does go AWOL while the high-idle circuit is powered; I simply flip the switch on the dash, disabling power to the circuit.

My vehicle does have an idle control valve on the throttle body, but for reasons mentioned earlier, I do not want to tap into anything that could cause reliability issues down the road.

For the tach signal, you could put a magnet on the compressor pulley and determine rpm with a Hall Effect sensor. The other choice would be to use a Schmidt Trigger to get a square wave from your spark coil trigger circuit.

Ideally, you need feedback from your throttle control, otherwise it will be difficult to regulate the throttling up and down. Without feedback you will probably get off-on type response instead of a percentage type response.

cyclegadget:
For the tach signal, you could put a magnet on the compressor pulley and determine rpm with a Hall Effect sensor. The other choice would be to use a Schmidt Trigger to get a square wave from your spark coil trigger circuit.

Ideally, you need feedback from your throttle control, otherwise it will be difficult to regulate the throttling up and down. Without feedback you will probably get off-on type response instead of a percentage type response.

My rig already has a crank position sensor, as well as a cam position sensor. Both of those feed the vehicle's ECU, so I would imagine one of those would work for the arduino as well.

Here's the thing about the throttle control code that I'm not sure about. I'm envisioning something like this:

SET TARGET RPM TO 1500

DO
READ TACH SIGNAL (RPM)
IF RPM < 1500, ADVANCE MOTOR (PWM Signal that will open throttle)
ELSE, DECREASE MOTOR (PWM Signal that will close throttle)
LOOP every 15-20ms?

I realize that's not code, but rather a way to convey what I have in my mind. It seems to me, that a program like that wouldn't need feedback from the electric control motor, as the RPM will basically be the feedback. The more that electric control motor opens the throttle, the higher the RPM will be, and so forth.

Let me know what you all think of this program idea!

Thanks!