More than thinking-about Cat-swapping the Disco

I have no idea what any of that means but looking forward to hearing the Cat purrrr.
 
  • Like
Reactions: Ted
One of the things with projects like this is that I can browse around for really cheap prices on parts that work that I can then adapt to attempt to make fit, since I don't have a specific application that I'm needing to match. So, I got a new throttle pedal out of a Chevy drive-by-wire truck (brand new AC Delco part) for under 1/3 of the retail price. Because it's drive by wire, the pedal has dual redundant throttle position sensors built in (each 3-wire - 5V, ground, and signal). When I actually get to the point of putting this in the car and have it doing something, this will be more important. For now, it will let me prove the concept that this will work. I'm probably going to find some cheap signal generators and oscilloscopes (there are some stupidly cheap ones out there that are sufficient for my needs) to help me get this set up.

So, minor progress....

AMSf6AHOSfXZJWmGqaFS629j_OGx1ussWLPWDGBcdsAHLbDi-czE0znltBq1BfqVYs7aRjp7fpSUQvJTo-a9LigKxMr2KtBFQEFENj5vCbR73iILMQSmdrG9RmB3Q_vjlkbRmFs68Oqngn6eMWAodCqD99aR15B1RvtNZoEWd1I0PEKStHcbkZWCu1fHu7n05drvC4zId9xHg1mGzTUj8x_QNxcL9qql7ioDj5clVxs1OtF3sfa1Mlt-wlHJkWgjEcKVAJq9hv_gquPIeWNbESmb5SZD5UIODN91G9YXDC-RA4p7lLyn0mbm9Eu_0SqWO31Y2TTjSiRqURdbPTm1cFjZVggNVHGq5CF6rAbP1R-zkzuvKIPx1HM3-3Xjp18NY-NO5BagB1vCKOP7ZO_3AEuLk1R-cxsI81_s9u-hHPW7NyiC_Y5KkJtm4zUAaeyIgfY5rC_li9AbaU2OXhGMOae5ZvQ06b2EMyrS-g4zFM9jNf_aXfNJO_FQj4XrMmIzKjxlTQ5gWVJchhOD8zOWMMzQ0JlinemwQ5JSLHTbPEtfS1ZpnmIewtvBbMWMimTFuraY1rYzy8euFoJ88KwuEEV9agCsPPr_5PM4EYfZsYUC7q1S-dhEYwOsHAW2ybIM3P5wj6L9QrOBeLE-n3eL5d-kCZ9IJE1rIAucAuvZ6FA8tjva0AO1vk7JVK0XaLJtZ67-4ePJbeIfVxY4CsZZtI6ZPJUh7EMI5_n2x7ImtYMmY9uzyBzPKSbOczjAX7BV6LUATzoN6fhMA5o7nmDqVsBBuzRfcpfgFAccIo7qkY29-cUGdXLFaBPuYeLjtLJ2liAOqHd7TlvmkMHoCUTPCkP9dxffyz1OyaojVoXwLfN9ggx2zX5NnBw44LTroaEkCeNuTUxo4Tik34ZlCFLBrUyYoTHLajVRFygd8E_tP54G-1fvq22EUEZai1yCWBn6Nresf2wR=w1134-h1512
 
Where has a year gone? Oh, right - RV trips, getting the RX-7 on track days, motorcycles, more of the shop, things with the family, a day job. That day job thing is the real pesky item.

With a list of fairly straightforward things that need to be done on the RX-7 and getting the bus back together for the next trip, that splits my upcoming time between the Cobra and the Disco. I've been continuing to manage to limp the Disco's 4.0 along mostly with continuing to put thick oil in it.

The goal remains to get the engine together and running on the stand before I pull the engine out of the Disco and put this in, and adapt all of the other items.

I need to work on the converting a throttle pedal to a PWM input to drive a throttle on the engine, but probably the bigger one I'm researching is the T56 transmission at this point and how I want to rebuild it to make it work. Although the horsepower on this engine is low, its torque (and the associated pulses that go with that torque) is pretty high and so the thought is that I probably am going to want to upgrade the input and mainshafts to the Viper spec to handle the torque. The transmission will also need to get converted to a midshift kit for this to work.

My next step at some point soon with this will probably be to start taking apart the T-56 and evaluating it inside, seeing what needs to be replaced and fully understanding what I'm looking at with this. I'm probably also going to want to make a call to a transmission shop that deals in T56s and get some thoughts on parts to use.
 
Last night I spent some time on the Arduino Uno code to turn a signal from a throttle position sensor into a PWM output from the Arduino to the Cat ECM for a throttle position signal.

