Wiremod Forums  

Go Back   Wiremod Forums > Wiremod Skills > Wiremod Addons

Wiremod Addons Have you created a wiremod addon? Post it here.

Reply
 
LinkBack Thread Tools Display Modes
Old 05-13-2008   #1 (permalink)
Inactive
 
Moyer's Avatar
 
Join Date: May 2008
Posts: 9
Moyer is on a distinguished road
Default PID Controller

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
Attached Files
File Type: rar WirePID.rar (3.8 KB, 118 views)

Last edited by Moyer; 07-04-2008 at 06:25 PM.
Moyer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-16-2008   #2 (permalink)
Inactive
 
MagnetoHydroDynamics's Avatar
 
Join Date: Jan 2008
Location: Mars, Easth Hellas settlement
Posts: 90
MagnetoHydroDynamics is on a distinguished road
Default Re: PID Controller

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]
MagnetoHydroDynamics is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-16-2008   #3 (permalink)
Inactive
 
Moyer's Avatar
 
Join Date: May 2008
Posts: 9
Moyer is on a distinguished road
Default Re: PID Controller

PID_controller PID_controller

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...
Moyer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-18-2008   #4 (permalink)
Inactive
 
Moyer's Avatar
 
Join Date: May 2008
Posts: 9
Moyer is on a distinguished road
Default Re: PID Controller

Hover platform:


Making a PHX beam stay standing on end:


Neither one is tuned perfectly, they could be made more responsive and accurate with better tuning of the gains.
Moyer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-18-2008   #5 (permalink)
Inactive
 
Mechanical433's Avatar
 
Join Date: Mar 2007
Posts: 159
Mechanical433 is on a distinguished road
Default Re: PID Controller

I don't understand its use...



EDIT: JUST UNDERSTOOD ITS GREAT

Last edited by Mechanical433; 05-18-2008 at 05:20 PM.
Mechanical433 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-18-2008   #6 (permalink)
Inactive
 
Ergzay's Avatar
 
Join Date: Jun 2007
Posts: 221
Ergzay is on a distinguished road
Default Re: PID Controller

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.
Ergzay is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-18-2008   #7 (permalink)
Moo Cow

Points: 5,453, Level: 47 Points: 5,453, Level: 47 Points: 5,453, Level: 47
Activity: 7% Activity: 7% Activity: 7%
 
turck3's Avatar
 
Join Date: Jun 2007
Location: USA
Posts: 826
turck3 is on a distinguished road
Send a message via AIM to turck3 Send a message via MSN to turck3 Send a message via Yahoo to turck3
Default Re: PID Controller

Very interesting indeed... although it seems like a simple algorithm, it's still very useful; good job.
turck3 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-18-2008   #8 (permalink)
Inactive
 
Mechanical433's Avatar
 
Join Date: Mar 2007
Posts: 159
Mechanical433 is on a distinguished road
Default Re: PID Controller

Halp !!

I can't set it corectly... ( Cant make it hover )

What setting would you use ??
Mechanical433 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-18-2008   #9 (permalink)
Inactive
 
Moyer's Avatar
 
Join Date: May 2008
Posts: 9
Moyer is on a distinguished road
Default Re: PID Controller

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.
Moyer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-18-2008   #10 (permalink)
Inactive
 
Deviance's Avatar
 
Join Date: Mar 2008
Location: [Kansas City] MO
Posts: 94
Deviance is on a distinguished road
Default Re: PID Controller

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]
Deviance is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Turret with Adv. Pod Controller and Cam Controller? Jaded Misanthrope Help & Support 6 07-21-2008 10:47 AM


All times are GMT -7. The time now is 08:06 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0
Ad Management plugin by RedTyger
adjunct
adjunct
adjunct
adjunct
gilt
gilt
gilt
gilt
gallery
gallery
gallery
gallery