QUOTE (mos89 @ Nov 10 2009, 03:14 AM)

My input is a ratio between 2 flowmeter B/A and my proportional valve is controling that mixing by adjusting B component flow
so what i want is that my PID controller adjust me the number of step for my PTO instruction
Is that understandable ?
Thanks
There are 3 fundamental problems to overcome here. Once you overcome these, then you will have what you need to use a PID loop. Right now I can't really even begin to recommend what you should do since you are dealing with the first derivative of a variable (velocity) for control relative to the appropriate process variable.
Problem #1: Ratios are nonlinear.
PID loops work best if the system they are controlling is linear and time invariant. The process variable you describe is very nonlinear and barely monotonic. But you can linearize it very easily. Let the operator set the "ratio" as a set point. Calculate Ratio * A = desired flow rate for B. Let this be your set point to the control loop rather than the ratio itself. Even though the set point might be constantly changing from the result of this calculation, at least the system will be relatively linear in nature.
Problem #2: Matching variables
You don't know where the valve is. All you can currently command it to do from your description is to move a certain number of increments open or closed. A PID loop works when both the input and output are tied to one another, such as "position" and "valve". You have "flow" and "valve velocity", the derivative of the required variable (valve position). The derivative of flow (changing in flow rates) might work as an input variable for your stepper motor similar to a velocity loop in a drive but it will not work for controlling flow rates.
Problem #3: Valve positioner
You need valve position feedback. I highly suggest you scrap the whole thing and get a true valve positioner that takes a 4-20mA input signal because this will be the simplest and most reliable. This will come with the position feedback sensors built into the actuator and will be much easier to control.
I can't recommend a specific positioner without knowing what kind of valve it is. It is best to call the valve manufacturer and ask.