I started off with the program I had copied from someone else for the PWM fan controller on the RV, since the concept is the same, it's just taking a resistance voltage and converting that into a percent throttle instead of taking a resistance voltage and turning that into a temperature.

The way I have the code set up there are a good number of variables since I will have to see what is really the limit for full throttle vs. idle (it's not 0% and 100% PWM, documentation shows idle is something in the range of 10-22% and full throttle is 75-90%), and where I want to place bounds on the inputs from the throttle sensor. Since the throttle pedal is two channels, I also am setting it up so that if there's a mismatch of more than a certain percent, it will essentially throw a fault and set the output to idle.

Next step will be to take some measurements on the throttle pedal and figure out its wiring, and then wire it up to see how that works with the Arduino.

One thing that I'm having a hard time figuring out is whether the Arduino can do a sinking output for a PWM (which is what it looks like the ECM is looking for, and I think the answer is no. So if I understand how those electrons work correctly, I'll need to add in a transistor to make that work.

The Cat ECM from what I can tell is looking for this PWM signal within 150ms of power-on. The Arduino with its bootloader takes about 2 seconds to start up and start running the program and providing an output. However, it's possible to remove the bootloader. I think in an ideal world this would be what I'd want, since the goal would be to have the car work like a normal car - turn the key, engine starts, you can drive off, rather than having to flip a switch, wait a couple of seconds, and then start it up separately. However it may end up being worth having some extra switches in there to make this work. I'll have to see.
 
Not directly diesel related, but I put up this short from when we visited the Bonneville Salt Flats today.

We spent about 20 minutes at the car wash spraying all the salt off otherwise. Ooh boy, so much salt...

https://www.youtube.com/shorts/7tBsED-PvuI
 
Just finished reading this thread. Very cool project. I do not have the patience to undertake something of this magnitude, so my hat's off to you.

On the arduino front, take a look at the ESP8266 instead. It has the following advantages:
- cheaper (https://a.co/d/8UhAPUk). <-- amazon link
- smaller form factor
- can be programmed with the Arduino IDE and with the same language
- It does also do PWM
- can update code OTA so no need to remove the chip or connect a usb cable to the chip as in the case of an arduino (very useful)
- technical reference https://www.espressif.com/sites/default/files/documentation/esp8266-technical_reference_en.pdf
- PWM tutorial https://randomnerdtutorials.com/esp8266-pwm-arduino-ide/

Regardless of whether you use the arduino or esp8266, I agree that it sounds like the cat is looking for constant voltage to throttle and then just pulse that to ground to control it. But this should be as simple as pulsing an NPN transistor to achieve. You'd want to use the NPN transistor anyway, so that you're not using the board to channel the voltage / current through it before going to ground. Concern is that if you use the board to sink voltage / current, if you have multiple devices coming in, the sum of them may be more than the board could handle, whereas with the transistor the board is not affected.

* Take this advice as coming from a hobbyist, not a trained EE.
 
Just finished reading this thread. Very cool project. I do not have the patience to undertake something of this magnitude, so my hat's off to you.

On the arduino front, take a look at the ESP8266 instead. It has the following advantages:
- cheaper (https://a.co/d/8UhAPUk). <-- amazon link
- smaller form factor
- can be programmed with the Arduino IDE and with the same language
- It does also do PWM
- can update code OTA so no need to remove the chip or connect a usb cable to the chip as in the case of an arduino (very useful)
- technical reference https://www.espressif.com/sites/default/files/documentation/esp8266-technical_reference_en.pdf
- PWM tutorial https://randomnerdtutorials.com/esp8266-pwm-arduino-ide/

Regardless of whether you use the arduino or esp8266, I agree that it sounds like the cat is looking for constant voltage to throttle and then just pulse that to ground to control it. But this should be as simple as pulsing an NPN transistor to achieve. You'd want to use the NPN transistor anyway, so that you're not using the board to channel the voltage / current through it before going to ground. Concern is that if you use the board to sink voltage / current, if you have multiple devices coming in, the sum of them may be more than the board could handle, whereas with the transistor the board is not affected.

* Take this advice as coming from a hobbyist, not a trained EE.

Appreciate the thoughts. I think I'll stick with the Arduino Uno. For me the advantages there are that 1) I already have one and am familiar with using it with my fan setup 2) I have a spare I bought one so I could flash that in and have it working in case the one in the bus quit on a trip) and 3) It's nice to have commonality between the two. But, that does look like it would be a good alternative option. I may consider that at some point. For how cheap these things are relatively, $10 vs. $20 really doesn't matter - and having spares is nice.

The transistor is what I figured would likely be needed. I'll figure out the wiring on that, but first I need to get the Arduino itself doing the PWM output that I need it to.

I played some time playing around with the throttle pedal and a multimeter and figuring out how I want to wire it. It does, in fact, have two channels, but the wiring isn't entirely what I'm used to for a 3-wire sensor. Either way, I found two pairs of wires that have basically the same resistance ranges from zero throttle up to full throttle, and I'll plan to use those for my inputs.

Once I play with it some I'll have to figure out what the transfer function needs to be, and I can set limits to kick out one (or both) of the channels and illuminate a check engine light if one of them goes bad. Nice part with using a GM part is that makes it something that should be readily available. The transfer function may require further tweaking once I start driving it, but I'll go in assuming that for how little power this engine makes overall, I shouldn't have much problem. That's further down the road - the goal to start is simply to have the thing control the engine throttle at all.
 
It didn't take all that much playing around, but now I have the code working for both channels of the throttle pedal, complete with a check engine light that trips if the two channels read too far off of one another.

upload_2023-2-4_11-47-13.png

The code I'd originally written didn't quite work transfer function wise (still honestly not sure why), but my cheap $32 Amazon oscilloscope is reading the PWM output, which is being varied as intended. Both channels are working properly as a 3-wire sensor/potentiometer. I can set the min and max counts for the PWM output and it's working as intended, and there's a smooth transition from idle to full throttle as far as that output goes.

Right now I have it set so that it'll turn on a "Check Engine Light" if those two channels are reading off of each other, and also set the throttle to idle in that case. I may need to rethink that logic some, as well as adding in logic for out of range sensor counts and/or switching from channel A to channel B. I can work on thinking about that more later, but the point is, I've gotten the first half of the throttle equation working.

The next question is figuring out 1) what kind of transistor I need and 2) wiring it up to create that sinking current source.

The ECU has +8V, signal, and GND wires relating to the throttle. It seemed from what I could find that the +8V is for convenience of powering the module that does the PWM output, rather than actually for the sake of generating the input. So I think that I'd need a transistor that will connect the "signal" wire to the "ground" wire, and then it's driven by the digital output of the Arduino - and the Arduino's signal ground needs to be connected to that same ground as the Cat ECU.

Thinking out loud on this one, but some of the EEs in the house can tell me if I'm probably wrong.
 
It didn't take all that much playing around, but now I have the code working for both channels of the throttle pedal, complete with a check engine light that trips if the two channels read too far off of one another.

View attachment 114588

The code I'd originally written didn't quite work transfer function wise (still honestly not sure why), but my cheap $32 Amazon oscilloscope is reading the PWM output, which is being varied as intended. Both channels are working properly as a 3-wire sensor/potentiometer. I can set the min and max counts for the PWM output and it's working as intended, and there's a smooth transition from idle to full throttle as far as that output goes.

Right now I have it set so that it'll turn on a "Check Engine Light" if those two channels are reading off of each other, and also set the throttle to idle in that case. I may need to rethink that logic some, as well as adding in logic for out of range sensor counts and/or switching from channel A to channel B. I can work on thinking about that more later, but the point is, I've gotten the first half of the throttle equation working.

The next question is figuring out 1) what kind of transistor I need and 2) wiring it up to create that sinking current source.

