This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

PID to temperature not scale
#5
Depending on the value range float16 type won't have 0.1 precision. In the original setoutput function there was a math.floor call that rounded the value down to an integer. You can log the output value before sending it like this:
Code:
function PID2:setoutput()
  local t, object, value

  self.output = math.max(self.output, self.params.min)
  self.output = math.min(self.output, self.params.max)

  value = self.output

  log(value)

  local t = type(self.params.output)

  -- write to output if object is set
  if t == 'string' or t == 'table' then
    if t == 'string' then
      self.params.output = { self.params.output }
    end

    for _, output in ipairs(self.params.output) do
      grp.write(output, value, dt.float16)
    end
  end
end
Reply


Messages In This Thread
PID to temperature not scale - by KoBra - 25.07.2022, 14:41
RE: PID to temperature not scale - by admin - 26.07.2022, 06:17
RE: PID to temperature not scale - by KoBra - 27.07.2022, 09:48
RE: PID to temperature not scale - by KoBra - 27.07.2022, 11:13
RE: PID to temperature not scale - by admin - 28.07.2022, 06:26

Forum Jump: