-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow RPM to be sent directly to hardware, having no fan PID loop #32
Comments
As for the dummy fan PID loop, here's how:
This gives you a PID loop that has no purpose but to make a 1:1 copy of its input to its output. Use this as your fan PID loop. Set the output to your RPM sensors, not your PWM sensors. However, a big gotcha. You will need to modify the sensor drivers accordingly, because usually the RPM sensor is not settable directly. You might need to perform the same customizations that were done for fan PWM sensors, to set up a control interface, such that the writing can be sent directly to the hardware, and not just to the sensor value itself (which would have no effect on the actual hardware). Look at the special relationship between the |
I have a question about Fan RPM but not very relevant to this issue. Another question, if using RPM control, it seems the second PID(fan PID loop) has to be ignored, like what you setting. Because the sys file fanX_input isn't the monitor RPM value(Maybe there are some differences between every smart fan controller), it cannot use fanX_input as input to calculate PID. Is my understanding correct? |
That is a good point. If min/max RPM is different between your fans, then you have different models of fans installed in the same system. I would think that the best approach then would be to use more than one thermal zone. Use one thermal zone per fan, unless you have fans of identical model running in parallel to cool the same components. It is OK (and encouraged) to reuse the same temperature sensor as input into multiple thermal zones. Then, your PID loops, in each thermal zone, could adapt to the differences in your fan models accordingly. As for using RPM control, as with a smart fan controller that does not need PWM, I am not sure about what you are asking. You want the fan PID loop to be a no-op. The units of it do not matter, because you are just multiplying it by 1, which will result in the output equalling the input, regardless of what units are in use. You could probably use the same sensor for both the input and the output in this case, since the PID loop would not be making any differences to the calculation, I think (I have not tested this approach, though). |
To dummy out a PID loop, here's some advice and correction to the above. There's a difference between copying input to output, and copying setpoint to output. To copy input to output, set the KP coefficient to 1, set the setpoint to 0, set everything else zero. To copy setpoint to output, disregarding input, set the feed-forward Gain coefficient to 1, set everything else zero. This gives you a 1:1 copy, without doing any further processing. |
Thanks Josh! One nice to have feature is for swampd to provide a way to run open loops. Today, it seems if we want to disable the fan loop, we still need to provide mock tach sensors (with rpm set to 0 ) as input (along with the other things you mentioned above), to make it work like an open loop. |
Sounds reasonable. One way to specify an open loop would be to have a PID loop with an |
Thought about it a little more. Another limitation came up, in the way that RPM sensors are currently handled. There's no way to tell the difference between the desired value (as set by the user) and the actual value (as coming from the hardware). This is not important now for PWM, because PWM changes are essentially one-way, from user to hardware. A properly working fan hardware driver will not unilaterally change the PWM value on its own. However, this will become important when we gain the ability to set the RPM value directly, by bypassing the PWM-to-RPM pipeline. There needs to be a way to maintain visibility into both of these values, to distinguish the desired RPM from the actual physical RPM, because the fan motor can not respond instantly. There will always be a little delay. Knowing this delay is important for a thermal engineer doing thermal tuning. One nice thing about the PWM sensors is that they have a separate |
The usefulness of this feature also applies to another use case as well. Sometimes, the RPM value is not needed at all by the user. The thermal PID loops are tuned to output the desired PWM percentage, which is sent directly to the fan hardware. RPM does not factor into the calculations at all. This is another case in which the user will need to create a dummy fan PID loop, to just do a 1:1 copy of the setpoint to the output. It would be nice to make the configuration of |
Right now, the architecture of phosphor-pid-control assumes each thermal zone will have 2 cascaded PID loops:
Newer hardware, with a smart fan controller, has the possibility of accepting a RPM value sent directly to hardware. The controller then becomes responsible for dealing with the fan motors to achieve that. It would often be more desirable to do this. The workaround is to have a dummy fan PID loop that is 1:1 input and output, but this is cumbersome.
To fully realize this feature, we will need:
Anything else I forgot?
The text was updated successfully, but these errors were encountered: