Pages: 1 [2]   Go Down
Author Topic: Using electric motor to control engine speed on gas motor  (Read 3160 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. 
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12569
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Greenville, IL
Offline Offline
Edison Member
*
Karma: 15
Posts: 1328
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


  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.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


  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!
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12569
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If it's only to be used when stationary then the only risk would be bouncing the engine off the rev limiter, which I assume you're happy with. (There's no reason to expect any great harm from that as long as you don't leave it like that for more than a couple of seconds.) You still need to ensure that there's no way for the idle control system to engage when you're driving. (On some systems, simply switching off the electrics isn't enough and the idle control valve has to be positively driven to a 'rest' position since they can creep over time if left powered off with the engine running.)

The existing crank and cam position sensors will probably be MVR sensors. These produce a low voltage pulse as a metal tooth goes past the magnetic sensor. The signal from these is highly speed dependent and there's a risk that by putting another A/D on them in parallel with the one inside the ECU, you could pull the signal down to the extent that the ECU has trouble detecting the signal during cranking. Detecting the RPM off the ECU's tacho driver output would be 'safer' (from the point of view of possibly interfering with the operation of the ECU), if your ECU provides one. If the tacho is driven directly from the ignition low tension circuit then it's also possible to get an RPM signal off that but you'll need to do more work to clean up the signal, either in a hardware filter or in software.

I suspect you will find the engine can be provoked into idle instability if you use a simple proportional control algorithm as you describe. I recommend using a PID control algorithm and play around with the PID components until you get a stable well-damped engine response.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If it's only to be used when stationary then the only risk would be bouncing the engine off the rev limiter, which I assume you're happy with. (There's no reason to expect any great harm from that as long as you don't leave it like that for more than a couple of seconds.) You still need to ensure that there's no way for the idle control system to engage when you're driving. (On some systems, simply switching off the electrics isn't enough and the idle control valve has to be positively driven to a 'rest' position since they can creep over time if left powered off with the engine running.)

The existing crank and cam position sensors will probably be MVR sensors. These produce a low voltage pulse as a metal tooth goes past the magnetic sensor. The signal from these is highly speed dependent and there's a risk that by putting another A/D on them in parallel with the one inside the ECU, you could pull the signal down to the extent that the ECU has trouble detecting the signal during cranking. Detecting the RPM off the ECU's tacho driver output would be 'safer' (from the point of view of possibly interfering with the operation of the ECU), if your ECU provides one. If the tacho is driven directly from the ignition low tension circuit then it's also possible to get an RPM signal off that but you'll need to do more work to clean up the signal, either in a hardware filter or in software.

I suspect you will find the engine can be provoked into idle instability if you use a simple proportional control algorithm as you describe. I recommend using a PID control algorithm and play around with the PID components until you get a stable well-damped engine response.


As far as any risk when driving, the control actuator will be powered through a toggle switch (and relay), so when that switch is off, there is no way it can be powered.


For tach signal, I'm thinking that the tachometer drive signal will be a good one to use.  If I can't use that one, I'll probably add a hall-effect sensor to the Air Compressor Pulley.  That would actually work pretty well I think.  Still digging through wiring diagrams right now.


For the coding, I can see that a PID algorithm would be best.  Honestly, my coding experience is pretty low, but I think I can figure it out.  My proportional control algorithm would work, I think, and could possibly be tuned for some stability. 
Do you happen to have something in mind for a PID Algorithm?


Logged

Greenville, IL
Offline Offline
Edison Member
*
Karma: 15
Posts: 1328
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



  There is a PID library or code in the "playground" I believe.

 One suggestion, fuse every connection that might hurt your vehicles electrical. By that I mean if you need 2 amps put in a 2amp fuse and not a 30. Your first test or two may not go right on the first try.
Logged


Ontario, Canada
Offline Offline
Full Member
***
Karma: 0
Posts: 175
That's me in the avatar. :D
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



  There is a PID library or code in the "playground" I believe.

 One suggestion, fuse every connection that might hurt your vehicles electrical. By that I mean if you need 2 amps put in a 2amp fuse and not a 30. Your first test or two may not go right on the first try.

In addition to properly fused, make sure you're final design is heatshrunk and weatherproofed properly. You'd be surprised where water and salt can make it to in a vehicle!
Get a relay with a weatherpack connector if you can.
Logged

Electrical Engineering Student

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Found the PID Library, and I look forward to using it!  Thanks for that advice.

I think it will work well for my application, escpecially since the coder used a "vehicle cruise control" as his explanation example!   smiley-grin
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Still chugging away on this.  I've actually got it working via control from a potentiometer!

I've not even busted out the Arduino yet.  Control is being done through a Pololu JRK Motor Controller, which has Feedback, as WELL as a PID Algorithm for control.  How easy is that?  Programming is done through a Configuration Utility (GUI), and couldn't be any more simple.

Here is a crappy video I put together for some friends that were interested in this project:






My next step is to utilize the Arduino to read the vehicles "tach" signal, and issue Target commands to the JRK Controller.
Logged

Pages: 1 [2]   Go Up
Jump to: