Hey, remember this? I got around to working on it again.
After talking to a friend who is smrter than I in this sort of thing (and who happens to have an LS3 Miata and my old Locost, so he is One Of Us), we decided that the heat sinks on my little MOSFET were way too small. Actually, there weren't any. I played around for a while and was worried about how quickly they were heating. He says they should run forever at 85C but given the speed of the temperature rise that seemed an unlikely goal. Even after I fixed the quirk of the programming that pinned the throttle body motor and pulled down big current numbers, I wasn't comfortable with what this meant for the long term.
I decided on his suggestion to change out my MOSFET for an H bridge. Basically, a DC motor controller. I happened to have an L298N sitting around. It's rated for 2A of continuous draw and the highest I've seen on my power supply has been a spike to about 1.1A with normal operation at less than half that. It's also got a big fat heat sink on it. Sure, it costs nearly $3 instead of $1.50, but darn the expense. I'm worth it.
Wired it in, it worked nicely right away. I spent some time just blipping the throttle and nothing awry seemed to happen. The heat sink warmed up but not much.
So then it was time to adapt the pedal. The fact that the TPS and the throttle pedal sensors work exactly the same way made this a really fast integration. I'd been controlling the throttle with a little knob up to this point and it had been a little jerky, but once I was using an actual spring-loaded pedal things smoothed out. Probably because I couldn't spike the requested throttle position quite so quickly.
Polished up the code a little more and added in some error correction. Here's how it all works now:
- controller checks the primary position sensor on the throttle pedal (I'm measuring it as 0-100)
- controller checks the secondary position sensor on the throttle pedal
- if the two readings are more than 5 points apart, it declares a state of emergency and closes the throttle. This number is not set in stone yet but I haven't seen variance of more than 2-3 points in brief logging. Really, the most likely error will be for one sensor to read 0 while the other one is in a normal position so I can probably open that up a bit.
- if the sensors agree (within the allowed variance), it takes the average of the two of them and this is now our commanded throttle position
- it checks the position of the throttle plate using the same two-sensor technique and with the same error check
- it then changes the PWM duty cycle to move the throttle plate. The further it is from the commanded position, the bigger the change it makes.
- do it all over again
I can adjust the aggressiveness of how hard it accelerates the throttle plate, it basically works out like a damper. If the damping is too high, the plate lags. If it's too low, it can overshoot and it's jittery. Playing around has let me dial in a setting that looks good on the bench, with the throttle plate moving snappily but accurately in response to the pedal. It turns out that getting this right also minimizes the power usage.
I've tested the error checking by pulling sensor wires when "driving" and it immediately goes to a closed throttle situation. So that's good.
One thing I noticed is that the throttle body can open the plate more than 90 degrees. I'm not sure why, but I have it set up so that 100% commanded throttle is with the plate perpendicular to airflow. This seems like a good idea.
So yay! It's working. I think the next step is to build a version that's a little more robustly assembled and come up with a test rig so I can have it run overnight. I also have to start thinking about the idle control question as well - my preferred option there is still to integrate the factory IAC signals into my throttle plate commanded opening. There will be some on-vehicle experimentation to dial that in, but this van has always had occasional idle problems and so it's quite probable it will come out of this much happier.
No video, but here's the current functioning setup.