What exactly is this?
Screens? Demos?
If you've tried doing PID with discrete gates, you'll know why I made this.
Inputs:
In - Input, value you want to control
Set point - What you want the input to be
Enable - If 0, the output is 0 and the loop is not evaluated
Outputs:
Out - The sum of the P, I, and D terms
Put WirePID in your addons folder, the tool comes up under Wire - Control. hoverplatform.txt is an advanced dupe of a phx 8x8 hovering at a set height with just thrusters. The small 1x1 is a gps/radio combo to give the platform a zero (since someone doesn't have the ground at z=0 in wire_construct...). Both are frozen after being pasted. Numpad controls to move around/adjust height. I've had 5 or 6 of these running at the same time before things started slowing down (15-18 PID loops).
The only issue is that you can't pick it up with the physgun. Works with the gravity gun and physics works fine, but not with the physgun.
Fixed physgun
Fixed undo text
Added ghost
Added output limit
Last edited by Moyer; 07-04-2008 at 06:25 PM.
What exactly is this?
Screens? Demos?
[LEFT][B]Current learning status:[/B]
[/LEFT]
[B] Expression chip:[/B] [I]Grand master (seriously, I can rival Syranide)[/I] [B]Lua:[/B] [I]Qute good[/I] [B]CPU:[/B] [I]I get it... I think, But why the registers? [/I][B]Moongate:[/B] [I]I'll look into it when i get time...[/I]
[CENTER][URL="http://www.free-iqtest.net/"]:cookie:My IQ is 146[/URL] - [B]Free-IQTest.net:cookie:[/B]
[/CENTER]
[quote=l3ulletje;52546]How much more "Not there" do you want it to be?[/quote]
[code]ents.GetByIndex(0):Remove()[/code][CENTER]
[/CENTER]
[ame=http://en.wikipedia.org/wiki/PID_controller]PID controller - Wikipedia, the free encyclopedia[/ame]
PID is a pretty versatile control method. I'd get some in game vid, but anything I upload to youtube gets its quality destroyed. There is an advanced dupe to play with...
Hover platform:
[ame=http://www.youtube.com/watch?v=ckycx_0OZTo]YouTube - GMOD Hover Platform[/ame]
Making a PHX beam stay standing on end:
[ame=http://www.youtube.com/watch?v=hRoVWME7piI&feature=user]YouTube - GMOD Pole[/ame]
Neither one is tuned perfectly, they could be made more responsive and accurate with better tuning of the gains.
I don't understand its use...
EDIT: JUST UNDERSTOOD ITS GREAT![]()
Last edited by Mechanical433; 05-18-2008 at 05:20 PM.
[img]http://img84.imageshack.us/img84/8387/portalan1.jpg[/img]
Oh wow.... This is amazing. My head is spinning with everything this allows. Forget delta.... (And in regards to how this works (I've had through calc 3) is the delta we have been using similiar (although its delta not derivative) to the derivative part of the PID?)
Here is one big vote for this being improved and incorporated into Wire.
Last edited by Ergzay; 05-18-2008 at 05:38 PM.
Very interesting indeed... although it seems like a simple algorithm, it's still very useful; good job.
Halp !!
I can't set it corectly... ( Cant make it hover )
What setting would you use ??
[img]http://img84.imageshack.us/img84/8387/portalan1.jpg[/img]
Play around with mine, you can copy the settings off of those PID loops if you want (right click copies). Generally, you set I and D to 0 and tune P until the system becomes unstable, back of a little, add D until you're satisfied with the response, add I until error is eliminated. Sometimes you might not need to use all three parts, just set some to 0 to disable them. The platform uses three loops, one for pitch, one for roll, and one that is added to all four thrusters to control height, all use P, I, and D. I usually set it up with two hoverballs to let it rotate in one direction and hold it up in the air, then add thrusters/gyro/pid/set point and tune it for that one direction (pitch or roll), the other direction should then use the same settings. After that, I just add in the hovering loop and tune it.
It might help to start off making a phx pole with an axis to a wall at one end and get PID loop/thruster/gyro to hold the other end up so the whole pole is horizontal. That's a pretty easy to tune system and you can really see what all the parts contribute.
The D term is actually the derivative of the error. It first calculates the difference between the set point and the measured value and calls that error, then it takes the error it had last time it went through the loop and calculates the difference between the two errors. It then divides that by the time between loops. de/dt I is the integral of error, or the accumulation of error * dt every loop. P is just a constant * error.
You can actually make this loop using gates (delta, multiply, integrator), but that's only good for one or two loops until it gets too slow. Doing it all in lua speeds it up tremendously.
Changed my original post with a new attachment, fixed some stuff.
Wow great job.
[I][SIZE="2"]intel e6750 2.66 ghz
bfg 8800gt oc
2 gb G.Skill ram
750w psu
250 gb hd
22'' LG 1680x1050
ms sidewinder
windows xp
[/SIZE][/I]
Bookmarks