Jump to content
Bullnose Forums

Musings On Speed Control via Arduino


Recommended Posts

As some of you know, I'm having fits with the speed control on Big Blue. I'm almost to the point that I have nothing else to try. So I'm thinking about using an Arduino microprocessor to replace the speed control module (amplifier). And this thread is to document some of my thinking.

The Arduino would plug in exactly where the current speed control plugs in and be a plug & play replacement. That would allow going back, if needed. But, there would also be another connector that would bring in other functions, like allowing the Arduino to run the fuel gauge by monitoring the fuel tank switch and then using the right mapping table for the tank in use.

I have a Word document that I'm working on in the background and I've thought about embedding it here, but let me try to summarize.

First, these are the inputs to the speed control:

  • Power

  • Ground

  • Horn Pad Output

  • Vehicle Speed Sensor + & -

  • Servo Position

  • BOO: Brake on/off

And here are the outputs:

  • Servo Potentiometer Power & Ground

  • Servo Power

  • Vent Valve

  • Vacuum Valve

And the way I see it working is that there will be two interrupts:

  • VSS: Each pulse of the VSS will cause an interrupt, and the routine will determine the time from the last interrupt, which gives speed, and the delta in time from previous interrupts which gives acceleration/deceleration. And those parameters will be saved.

  • Switches: Pushing on any of the horn pad switches will cause an interrupt, and the routine will then figure out which switch was pushed and then cause the right flag to be set and the proper parameters to be saved. For instance, if Set is pushed the routine will grab the current speed and make it the set point for the controller.

And the background routine will monitor the flags and cause the right things to happen. For instance, if the "ON" flag is set the controller routine will be called, but not if the flag is not set.

Speaking of the controller routine, that will be a PID routine from the Arduino library. You can read up on proportional/integral/derivative controllers, but they are very standard in control systems and are a perfect fit for a speed control. But having fully tested PID code for an Arduino available makes this project much easier. In reality the hardest part will be tuning the three parameters (Kp, Ki, & Kd) which tune the PID controller.

