PID?
floodhound
Posts: 45
I am transplanting the BS2SX with the propeller chip and I wanted to know if there is a PID source code. I remember learning tremendously form the PID used in a book from parallax. Just wanted to know if the code could be translated – remember I am learning slowly so not to complex if you are going to help.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My web site -- > www.floodhound.com <-- take a look if you like
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My web site -- > www.floodhound.com <-- take a look if you like
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My web site -- > www.floodhound.com <-- take a look if you like
' Derivative
temp := f.FSub(E, Ep) ' ΔE = (now) - E(old)
temp := f.FDiv(E, dt) ' ΔE/Δt
D := f.FMul(kd, temp) ' D = kd
Whatever the math be, it makes no sense to assign to temp twice..
One explanation could be, that E is not E as the comments say, but has already been changed to (now)-E(old) in instructions before, so obsoleting the first line...
Andy
Update 8/23/07 - Corrections and testing in progress; hope to finish this weekend.
Update 8/27/07 - Corrections completed.··Updated PID object attached.· Also attached is an archive for examining the PID calculations for verification. "Test PID.spin" is the archive's top file.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 8/24/2010 6:47:19 PM GMT