Open Loop Control Strategy - RobotCasserole1736/RobotCasserole2015 GitHub Wiki

Background

Generally, the simplest type of control system is of an open-loop design. Open-loop implies there is no feedback from the robot to its own control algorithm. The control algorithm can only command motor values; it has no knowledge of what the result of those commanded values was. We must rely solely on the driver to provide proper inputs to achieve the desired motion.

Open-Loop

This architecture will form the basis of our first control strategy.

Open Loop Control Algorithm

We assume the following inputs are available to our control algorithm:

  • X = driver desired side-to-side motion
    • Assume motion to the right is positive, motion to left is negative
  • Y = driver desired forward or reverse motion
    • Assume forward is positive, reverse is negative
  • Z = driver desired rotation
    • Assume clockwise rotation is positive, counterclockwise rotation is negative.

As per our theoretical drivetrain model, we have three motor outputs to command (M1, M2, and M3)

Also, as indicated in the drivetrain model, running any of M1, M2, or M3 by themselves can produce certain motions. Running them in combination will cause a net motion which is the sum of the individual motions from each motor.

Our software should implement one function per motor output, where each function relies upon X, Y, and Z.

It can be easily seen from inspection that running both M1 and M2 in the same direction will cause motion in a purely forward or reverse direction. Similarly, running M1 and M2 in opposite directions will cause rotation, but not traversal motion. Finally, running M3 by itself produces some sideways motion. Based on these facts, we can begin equations to map inputs to outputs:

M1 = Y + Z
M2 = Y - Z
M3 = X

However, these equations by themselves are not sufficient. One can note that when the driver commands side-to-side motion by making X non-zero, M3 alone will run. This will cause side-to-side motion, but will also cause rotation. Since the driver commanded only side-to-side motion, this rotation is unwanted.

Given the physical constraints of the system, the only way to counteract rotation induced my M3 is to run M1 and M2 in opposite directions.

From inspection, it again can be determined that while M3 is running forward, M2 must be run forward and M1 must be run in reverse to counteract the rotation, while preserving the side-to-side motion.

Although we have found a method of counteracting the unwanted rotation, there is still an issue: how much correction is required? The faster we run M3, the more correction will be needed from M1 and M2. However, since M1 and M2 are collectively driven by four CIM motors, and M3 is driven by one, it is likely that the same magnitude of motor command should not be applied to all three motors. Furthermore, M1 and M2 are not the same distance from the robot's center of mass as M3. This yields irregularities in the tractive effort each motor is capable of.

We will assume for simplicity that the required rotational correction effort is a linear function of the desired sideways force. Additionally, we will not attempt to solve for the exact relationship, but rather leave parameters in the code to be tuned to match the physical constraints of the robot.

To this effort, we introduce the constants K1 and K2, which will be used to tune the corrective effort.

The final input-to-output equations then become:

M1 = Y + Z - K1 * X
M2 = Y - Z + K2 * X
M3 = X

Tuning K1 and K2

Trial and Error will be used to determine K1 and K2.

Once the drivetrain has been completed, the following procedure will be used:

  • Start with K1 and K2 equal to zero.
  • Attempt side-to-side motion. Observe the unwanted rotation
  • Set K1 and K2 to 0.5. If the robot under-corrects, increase K1 and K2 by half their current value. If the robot over-corrects, reduce K1 and K2 by half their current value.
  • Repeat the above step with new values of K1 and K2.
  • It is suspected that with a well-designed drivetrain, K1 should be equal to K2. However, if forward/reverse motion is observed, offset K1 and K2 from each other to correct.
  • Repeat until driver is satisfied with robot behavior.