The ECU has +8V, signal, and GND wires relating to the throttle. It seemed from what I could find that the +8V is for convenience of powering the module that does the PWM output, rather than actually for the sake of generating the input. So I think that I'd need a transistor that will connect the "signal" wire to the "ground" wire, and then it's driven by the digital output of the Arduino - and the Arduino's signal ground needs to be connected to that same ground as the Cat ECU.

Thinking out loud on this one, but some of the EEs in the house can tell me if I'm probably wrong.

Be careful, Ted. Keep this kind of stuff up and people are going to start calling you a... wait for it.... SOFTWARE engineer. *GASP* :D
 
Be careful, Ted. Keep this kind of stuff up and people are going to start calling you a... wait for it.... SOFTWARE engineer. *GASP* :D

A few already have. Don’t worry, I still am 100% partial to all things metal. :)
 
The next question is figuring out 1) what kind of transistor I need and 2) wiring it up to create that sinking current source.

Let me suggest this NPN transistor: https://a.co/d/3rqQcBd

Specs:
Maximum DC Collector Current:10 A
Maximum Collector Emitter Voltage:60 V
Maximum Power Dissipation:75 W
Operating Temperature:-55 °C~+150 °C
Maximum Operating Frequency:2 MHz

As you can see, it should be overkill for your situation (overkill is good in a critical piece like this)

