Jump to content
Bullnose Forums

Musings On Speed Control via Arduino


Recommended Posts

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

Ok, I promised more on the D1 Mini. First, here's a pic of the one he uses to open the garage door. He says "Siri, open the shop door" and Siri send a signal from his iPhone to the Blynk server to tell the Mini to open the door. That comes back down the internet, hits his wifi, and the Mini picks it up and closes the relay contact.

D1_Mini_with_Relay_Shield.thumb.jpg.49c827a6b3714e1042aad28702300c46.jpg

Yes, they are small - 1.01" wide and 1.35" long. And cheap - from $7 to $11 gets you one with 4 meg to 16 meg. Or, how about two of them plus two relay shields for $13? Or, maybe a 4-channel MOSFET shield for $6 that can drive up to 5 amps on each channel? Let's see, one for the Vent valve, one for the Vacuum valve, one for the fuel gauge, and one spare? :nabble_smiley_evil:

So, I'm thinking that one of these with a power shield (board) on the bottom and a MOSFET shield on the top will fit easily in the case of speed control amplifier. Take the old components off the speed control's board and use the board's edge connector for connection to the truck's harness. Plug and play.

Add a connector to get the fuel tank switch's output, the senders, and the lead to the gauge and you can have a Meter Match equiv that has a table for each tank, and you can program it will driving. Fill the tank and cause the gauge to read Full. Calculate the usage at several mile points based on your normal MPG and when you hit that mile point make the gauge read where it probably should.

Link to comment
Share on other sites

  • Replies 22
  • Created
  • Last Reply

Top Posters In This Topic

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

This sort of thing should be up my alley, as I did a lot embedded Atmel AVR programming in college, to include on Arduino (which uses an AVR328C in the older versions), although I was using ANSI C, not "dummied down" Arduino language. I also took and aced a class on control systems in my senior year of college (for an EET degree). I've lost many details but know the concepts, so here goes

I'm pretty sure the cruise in my bullnose is using some sort of PID... it's just not tuned too well (or is hampered by external factors). Same experience where it falls on it's face at interstate speed (always want's to gear down) and overreacts on hills a lot (have to do a lot manual shifting in and out of OD if I dare use cruise). Although to be honest, that may be more a reflection on the performance (or lack therof) of my 300 and the stock 3.08 rear end.

Some of the limitations I think have more to do with the usage of a vacuum servo for the throttle instead of the newer electric motor/spool setup (like my 1995 Ranger has). The motorized setup is more responsive and being run of the electrical system, is better regulated. The issue that vacuum systems can have is loss of vacuum under high throttle... the check valve and reservoir helps mitigate this, but it's still an inherently imprecise system in comparison.

