If you don’t want to read blobs of text I created a video that explains the module and gives an example.
A PID (Proportional, Integral, Derivative) Controller is a type of closed feedback loop that uses an algorithm to get an output that gets to the desired position quickly, doesn’t overshoot, and can resist transient errors.
PID was created for applications such as heating (to get to a desired temperature), robotics (getting a motor to a specific velocity), and cruise control for a car. The set point of a PID controller is the value you want to achieve, and the process value is the value read from the environment. PID gains are the constant values to tweak the reactions of the system (kP, kI, and kD). For a more in depth explanation of PID, see this YouTube series.
RoPID implements the PID algorithm into Roblox! It can be used for custom BodyGyros, BodyPositions, and BodyVelocities, as well as cruise control for cars or as dynamic GUI animations. PID is super useful for vehicles to get just the right amount of handling. Unlike any other PID module, RoPID has built in integral windup clamping (to stop drastic changes in output) as well as a few utility modules to assist with the PID process.
Example PID Uses:
Ball rolling with a constant velocity (uses base RoPID module)
GUI frame following mouse, but with dynamic movement (uses Vec2 Util module)
Ball following goal part (uses Vec3 util module)
I created a submarine in this video using RoPID. It’s a good example of the module in use. The uncopylocked place is here.
Installation
- Get the Roblox Model and put it wherever you want (ReplicatedStorage recommended)
- Go to the GitHub Repo and either download the zip or add a git submodule, then sync the
src
directory into your place using a tool like Rojo