22.09.2021, 07:59
The example is somewhat outdated. You need to create a user library named pid and copy the code there.
Then load the library in your resident script:
Then load the library in your resident script:
Code:
-- init pid algorithm
if not p then
require('user.pid')
p = PID:init({
current = '1/1/1',
setpoint = '1/1/2',
output = '1/1/3'
})
end
-- run algorithm
p:run()