[{"data":1,"prerenderedAt":295},["ShallowReactive",2],{"project-9476603":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":33,"aspects":34,"strip":39,"post_text":42,"what":43,"said":62,"maker_in_thread":149,"shape":161,"grid":166,"attempts":257,"same_week":258,"maker_shows":150,"maker_hidden":288,"reader_version":289,"card":290},"9476603","PID","2D PID controller simulation","title","Show HN: 2D PID controller simulation","http:\u002F\u002Fnikital.github.io\u002Fpid\u002F","nikital.github.io","nikital",1430563765,2015,73,38,362,2565,15,"notable","learning_science","control theory demo","web_app",[24,25,26,27],"pid controller","control theory","simulation","feedback loop","curious",0,{"positive":31,"neutral":32,"mixed":29,"critical":31},1,16,18,{"design":35,"execution":36,"idea":37,"docs":38},{"positive":31,"critical":29},{"positive":29,"critical":29},{"positive":29,"critical":29},{"positive":29,"critical":31},[40,29,40,29,29,29,40,29,29,29,29,40,40,40,40,40,40,40,29,29,29,29,40,29,29,29,29,29,40,29,40,40,29,31,29,40,40,41],3,5,null,{"problem":44,"audience":52,"pricing":42,"motivation":42,"time_to_build":42,"stack":60,"openness":61,"stage":61,"team_size":61},{"value":45,"source":46,"evidence":47},"Demonstrates how a PID controller drives a physically simulated ball to a target point","inferred",[48],{"id":49,"by":50,"text":51},"9476793","ingenter","- Brown ball is physically simulated (has inertia) - A program controls the ball only via two thrusters (x\u002Fy), force represented as orange bars - Program's goal is to deliver the…",{"value":53,"source":46,"evidence":54},"People learning PID control theory",[55,59],{"id":56,"by":57,"text":58},"9476795","watmough","The article links the Wikipedia page: https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FPID_controller If the goal is to teach about PID controllers, then the demo could use a graph showing the…",{"id":49,"by":50,"text":51},[],"unknown",{"praise":63,"objections":76,"requests":99,"questions":119,"alternatives":141},[64],{"value":65,"source":66,"evidence":67},"Nice, clear demo of PID behaviour","commenter",[68,72],{"id":69,"by":70,"text":71},"9478019","adiko","Very nice simulation!",{"id":73,"by":74,"text":75},"9477060","fnordfnordfnord","Nice demo. Thanks. FYI http:\u002F\u002Fnikital.github.io\u002F is 404.",[77,84,95],{"value":78,"source":66,"evidence":79},"The PID values were not exposed in text boxes at first",[80],{"id":81,"by":82,"text":83},"9476809","sjtrny","It's a shame that the PID values aren't exposed directly in text boxes but you can affect how the ball behaves (react faster\u002Fslower or cause under or overshoot) by adjusting the…",{"value":85,"source":66,"evidence":86},"Integral term is useless without gravity or friction",[87,91],{"id":88,"by":89,"text":90},"9477437","xnzakg","Would be pretty nice to have some external force (like gravity), otherwise the i value is pretty much useless. Also, some friction would be nice.",{"id":92,"by":93,"text":94},"9476805","mrpsrinkles","Looking at the source this is actually a PD controller, which makes sense for a simple simulation like this.",{"value":96,"source":66,"evidence":97},"Implementation is a PD controller rather than full PID",[98],{"id":92,"by":93,"text":94},[100,108,112],{"value":101,"source":66,"evidence":102},"Add gravity or friction to the simulation",[103,104],{"id":88,"by":89,"text":90},{"id":105,"by":106,"text":107},"9476893","antoinealb","One way to make the integral term useful would be to add some static friction to the simulation, that would be interesting.",{"value":109,"source":66,"evidence":110},"Show PID parameters through time in a graph",[111],{"id":56,"by":57,"text":58},{"value":113,"source":66,"evidence":114},"Display closed loop poles and zeros",[115],{"id":116,"by":117,"text":118},"9479448","bobmoretti","This would be a really cool illustration if you could solve the closed loop transfer function, and display the locations of the closed loop zeros and poles.",[120,130],{"value":121,"source":66,"evidence":122},"What is a PID controller and how does it work?",[123,127],{"id":124,"by":125,"text":126},"9476770","rounak","Can anyone explain what is this?",{"id":128,"by":82,"text":129},"9476787","Proportional-integral-derivative (PID) controller is a feedback loop algorithm for control. You give some desired goal (in this case is to reach a position) and it moves to that…",{"value":131,"source":66,"evidence":132},"Is there a configuration that gives optimal control?",[133,137],{"id":134,"by":135,"text":136},"9477420","ambrop7","I'm curious, is there any configuration of the PID parameters that would achieve optimal control for this simple physical system? I suppose the optimum looks like 100% thrust and…",{"id":138,"by":139,"text":140},"9477611","agoetz","Yes. Reformulate the systems transfer function into a state space representation, and then solve the algebraic ricatti equation to find an optimal gain matrix. This is know and…",[142],{"value":143,"source":66,"evidence":144},"Python PID loop implementation in ownercredit repository",[145],{"id":146,"by":147,"text":148},"9477622","pjkundert","For a complete Python PID loop implementation and (console) demo: ``` git clone https:\u002F\u002Fgithub.com\u002Fpjkundert\u002Fownercredit.git PYTHONPATH=$PWD python .\u002Fownercredit\u002Fpid.py ```",{"comments":150,"answered":29,"key":151},4,[152,155,158],{"id":153,"text":154},"9476849","That's a good idea, I'll add them. Edit: Done.",{"id":156,"text":157},"9476939","I agree, I pushed a new update. Also, I adjusted the defaults for a snappier response with a bit of satisfying overshoot",{"id":159,"text":160},"9477872","Your comment regarding the gravity was really insightful for me (I didn't learn PID formally). When I put large values for i, the ball just oscillated and I couldn't see how i is…",{"commenters":162,"max_depth":163,"maker_replies":150,"first_comment_mins":164,"lifespan_hours":165},27,7,80,77,[167,169,171,175,177,181,183,185,187,190,193,196,198,200,201,202,206,207,210,213,215,218,221,224,226,229,231,233,235,236,238,239,240,243,245,248,252,254],[81,29,40,168,82,29],"project\u002Fneutral\u002Fdesign",[153,29,29,170,11,31],"maker\u002Fpositive\u002Fdesign",[172,29,40,173,174,29],"9476917","project\u002Fneutral\u002Fexecution","icegreentea",[156,29,29,176,11,31],"maker\u002Fpositive\u002Fexecution",[178,29,29,179,180,29],"9477012","commenter\u002Fneutral\u002Fidea","phkahler",[182,29,29,179,174,29],"9477056",[134,31,40,184,135,29],"project\u002Fneutral\u002Fidea",[138,31,29,186,139,29],"other\u002Fneutral\u002Fidea",[188,31,29,179,189,29],"9477623","Matumio",[191,31,29,186,192,29],"9478593","niccl",[194,31,29,186,195,29],"9479597","danielvf",[116,197,40,168,117,29],2,[124,40,40,199,125,29],"project\u002Fneutral\u002Fnone",[128,40,40,184,82,29],[56,40,40,168,57,29],[203,40,40,204,205,29],"9477418","project\u002Fneutral\u002Fdocs","sz4kerto",[49,40,40,204,50,29],[208,40,40,184,209,29],"9476814","Flux159",[211,40,29,186,212,29],"9476978","CompelTechnic",[214,40,29,186,174,29],"9477084",[216,40,29,186,217,29],"9476908","savrajsingh",[219,40,29,186,220,29],"9478444","zxexz",[222,40,40,184,223,29],"9476997","stefanix",[225,40,29,186,180,29],"9477051",[227,40,29,186,228,29],"9478418","TeMPOraL",[230,40,29,186,180,29],"9482888",[232,40,29,186,228,29],"9482982",[234,40,29,186,180,29],"9492961",[88,150,40,168,89,29],[159,150,29,237,11,31],"maker\u002Fpositive\u002Fidea",[92,41,40,173,93,29],[105,41,40,168,106,29],[146,241,29,242,147,29],6,"other\u002Fneutral\u002Fnone",[73,163,31,244,74,29],"maker\u002Fcritical\u002Fdocs",[246,163,29,247,11,31],"9477308","maker\u002Fneutral\u002Fdocs",[249,250,40,184,251,29],"9477599",8,"phonyphonecall",[253,250,40,184,93,29],"9478412",[69,255,41,256,70,29],9,"project\u002Fpositive\u002Fdesign",[],[259,264,269,274,279,284],{"id":260,"name":261,"points":262,"category":263},"9498874","kiUi",136,"languages",{"id":265,"name":266,"points":267,"category":268},"9477032","zindex",125,"dev_tools",{"id":270,"name":271,"points":272,"category":273},"9485714","nvParse",123,"data",{"id":275,"name":276,"points":277,"category":278},"9491978","My Hacker News",78,"consumer_social",{"id":280,"name":281,"points":282,"category":283},"9502015","Estimote Indoor Location SDK",71,"infrastructure",{"id":285,"name":286,"points":287,"category":268},"9500823","Onboarded",54,false,"v2",{"id":291,"name":5,"line":6,"ai":288,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":29,"top":18,"kw":292,"maker":11,"domain":10,"tier":19,"attempts":29,"strip":293,"url":9,"mix":294,"praise":65,"objection":78,"sub":21},9476603,[24,25,26,27],"30300030000333333300003000003033010335",[31,32,29,31],1793990923955]