Datasheets:
https://www.alldatasheet.com/datasheet-pdf/pdf/2688/MOSPEC/MJE3055T.html

I have provided you with the main page that has several vendors worth of datasheets, as sometimes one vendor doesn't have the data you're looking for.

Wiring:
Arduino PWM signal to the P leg, which would open up the N to N path.

To throttle controller ----------> constant power
From throttle controller -------> N leg of transistor
From Arduino PWM -------------> P Leg of transistor
To Ground -----------------------> N Leg of transistor
 
To throttle controller ----------> constant power
From throttle controller -------> N leg of transistor
From Arduino PWM -------------> P Leg of transistor
To Ground -----------------------> N Leg of transistor

Thanks for your recommendation, and I agree that's overkill, but overkill is good for me. A few questions on this wiring. I'm assuming the following with the three relevant pins on the ECU being +8V, signal, and ground:

"To throttle controller" = signal pin on the ECU
"From throttle controller" = GND pin on the ECU
"From Arduino PWM" = whatever pin I'm using for the PWM output (digital 3 in this case)
"To ground" = one of the signal GND pins on the Arduino

Is that accurate?
 
That is correct and would work. However, it is better to not have the arduino as the source of voltage / current or as the grounding point, just due to limitations of the board. So, in this case, I'd suggest having the ground going to an actual ground in the motor, or via the ground wire of the ECU.
 
That is correct and would work. However, it is better to not have the arduino as the source of voltage / current or as the grounding point, just due to limitations of the board. So, in this case, I'd suggest having the ground going to an actual ground in the motor, or via the ground wire of the ECU.

I'm a bit confused by this. You listed two wires going to the N leg of the transistor - "from throttle controller" and "to ground". With what I listed above, the N leg of the transistor is going to an Arduino ground (which completes the circuit of the Arduino PWM) and to the ECU throttle signal ground (which completes the sinking source PWM circuit).

Unless I'm missing something about the Arduino or how transistors work (both of which are entirely possible) I believe that one of its signal grounds would need to go to that leg of the transistor, otherwise that PWM wouldn't have anything to complete its circuit. Is that incorrect?

I also don't know how isolate that particular signal ground is from the rest of the engine grounds.
 
I think I see the confusion. There are two N legs, not just one.

Also, in this case, you will be pulsing the ground wire with the PWM, not the positive wire as is the more common expectation. At the end of the day it really comes down to the same thing. A complete circuit is only established for a certain percentage of time.

Think of a transistor as a mini relay. It has three legs Collector (C), Base (B), Emitter (E). Functionally, the base leg controls the flow from the collector to the emitter.

Transistors come in two flavors, NPN and PNP. The main difference is whether it is activated by a positive or negative signal. For our purposes, we're using An NPN as we'll activate it with a positive signal from the arduino. When you activate the P (B) leg, you are connecting a circuit between the two N (C & E) legs.

The connection will look something like this:
Key:
. (period) just for spacing, as this system does not like spaces
_ (underscore) or | (pipe) are wiring connections

..................ECU.......................TRANSISTOR
...............+|.....|-..............N (C).....P(B).....N(E)
Constant......|.....|____________|.........|........|
Voltage_____|...................................|........|____________Ground
....................................................|
Arduino D3___________________________|
 
I think I see where we may have a disconnect (put intended). The ECU has 3 pins related to the throttle - +8V, signal, and ground. These are all outputs, the ECU has a separate voltage to it that I have taken care of from the main battery. You've got ECU + and - in your graph. The way I understand the ECU, the +8V is only if the PWM generator (which Cat did not intend on being an Arduino) requires power.

I don't know (and I haven't done a ohm-out to check) whether that throttle sensor ground is the same as or isolated from the main ground. I can check that easily enough. So rewriting what you've got in there for what I'm thinking:

..................ECU.......................TRANSISTOR
...............+|.....| Singal ..............N (C).....P(B).....N(E)
.......................|.....|____________|.........|........|
..........................................................|........|____________ECU - (ECU ground)
..........................................................|........|
Arduino PWM D3__________________________|........|
Arduino Signal Ground ___________________________|

Since the Arduino will work on 8V if I get rid of the bootloader eventually I could run the Arduino on the ECU+, but that will be a further goal.
 
Based on what you're describing, I think we're finally in sync. The only thing is there is no need to have the ground return to the ECU and the Arduino. The ECU ground would be enough.
 
Back
Top