Page 1 of 1

generator engine speed control PID loop

Posted: Wed Sep 26, 2012 10:33 pm
by timbo017
Hi i am new to pic programing and flowcode and am working though the free course and am finding flowcode very good as a beginner.
I have a real world project that i am doing at present which is a 12kva genorator attached to a VW diesel engine and i need to create a servo controlled throttle system to govern the engine speed under load conditions to approximately 2000 rpm similar to a PID loop system.
My idea of how the system will basically work is i have a cam speed sensor with a square wave signal as a digital input 20Hz at 750 rpm to 90Hz at 4000rpm so my target signal speed is aprox 45Hz
So what i need to do within my flowchart is to,

Measure the engine speed,ie (count the pulses for say 100ms in a loop )to arrive at an engine speed then
then use a calculation, of the measured speed followed by a decision/s, if lower or higher than the desired speed
followed by the servo, control +/- to control the throttle to desired speed
Thanks in advance for any idea,s as i may have the wrong idea altogether.

Re: generator engine speed control PID loop

Posted: Sun Oct 07, 2012 1:33 am
by nuwan5213
have you got any flowcode for this

Re: generator engine speed control PID loop

Posted: Sun Oct 07, 2012 1:55 pm
by dazz
Hi Timbo

Have a quick search of the forum as there are a few threads similar to what you want to achieve, If you have made a start on a flowchart post it up and others will be more able to guide you to what you want to acheive

Regards
Dazz

Re: generator engine speed control PID loop

Posted: Mon Oct 08, 2012 3:57 pm
by Enamul
i need to create a servo controlled throttle system to govern the engine speed under load conditions to approximately 2000 rpm similar to a PID loop system.
I can think what you are planning to make..so I would suggest you to try with frequency counter program to measure pulses first and then to concentrate in adjusting the pulse frequency by feedback..
To start with you need to have programmer and some E-blocks or similar hardware..you can try Flowcode example file frequency counter. let me know if you can't find that.