Implementing a Profiled Mechanism
Profile plus feedback in a subsystem.
Profile plus feedback in a subsystem.
In this lesson, you will:
A profiled mechanism uses the profile as a moving target and PID/PIDF as the follower. The profile decides where the mechanism should be; feedback decides how hard to push.
The subsystem owns the profile, timer, previous target, current target, and output. The OpMode only asks for named states.
When target changes, build a profile from current position to target and reset timer. Each loop, calculate current profile state and control toward it.
ProfiledMechanism.javaJava
if (target != previousTarget) {
profile = new AsymmetricMotionProfile(currentPosition, target, constraints);
timer.reset();
previousTarget = target;
}
ProfileState state = profile.calculate(timer.seconds());If the profile is rebuilt every loop, motion never progresses. If hold behavior is poor, tune travel and holding separately.
Build a profiled lift or arm subsystem with telemetry for target, actual, velocity, error, and output.
Check your understanding before moving on.
0 of 2 answered