And speaking of that, the Arduino will have a USB connector which will allow me to tune those parameters on the fly via this tablet. (And it will let me tailor the fuel level tables on the fly as well, but that's another subject.)

Anyway, that's probably enough for now. If someone is interested in the flow charts I have to this point I can share the Word document, but it is both rough and ever-changing.

 

Link to comment
Share on other sites

  • Replies 22
  • Created
  • Last Reply

Top Posters In This Topic

Gary, just for the heck of it, you have one of the latest versions of the speed control module (the red one) it is from a 1994 Taurus and I think 1995 was probably the last year to use it. Why don't you try that one once you get the speedometer and cable issue resolved.
Link to comment
Share on other sites

Gary, just for the heck of it, you have one of the latest versions of the speed control module (the red one) it is from a 1994 Taurus and I think 1995 was probably the last year to use it. Why don't you try that one once you get the speedometer and cable issue resolved.

I'll do that, Bill. In fact, as I walked by it this afternoon I thought "That thing is red - is it really that different?" So, I do plan to try it. Perhaps it has some better logic in it?

On the one hand, I'd love to do an Arduino to create a speed control that beats what the Bullnose speed controls do, hands down. But, I would be thrilled if the changes I've made suddenly "click" and things start working nicely. I have plenty of other things to do.

Having said that, a PID controller wouldn't be all that hard to do..... :nabble_thinking-26_orig:

Link to comment
Share on other sites

I'll do that, Bill. In fact, as I walked by it this afternoon I thought "That thing is red - is it really that different?" So, I do plan to try it. Perhaps it has some better logic in it?

On the one hand, I'd love to do an Arduino to create a speed control that beats what the Bullnose speed controls do, hands down. But, I would be thrilled if the changes I've made suddenly "click" and things start working nicely. I have plenty of other things to do.

Having said that, a PID controller wouldn't be all that hard to do..... :nabble_thinking-26_orig:

Took my truck for a drive today and observed the cruise control.

I see where you’re coming from, even with the C6 to soften it up, it’s aggressive. I guess I’ve always sped back up close then engage it. I do that with the Xterra too.

But using the buttons to slow down or speed up is annoying!

Link to comment
Share on other sites

Took my truck for a drive today and observed the cruise control.

I see where you’re coming from, even with the C6 to soften it up, it’s aggressive. I guess I’ve always sped back up close then engage it. I do that with the Xterra too.

But using the buttons to slow down or speed up is annoying!

Dane - I've driven Blue several times in the last few days and find that Ford's speed control systems have come a long, long way since the Bullnose era. The ability to push a button once and get a speed up/down of 1 MPH, and gently I should add, is wonderful. And hitting resume when you are several MPH below doesn't get you WOT, or as close as it can, which my Bullnose units have done. Plus, as you crest a hill it doesn't over react and cut the throttle too much and then come back in with more throttle than needed.

I can see how the PID routine can make it so much better. Here's a slightly modified version of what Wikipedia says about the P, I, and D portions of the controller:

  • Term P is proportional to the current value of the Set Point − Current Speed error. For example, if the error is large and positive, the control output will be proportionately large and positive, taking into account the gain factor "K". Using proportional control alone will result in an error between the setpoint and the actual speed because it requires an error to generate the proportional response. If there is no error, there is no corrective response.

  • I accounts for past values of the Set Point − Current Speed error and integrates them over time to produce the I term. For example, if there is a residual SP − CS error after the application of proportional control, the integral term seeks to eliminate the residual error by adding a control effect due to the historic cumulative value of the error. When the error is eliminated, the integral term will cease to grow. This will result in the proportional effect diminishing as the error decreases, but this is compensated for by the growing integral effect.

  • D is a best estimate of the future trend of the Set Point − Current Speed error, based on its current rate of change. It is sometimes called "anticipatory control", as it is effectively seeking to reduce the effect of the SP − CS error by exerting a control influence generated by the rate of error change. The more rapid the change, the greater the controlling or damping effect.

In the setup of the controller you specify values for three parameters: Kp for the proportional calc's; Ki for the integral; and Kd for the derivative. But these parameters can be adjusted on the fly - in the case of an Arduino that can be done via a USB or Bluetooth connection from a computer or phone.

To put it another way, Kp determines its initial reaction to hitting Resume when you are 20 MPH below the set point. Ki determines what happens during the run-up to the set point - does it continue to add more throttle because you are still below the set point? And Kd says "wait a minute, we are approaching the set point so let's back off just a bit so we don't overshoot."

But while this would be a really fun project, I do have a few other things I want to do, so I'd be thrilled if I found that the latest changes to Big Blue make his speed control work acceptably. Or if Bill's red module does. So I'm not running off to buy the Arduino. But, I am thinking through how to do it.

And a couple of those thoughts are:

  • Connections: How to cleanly connect to the existing harness is a concern as I don't want to chop the connectors off and solder in. One thought is to use a speed control module's board but strip off the components and solder to the traces. Another is to use a purpose-made cable, like those from the speed control testers.

  • Placement: It would be ideal if the Arduino could go where the current speed control module goes, but I think it'll be too big for that. So I'm thinking that placing it where the center speaker would go, under the dash pad, would work and run a USB cable down to the ash tray area for connecting to it.
Link to comment
Share on other sites

Dane - I've driven Blue several times in the last few days and find that Ford's speed control systems have come a long, long way since the Bullnose era. The ability to push a button once and get a speed up/down of 1 MPH, and gently I should add, is wonderful. And hitting resume when you are several MPH below doesn't get you WOT, or as close as it can, which my Bullnose units have done. Plus, as you crest a hill it doesn't over react and cut the throttle too much and then come back in with more throttle than needed.

I can see how the PID routine can make it so much better. Here's a slightly modified version of what Wikipedia says about the P, I, and D portions of the controller:

  • Term P is proportional to the current value of the Set Point − Current Speed error. For example, if the error is large and positive, the control output will be proportionately large and positive, taking into account the gain factor "K". Using proportional control alone will result in an error between the setpoint and the actual speed because it requires an error to generate the proportional response. If there is no error, there is no corrective response.

  • I accounts for past values of the Set Point − Current Speed error and integrates them over time to produce the I term. For example, if there is a residual SP − CS error after the application of proportional control, the integral term seeks to eliminate the residual error by adding a control effect due to the historic cumulative value of the error. When the error is eliminated, the integral term will cease to grow. This will result in the proportional effect diminishing as the error decreases, but this is compensated for by the growing integral effect.

  • D is a best estimate of the future trend of the Set Point − Current Speed error, based on its current rate of change. It is sometimes called "anticipatory control", as it is effectively seeking to reduce the effect of the SP − CS error by exerting a control influence generated by the rate of error change. The more rapid the change, the greater the controlling or damping effect.

In the setup of the controller you specify values for three parameters: Kp for the proportional calc's; Ki for the integral; and Kd for the derivative. But these parameters can be adjusted on the fly - in the case of an Arduino that can be done via a USB or Bluetooth connection from a computer or phone.

To put it another way, Kp determines its initial reaction to hitting Resume when you are 20 MPH below the set point. Ki determines what happens during the run-up to the set point - does it continue to add more throttle because you are still below the set point? And Kd says "wait a minute, we are approaching the set point so let's back off just a bit so we don't overshoot."

But while this would be a really fun project, I do have a few other things I want to do, so I'd be thrilled if I found that the latest changes to Big Blue make his speed control work acceptably. Or if Bill's red module does. So I'm not running off to buy the Arduino. But, I am thinking through how to do it.

And a couple of those thoughts are:

  • Connections: How to cleanly connect to the existing harness is a concern as I don't want to chop the connectors off and solder in. One thought is to use a speed control module's board but strip off the components and solder to the traces. Another is to use a purpose-made cable, like those from the speed control testers.

  • Placement: It would be ideal if the Arduino could go where the current speed control module goes, but I think it'll be too big for that. So I'm thinking that placing it where the center speaker would go, under the dash pad, would work and run a USB cable down to the ash tray area for connecting to it.

Gary, one of the things to understand, the newer speed control is now part of the PCM (Powertrain Control Module) so it now has the capability to, in addition to opening the throttle, upshift or downshift the transmission as needed. This allows the system to be aggressive if you are well under the set speed and when coasting downhill, downshift the transmission to control speed.

The first one of these I experienced was in our 2003 Chrysler Town and Country minivan. If I had it on cruise and entered one of the tunnels on the CBBT with no yankee tourons in the way, it would drop from 4th to 3rd if the speed went much over the set point. With a manual transmission you won't get that. The two Flexes are the same way, but, if I have speed set at say 58 mph, have to slow way down or stop for a light, and hit resume early, say 35 - 40 mph, it will still accelerate aggressively, possible downshifting and a lot of throttle. Since the engines are the Duratech 3.5L, they like Blue, will wind up like one on the old Hi Po 289s (upshift at roughly 6K).

Trivia item, the Flex transaxle is a 6F50 and is also used by GM as a 6T50.

Link to comment
Share on other sites

Gary, one of the things to understand, the newer speed control is now part of the PCM (Powertrain Control Module) so it now has the capability to, in addition to opening the throttle, upshift or downshift the transmission as needed. This allows the system to be aggressive if you are well under the set speed and when coasting downhill, downshift the transmission to control speed.

The first one of these I experienced was in our 2003 Chrysler Town and Country minivan. If I had it on cruise and entered one of the tunnels on the CBBT with no yankee tourons in the way, it would drop from 4th to 3rd if the speed went much over the set point. With a manual transmission you won't get that. The two Flexes are the same way, but, if I have speed set at say 58 mph, have to slow way down or stop for a light, and hit resume early, say 35 - 40 mph, it will still accelerate aggressively, possible downshifting and a lot of throttle. Since the engines are the Duratech 3.5L, they like Blue, will wind up like one on the old Hi Po 289s (upshift at roughly 6K).

Trivia item, the Flex transaxle is a 6F50 and is also used by GM as a 6T50.

Yes, the speed control is part of the PCM, and the PCM certainly has the ability to shift gears on an automatic tranny. Blue does that, Janey's GLK does, etc.

But there's also been a huge change, progression really, in the "smarts" of the speed control. The Bullnose units appear to do the "proportional" bit of a PID controller, only. There's no integral nor derivative, or at least if there are those components then they are poorly implemented. But Blue's control is smooth. Somehow in the last 30 years between those two systems things progressed nicely.

Link to comment
Share on other sites

Yes, the speed control is part of the PCM, and the PCM certainly has the ability to shift gears on an automatic tranny. Blue does that, Janey's GLK does, etc.

But there's also been a huge change, progression really, in the "smarts" of the speed control. The Bullnose units appear to do the "proportional" bit of a PID controller, only. There's no integral nor derivative, or at least if there are those components then they are poorly implemented. But Blue's control is smooth. Somehow in the last 30 years between those two systems things progressed nicely.

When you consider (a) how far computers have come since the 80s (Apple II, RadioShack TRS 80 etc.) and how far the computers in cars have come, Ford EEC-III, EEC-IV, EEC-V and beyond, Chrysler LM-PM, SMEC, SBEC, SBEC-II and beyond and (b) how small that little black or red box is in relation to the newer PCMs and finally © are the valves PWM or simply open and close? The reason for the last is the early EFI EGR controls were a two valve, vacuum and vent and under certain conditions would "chatter" trying to find the optimum position, later systems use a PWM control.

Link to comment
Share on other sites

When you consider (a) how far computers have come since the 80s (Apple II, RadioShack TRS 80 etc.) and how far the computers in cars have come, Ford EEC-III, EEC-IV, EEC-V and beyond, Chrysler LM-PM, SMEC, SBEC, SBEC-II and beyond and (b) how small that little black or red box is in relation to the newer PCMs and finally © are the valves PWM or simply open and close? The reason for the last is the early EFI EGR controls were a two valve, vacuum and vent and under certain conditions would "chatter" trying to find the optimum position, later systems use a PWM control.

Yes, things have come a LONG ways since the 80's. And there's more to come - wait for a later post.

On the valves, the Vent valve is held closed to keep the vacuum in the servo and opened to release vacuum/slow down. The Vacuum valve is opened to add vacuum to the servo and, therefore, accelerate.

As for PWM, I'll have to put the 'scope on the control lines to see what the signals look like. But I assume that they just are popped as needed.

Now for the news. My nephew called to discuss GMRS radios as he is buying some. In the course of the conversation I told him about the possibility of building a speed control and he told me that he's discontinued using Arduinos. Instead he's using D1 Minis, which are "the size of a postage stamp" and have WIFI built in. He puts a power supply board (shield) under it and a MOSFET shield above it and away he goes. You can load the sketches over WIFI, change the parameters, watch what it is doing, etc.

He has one set up to plug into a cigarette lighter and monitor voltage or other parameters, and it reports it to him via a Blynk server so he can pull its output up any time he wants on his phone. He has others set up to open his garage doors and he sends the commands via Siri and the Blynk server.

So he thinks the speed control and fuel gauge applications are perfect for one of these. He is an ME so understands PID controllers better than I, but I explained my plans and he concurs.

More later.....

Link to comment
Share on other sites


×
×
  • Create New...