I have an old diesel generator, and I have big problems with programming the governor. I need an engine so that it stays between 2400-2800 rpm.
I have a strong RC servo motor that presses the gas lever of the engine, and the servo moves between 22 Β° (minimum) and 95 Β° (maximum) fuel injection
I control it with an Atmel meg 328 microcontroller. Speed ββis measured by a Gala effect sensor and one magnet on the flywheel. I measure the time it takes for a complete turn, and I calculate the RPM based on this (this means that if the engine is faster, the code reacts to it more often => Faster changes in the number of injections)
At first I tried the easiest and dumbest way. If the RPM is larger than my required, step back => Less fuel injection. If the RPM was below the necessary step forward. This is a very bad idea, because the engine has a large delay, so My RPM writes the perfect sine graph around my required RPM, because it has a lot of inertia. therefore, when the speed exceeded the upper limit, the engine was still accelerating.
I also tried to change the degree of regulation by multiplying it by the square of the difference (Need RPM-Current RPM) It turned out to be the best, but it still works.
I would like to somehow predict my curve and change the fuel injection in accordance with my future curve. And the engine gets a huge RPM drop with a sudden increase in load (I start the compressor from this)
Please help me, I have no idea. I will send some sort of image on graphs.
source share