The easiest way would be to make the PID for velocity instead of position, and then set it for the desired speed.
How could i add clamp to it, so it would travel at lower but constant speed?
The easiest way would be to make the PID for velocity instead of position, and then set it for the desired speed.
My programs: BIOS - Alcyone - Calculator - Notepad - Movie Player
My tutorials: applyTorque - Quaternions - PID controllers
Some other things I made: FT Chip - RK4 Solar System
Or you could just clamp the out value:
Where N is the max absolute value.Code:E:applyForce( clamp( Out*E:mass(), vec(-N,-N,-N), vec(N, N, N) ) )
"If anybody says he can think about quantum physics without getting giddy, that only shows he has not understood the first thing about them."
-- Niels Bohr
This won't work if there is no air resistanceBut yeah, since there is air resistance on most servers, it will work, though you will have to find the proper N value by experimenting.
My programs: BIOS - Alcyone - Calculator - Notepad - Movie Player
My tutorials: applyTorque - Quaternions - PID controllers
Some other things I made: FT Chip - RK4 Solar System
Can you change the code in the first post to [code] instead of [highlight]? Highlighting seems to be broken and it is REALLY hard to see the code.
U.S. Air Force
Terminator 3 HK-Drone Project
Download V2 HERE
New Halo Reach Falcon Project coming soon
Oh right, thanks for the reminder.
My programs: BIOS - Alcyone - Calculator - Notepad - Movie Player
My tutorials: applyTorque - Quaternions - PID controllers
Some other things I made: FT Chip - RK4 Solar System
Sorry for necromancing, but I want to know a formula for getting the GainP GainI and GainD. Dont want to have to use trial and error all the time :P.
Bookmarks