Replies: 4 comments 1 reply
-
No problem with creating the issues, I welcome the discussion! Yes, I can see how using separate gains (kPm and kPe) would offer an improvement to the "Setpoint Weighting" feature, because normally the proportional gain is tuned based on either error (P_ON_E) or measurement (P_ON_M) and the ideal kP value based on each method would be beneficial. The rational of the I suppose the user could determine the ideal kP for both POn=1 and POn=0 ... in your example Kpe=10 and Kpm=100, then they could use something like Kp=50 for POn=0.5. Even so, I do like the suggestion to have the separate kPm and kPe parameters. I have some hardware on order that should arrived sometime soon (TCLab and a MAX31856) so I'll be able to run tests on a system based on heating and thermocouple(s). There's been an interesting discussion here on P_ON_M vs P_ON_E and I wonder how using an adjustable POn with separate Kp values would have worked on that system. |
Beta Was this translation helpful? Give feedback.
-
Yes, that's true. I guess it's a trade off between api complexity and control. The reason that I came to post this issue was that I had made the wrong assumption that the POn ratio would have a linear response - but that's not possible with a single kp value. Also, it occurs to me that if you have two independent P_ON_M and P_ON_E parameters, you may not really need a POn parameter as you can adjust those inputs relative to each other... ? |
Beta Was this translation helpful? Give feedback.
-
Also, since we already opened this can of worms, I was wondering if the DOn might have a similar set of issues. For DOn, I thought perhaps that the |
Beta Was this translation helpful? Give feedback.
-
My initial tests with POn and DOn were done with the RC filter example and an Arduino UNO. The idea for both ratios were to allow mixing of "error to measurement" in addition to just selecting one or the other. When some new hardware I ordered eventually arrives, I'll be able to do testing with a more conventional thermal / thermocouple system. At this point I'll re-visit POn and DOn and do more stringent testing ... will also be able to work on autoTune and expand its compatibility. |
Beta Was this translation helpful? Give feedback.
-
Sorry to make so many issues here - this one is more of a question / discussion / observation about the rational of the
pOn
implementation than it is a bug report:When using mix of
pOnM
andpOnE
, the two parameters share a singlepK
value, but track independent inputs: ThepOnM
is proportion to the relative change in input since that last reading (dInput
). Since we are measuring the time base in microseconds, thepmTerm
value is likely to be small, or at least, proportional to the sample time. ThepOnE
is an absolute measurement of the error without a time scale.I believe that, maybe, it is necessary for
kP
to be split into two separate parameters for a mixedpOn
value to work in most cases. It’s a bit complicated to try to explain the reasoning in prose, but I’ve written out an example below in which theerror
is proportionally much larger than thedInput
to illustrate how a singlekP
is unable to produce workable values for both thepOnE
andpOnM
.In the above, you can see that the peTerm significantly out-ways the pmTerm in the final output.
I realize that the solution that has been implemented is what brettbeauregard proposed in his proposed "Setpoint Weighting" in the blog post on pOnM. However, I’m not sure that their solution was fully resolved.
I believe that for the
pOn
"Setpoint Weighting" to be practical, there would need to be separate parameters for the kP: one for the error and one for the measurement. eg.kPm
andkPe.
The pOn value would then serve as the proportional mix of those two values.Otherwise the two kP inputs (measurement and error) need to be on the same scale to work. This might happen in a few rare instance, but I believe that in most situations, those two values are most likely to be measured independently.
And again, many thanks for creating and maintaining this library!
Beta Was this translation helpful? Give feedback.
All reactions