This is a one-off development just for my motorcycle which will have a throttle body with secondary throttle plates. The reason I need them, or think I need them is because of my other motorcycle AFR going too lean if opening the throttle too quickly. So in theory by delaying the airflow into the throttle body until the RPM can catch up with the TPS it may solve my problem. These secondary plates also crack open the primary plates when they are fully opened. This provides air at idle and a fast idle during warm up.
Currently working on firmware routines that control and calibrate the Secondary throttle plates.
When code wakes up and starts the initialize routine, it will calibrate the secondary plates by finding the full open and full closed positions. It is repeated 4 times then the values are saved.
In the main loop, a routine is called periodically to service the Secondary Throttle plates (STP). This routine uses RPM and TPS to look up in a table the target position of where the secondary throttle plates should be. It then compares this target position to the actual position and initiates a seek in the direction of the target position. Upon initiating the seek the routine will exit. This is repeated until the position reaches the target. At the moment I have it slowed down so I can see what is going on during debug.
A while until I am done but I think this is going to work.
https://youtu.be/ia2SJ3GiNH4