Hello everyone. Some time ago I mentioned that I was working on newer variant of my controller. I had some spare hours recently and came up with v1.4. Originally I was thinking about v2.0 with semi-auto tune and optionally digital mapping but I see some difficulties in JLCPCB library when it comes to digital potentiometers (the core would still stay analogue as it is proven to work and I still think it's safer than a digital one). The idea was to make it work even without the MCU (probably Arduino nano) so I need non volatile memory in pots and that's not common in those in JLC stock. Anyway, another reason to go with this intermediate v1.4 was to keep changes in bay and test the new concepts first.
Here's the beta of schematic and PCB for v1.4, I need to order those and run some tests. Although it wasn't a strict condition I managed to squeeze everything in the same PCB dimensions. It is really maxed out in the control part now
About 80% of the layout is exactly the same as it was in v1.3.
The change in the remaining 20% goes to a different calibration method and input circuits. The previous versions were based mainly on assumption that it is used with pot based TPS and gas pedal and the calibration was pretty much about changing the resistance on top and bottom of those pots to change their voltage range. However, this proved to be limited and somewhat difficult when one wanted gas pedal or throttle based on different technology and in general having voltage output instead of a resistive one.
Now in v1.4 there's an additional amplifier on both inputs that provide means of changing amplification (k-factor) and offset of the input signal. In other words, it is now possible to multiply (or divide looking from a different perspective) the input signal by a k factor in a range of approximately 0.5-2. The goal is to either sterach or narrow down the voltage difference between open and closed throttle / pressed and unpressed gas pedal to 3V.
For example, if we start with 0.7V at closed throttle and 3.5V at fully open (and we know it either from documentation or from simple measurement) the difference is 3.5-0.7=2.8V, therefore we need to amplify the signal a bit. k=3V/2.8V=1.07 which will give us 0.7V*1.07=0.75V and 3.5V*1.07=3.75V and the difference is now exactly 3V.
Now we need to move both of those values so they are fixed at 1V and 4V (as you remember by default the fail safe thresholds in previous versions were set to 0.8V and 4.2V so the goal is to be centered between those). That's where the second set of pots comes into play, they set the offset. The "neutral" position of offset pot is 2.5V, in our case we need to move both values by 0.25V. This can be set via calculating the required voltage at regulating pot or by measuring the result at opamp output with closed throttle when turning the pot.
There are now 2 pairs of test points on the PCB equipped with a small hole so it's easier to localize and keep the multimeter probe in place when calibrating. The calibration procedure I have in mind has the steps actually backwards to those described above - I will add a simple spreadsheet (and equations for those that wish to do it on their own) where you put in the voltage levels of your TPS / gas pedal and it will give you the required offset voltage to be set which then you measure on one test point per input. The k factor is then provided just for your information as all you need to know is which direction you need to turn the amplification pot and measure the result on opamp output, that is the second set of test points.
It may sound somewhat complicated at first but it should be actually easier and faster then the current calibration method. Plus there are no limitations to the type of position sensors as long as their signals are between 0 and 5V. There are now two new cable connection points on the PCB to provide GND and 5V power to both gas pedal and TPS.
For those of you that like to dig deeper in the schematic - yes, the input signals will be reversed meaning the level on next stage input (the filter known from previous versions) will be 4V at closed and 1V at fully open throttle. Since the gas pedal behaves the same way only thing we need to do is reverse the polarity at the motor connectors (I think hehe). For the same reason the IAC input had to be rearranged and also reverse the input PWM. I also know that the placement of the filter as the second stage instead of the first is not ideal but I had to make a compromise to have the IAC working properly and not requiring additional filtering and/or calibration.
I'm not yet putting it on github as I believe this new concept has to be verified first. If you would like to have a try though I can provide all necessary files to early adopters.