Having had the 84's vacuum module apart, you will have two solenoids (vacuum in, vacuum out) and a potentiometer (for plunger position). It's effectively two control systems at the same time; one for the speed control (PID), and another for regulating throttle position via vacuum (2-way control, since the solenoids aren't variable orifice). The PID's input is a sensor on speedo cable, either a hall effect tonewheel (like used for ABS, frequency modulated), or a rotating inductor type (which can either be used to generate a frequency or voltage, depending on the input circuitry), and it's output (throttle position or %) is the input of the 2-way control that modulates the vacuum servo to get the correct voltage out of the potentiometer. Killing the system when brakes applied is inferred by the controller seeing that the plunger position (potentiometer voltage) isn't responding to additional vacuum supply (due to the vacuum release on the brake pedal opening); I've had it drop out under excessive load which I think is this "feature" at work. Thus, there is no electronic BOO switch. I'm pretty sure the steering wheel buttons are single wire input with variable resistor values; this is used with an appropriatly sized pull up/pull down resistor and analog input (constantly poll the ADC).

I've seen PWM tossed around... the bullnose system doesn't use it. PWM (in controls usage) is for variable control of DC devices (not the case here, since the solenoids are "digital"). It can also be used for communication (like Ford's implementation of OBDII on EECV), but with only one controller at play (without a means for external programming/debugging), there's no reason for it.

 

Link to comment
Share on other sites

This sort of thing should be up my alley, as I did a lot embedded Atmel AVR programming in college, to include on Arduino (which uses an AVR328C in the older versions), although I was using ANSI C, not "dummied down" Arduino language. I also took and aced a class on control systems in my senior year of college (for an EET degree). I've lost many details but know the concepts, so here goes

I'm pretty sure the cruise in my bullnose is using some sort of PID... it's just not tuned too well (or is hampered by external factors). Same experience where it falls on it's face at interstate speed (always want's to gear down) and overreacts on hills a lot (have to do a lot manual shifting in and out of OD if I dare use cruise). Although to be honest, that may be more a reflection on the performance (or lack therof) of my 300 and the stock 3.08 rear end.

Some of the limitations I think have more to do with the usage of a vacuum servo for the throttle instead of the newer electric motor/spool setup (like my 1995 Ranger has). The motorized setup is more responsive and being run of the electrical system, is better regulated. The issue that vacuum systems can have is loss of vacuum under high throttle... the check valve and reservoir helps mitigate this, but it's still an inherently imprecise system in comparison.

Having had the 84's vacuum module apart, you will have two solenoids (vacuum in, vacuum out) and a potentiometer (for plunger position). It's effectively two control systems at the same time; one for the speed control (PID), and another for regulating throttle position via vacuum (2-way control, since the solenoids aren't variable orifice). The PID's input is a sensor on speedo cable, either a hall effect tonewheel (like used for ABS, frequency modulated), or a rotating inductor type (which can either be used to generate a frequency or voltage, depending on the input circuitry), and it's output (throttle position or %) is the input of the 2-way control that modulates the vacuum servo to get the correct voltage out of the potentiometer. Killing the system when brakes applied is inferred by the controller seeing that the plunger position (potentiometer voltage) isn't responding to additional vacuum supply (due to the vacuum release on the brake pedal opening); I've had it drop out under excessive load which I think is this "feature" at work. Thus, there is no electronic BOO switch. I'm pretty sure the steering wheel buttons are single wire input with variable resistor values; this is used with an appropriatly sized pull up/pull down resistor and analog input (constantly poll the ADC).

I've seen PWM tossed around... the bullnose system doesn't use it. PWM (in controls usage) is for variable control of DC devices (not the case here, since the solenoids are "digital"). It can also be used for communication (like Ford's implementation of OBDII on EECV), but with only one controller at play (without a means for external programming/debugging), there's no reason for it.

If the speed control is using PID then it has poor tuning. Sure would be nice to be able to change Kp, Ki, and Kd. (Which I will easily be able to do if I go with a microcontroller.)

I, too, had a control systems class, including PID's, but that was probably before you were born. So I don't remember a lot of it. But what I do remember says that it isn't difficult to dial a system in if you go about it systematically. This page has a couple of suggestions on how to approach that. But Crossco has a good explanation of what each parameter does as well as suggestions for how to start tuning.

As for the vacuum servo being part of the problem, I don't think so. I had an all-vacuum Dana cruise control system back in the late 70's and it worked superbly. It came with different orifices for tuning things as well as some potentiometers, and I was able to dial it in just like I liked it on an Audi 100LS with a manual transmission.

But speaking of manual transmissions, Big Blue will cruise up just about any hill around here in OD on speed control. And I've seen a steady 2" of vacuum on the gauge while doing it. So the system is quite capable of opening the throttle plenty far enough, and holding it there for an extended period.

On the control buttons, you are right. It appears the speed control module has a pull-up and most of the control switches have a fixed resistor to ground. So when that button is pushed you get a specific voltage, which the microcontroller will read on an analog-in pin. But the On switch takes the input to battery voltage so I'll have to put a zener diode on that to limit it to the max the input can handle. And Off grounds the input.

However there is a BOO input. In the diagram below you can see it in the upper left, with the brake switch in series to the clutch switch. I think the way it works is that the module has a pull-up resistor but the clutch switch keeps that input connected to the resistance of the brake lights, so with the clutch engaged the module sees 0V. But if the clutch clutch switch opens the pull-up takes the voltage to 12v and the system is disengaged. And if the brake switch is closed the input sees 12v and the system is disengaged. I'll probably put that on an interrupt and when it goes high reset the "On" flag.

135573774.thumb.jpg.44dbeebf75334dbd152065747c676c46.jpg

Link to comment
Share on other sites

If the speed control is using PID then it has poor tuning. Sure would be nice to be able to change Kp, Ki, and Kd. (Which I will easily be able to do if I go with a microcontroller.)

I, too, had a control systems class, including PID's, but that was probably before you were born. So I don't remember a lot of it. But what I do remember says that it isn't difficult to dial a system in if you go about it systematically. This page has a couple of suggestions on how to approach that. But Crossco has a good explanation of what each parameter does as well as suggestions for how to start tuning.

As for the vacuum servo being part of the problem, I don't think so. I had an all-vacuum Dana cruise control system back in the late 70's and it worked superbly. It came with different orifices for tuning things as well as some potentiometers, and I was able to dial it in just like I liked it on an Audi 100LS with a manual transmission.

But speaking of manual transmissions, Big Blue will cruise up just about any hill around here in OD on speed control. And I've seen a steady 2" of vacuum on the gauge while doing it. So the system is quite capable of opening the throttle plenty far enough, and holding it there for an extended period.

On the control buttons, you are right. It appears the speed control module has a pull-up and most of the control switches have a fixed resistor to ground. So when that button is pushed you get a specific voltage, which the microcontroller will read on an analog-in pin. But the On switch takes the input to battery voltage so I'll have to put a zener diode on that to limit it to the max the input can handle. And Off grounds the input.

However there is a BOO input. In the diagram below you can see it in the upper left, with the brake switch in series to the clutch switch. I think the way it works is that the module has a pull-up resistor but the clutch switch keeps that input connected to the resistance of the brake lights, so with the clutch engaged the module sees 0V. But if the clutch clutch switch opens the pull-up takes the voltage to 12v and the system is disengaged. And if the brake switch is closed the input sees 12v and the system is disengaged. I'll probably put that on an interrupt and when it goes high reset the "On" flag.

And while I'm thinking of Zener diodes, I see the need to them used in three places:

  • BOO: As said, the brake input will go to battery voltage when the brake pedal is pushed, so I need to protect that input with a single-Zener arrangement and a current-limiting resistor, as shown below.

  • Controls: Also mentioned is that pressing On will take that input to battery voltage so will also have to have a single Zener and limiting resistor.

  • VSS: The input signal from the vehicle speed sensor is a sine wave and exceeds 20vp-p at 70 MPH, and is greater than 5v at 30 MPH. But instead of a single Zener I think I'll use a double-Zener arrangement as shown below. That will give me a good approximation of a square wave from the VSS and I should be able to get an interrupt to trigger off the leading edge, allowing me to easily determine speed as well as acceleration or deceleration.

    zener-diode-basic-operation-fig1.jpg.c9320c88afcf674c7d202f78772ae000.jpg

Link to comment
Share on other sites

And while I'm thinking of Zener diodes, I see the need to them used in three places:

  • BOO: As said, the brake input will go to battery voltage when the brake pedal is pushed, so I need to protect that input with a single-Zener arrangement and a current-limiting resistor, as shown below.

  • Controls: Also mentioned is that pressing On will take that input to battery voltage so will also have to have a single Zener and limiting resistor.

  • VSS: The input signal from the vehicle speed sensor is a sine wave and exceeds 20vp-p at 70 MPH, and is greater than 5v at 30 MPH. But instead of a single Zener I think I'll use a double-Zener arrangement as shown below. That will give me a good approximation of a square wave from the VSS and I should be able to get an interrupt to trigger off the leading edge, allowing me to easily determine speed as well as acceleration or deceleration.

In thinking about stuffing a D1 Mini in the speed control's amplifier box I measured it and found that it is 3.925" wide x 2.660" long x 1.196" deep inside. The board sits .711" from the top of the box, so that's not a lot of space above the board for the D1 Mini. But I could cut the board right behind the snaps in the case that hold it in place and have 1 3/4" to the back of the case. However, I'd probably want to just cut out the center of the board, as shown, which gets the 2 1/4" x 1 3/4" space that would be 1" high when the bottom cover is on.

The D1 Mini by itself is only .28" high, but by the time the power supply shield is put on the bottom and the MOSFET shield is put on the top that may be a challenge. http://www.garysgaragemahal.com/uploads/6/5/8/7/65879365/thinking-26_orig.jpg

E7_Speed_Control_Module_In_Case_-_Bottom.thumb.jpg.0fc08b4c89e84f3414c7f8785489ce54.jpg

Link to comment
Share on other sites

In thinking about stuffing a D1 Mini in the speed control's amplifier box I measured it and found that it is 3.925" wide x 2.660" long x 1.196" deep inside. The board sits .711" from the top of the box, so that's not a lot of space above the board for the D1 Mini. But I could cut the board right behind the snaps in the case that hold it in place and have 1 3/4" to the back of the case. However, I'd probably want to just cut out the center of the board, as shown, which gets the 2 1/4" x 1 3/4" space that would be 1" high when the bottom cover is on.

The D1 Mini by itself is only .28" high, but by the time the power supply shield is put on the bottom and the MOSFET shield is put on the top that may be a challenge. http://www.garysgaragemahal.com/uploads/6/5/8/7/65879365/thinking-26_orig.jpg

In the previous post you can see an E7 version of the speed control module. Turns out I have at least three versions of the module: E3; E7; and the F1 that Bill gave me from the Taurus. And all use a chip with Ford #D9AF 14A607, but the E3 version has an A1B suffix while the other two have an A3B suffix, although the manufacturer's number is different between them.

Here they are in the above order. Note that the first two, E3 and E7, appear to have the same board layout. But the F1 has a completely different board. Maybe it has better function?

E3_Speed_Control_Module_-_Top.thumb.jpg.a2eaf7afaabf8f89492a0dac41341141.jpg

E7_Speed_Control_Module_-_Top.thumb.jpg.4c3042c9906075083b6146b2b8030248.jpg

F1_Speed_Control_Module_-_Top.thumb.jpg.a6e671106c07c790908a8dc2a12090e7.jpg

Link to comment
Share on other sites

In the previous post you can see an E7 version of the speed control module. Turns out I have at least three versions of the module: E3; E7; and the F1 that Bill gave me from the Taurus. And all use a chip with Ford #D9AF 14A607, but the E3 version has an A1B suffix while the other two have an A3B suffix, although the manufacturer's number is different between them.

Here they are in the above order. Note that the first two, E3 and E7, appear to have the same board layout. But the F1 has a completely different board. Maybe it has better function?

Did some chatting with my nephew to get measurements on his "stack" of power supply shield, D1 Mini, and bits of the relay shield:

  • To top of terminal strip: .925"

  • To top of relay: 1.220"

That works out very nicely since there appears to be 1.038" between the bottom cover when snapped into place and the top of the box. And since I don't need the terminal strip will will use something like this 4-channel MOSFET shield.

The top of the speed control board is .711" from the top of the box. Judging by the pic below the bottom of the relay shield is .500 from the bottom. And the MOSFET shield says it is .063" thick. So that would mean the whole stack would be .563" and it should fit on top of the speed control board if I just depopulate it.

But what I'm not sure about is how to mount the stack on the speed control board. http://www.garysgaragemahal.com/uploads/6/5/8/7/65879365/thinking-26_orig.jpg

Kirks_Power_Supply__D1_Mini__Relay.thumb.jpg.a274660f9290714456e95db5b47a6217.jpg

Link to comment
Share on other sites

In the previous post you can see an E7 version of the speed control module. Turns out I have at least three versions of the module: E3; E7; and the F1 that Bill gave me from the Taurus. And all use a chip with Ford #D9AF 14A607, but the E3 version has an A1B suffix while the other two have an A3B suffix, although the manufacturer's number is different between them.

Here they are in the above order. Note that the first two, E3 and E7, appear to have the same board layout. But the F1 has a completely different board. Maybe it has better function?

Gary, the difference on the chip is the source, the E3 is a Motorola chip, the other two are something different which would explain the suffix change.

You also have a different pin on one of the tabs on the F1 board, "engage light" which the Taurus did not have, but possibly a Lincoln model did (FiVF is a Lincoln part number prefix).

1991 Town Car with digital cluster has an engage or cruise on indicator.

Link to comment
Share on other sites

Gary, the difference on the chip is the source, the E3 is a Motorola chip, the other two are something different which would explain the suffix change.

You also have a different pin on one of the tabs on the F1 board, "engage light" which the Taurus did not have, but possibly a Lincoln model did (FiVF is a Lincoln part number prefix).

1991 Town Car with digital cluster has an engage or cruise on indicator.

Good catch on the engage light, Bill. But the other two have the brake signal on that pin, as well as the adjacent pin. So, can that module be used in the trucks? :nabble_thinking-26_orig:

The "engage" light will be an output, and the brake will be an input. An output would be a "low" to sink current through a bulb to light it. And the brake input goes to battery voltage when the brakes are applied. So for a brief time when the brake signal goes high the output will still be low. But it would only be a really brief time, like a microsecond, so there would probably not be any damage done.

I think it would probably work. Have you tried it?

Link to comment
Share on other sites

Good catch on the engage light, Bill. But the other two have the brake signal on that pin, as well as the adjacent pin. So, can that module be used in the trucks? :nabble_thinking-26_orig:

The "engage" light will be an output, and the brake will be an input. An output would be a "low" to sink current through a bulb to light it. And the brake input goes to battery voltage when the brakes are applied. So for a brief time when the brake signal goes high the output will still be low. But it would only be a really brief time, like a microsecond, so there would probably not be any damage done.

I think it would probably work. Have you tried it?

Look at the plug, it probably does not have a contact in that location.

 

Link to comment
Share on other sites


×
×
  • Create New...