I have no idea what any of that means but looking forward to hearing the Cat purrrr.
I have no idea what any of that means but looking forward to hearing the Cat purrrr.
Maybe you could put it on a bearhawk.Me too. That little 4.0 V8 in it is... no good.
Maybe you could put it on a bearhawk.
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.
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*
The next question is figuring out 1) what kind of transistor I need and 2) wiring it up to create that sinking current source.
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
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.