Add motor control docs#33
Conversation
| ## Open- and Closed-loop mechanisms | ||
|
|
||
| The manner in which you control a mechanical mechanism can be split into two categories: open-loop, and closed-loop. | ||
| Open-loop refers to a mechanism that uses no measurement to correct the output of the motor. |
There was a problem hiding this comment.
A short example would be good here - like:
"Open-loop refers to a mechanism that uses no measurement to correct the output of the motor: like setting voltage or throttle".
|
|
||
| The manner in which you control a mechanical mechanism can be split into two categories: open-loop, and closed-loop. | ||
| Open-loop refers to a mechanism that uses no measurement to correct the output of the motor. | ||
| Closed-loop mechanisms use measurements, such as an encoder reading, to adjust the output of a motor to get closer to a target setpoint. |
There was a problem hiding this comment.
Maybe add "For example, PID control." at the end
| ## Open Loop Control | ||
|
|
||
| Some mechanisms don't require the precision that is gained through closed-loop control. | ||
| Intake rollers, for example, are commonly controlled simply by running the motor at a set duty-cycle. |
There was a problem hiding this comment.
It's probably better to define what duty cycle means before using the term.
Also, 2027 wpilib uses throttle as the term(in MotorController.setThrottle), so it might be better to use that instead
|
|
||
| The two most common open-loop setpoint types are duty-cycle and voltage. | ||
|
|
||
| Duty-cycle is a percentage of input voltage coming from the robot's battery. |
There was a problem hiding this comment.
A nitpick, but the definitions are a bit circular here since you reference voltage when defining duty cycle, and reference duty cycle when defining voltage. You could say:
"voltage is a measure of the electrical output to the motor. If motor A is set to 12 volts and motor B to 6 volts, motor A will eventually reach a speed twice as fast as motor B. "
"duty cycle/throttle measures the proportion of a motor's maximum possible voltage output. This depends on the battery voltage..."
| #### Measuring your mechanism | ||
|
|
||
| The feedback sensor in position-controlled mechanisms is commonly an encoder, a small electronic device that can measure rotation. | ||
| Another option is a potentiometer, which is similar to an encoder, but analog, and may have limited travel distance. |
There was a problem hiding this comment.
I don't think anyone uses potentiometers anymore, so idk if this is necessary
e9576d6 to
edf656a
Compare
b5680fd to
6ca05c8
Compare
ea813ca to
f514f00
Compare
roboteer5291
left a comment
There was a problem hiding this comment.
Overall, the content on this page is solid. However, I think the flow of the page and the ordering has a lot to be desired, especially with wherever it ends up in the course, and what of this would've already been discussed.
I also think some discussion of motor dynamics, current, torque, etc. would be very beneficial for some of this (particularly for velocity FF and why setting a constant voltage makes a motor spin a certain speed eventually).
Also, idk what ide you're using, but see if you could download a spellcheck plugin. There's a good amount of typos in this, that I didn't want to manually request a change on all of them and I probably wouldn't catch them all anyways.
| # Controlling mechanisms with motors | ||
|
|
||
| With the introduction of the brushless era of motors in FRC, motors have become the dominant choicewhen it comes to controlling robot degrees of freedom, compared to servos or pneumatics. | ||
| Brushless motors have incredible size to performance ratios, and the smart motor controllers that accompany them make it easy to control a variety of mechanisms. |
There was a problem hiding this comment.
Is this intro section necessary? I'm not sure it's necessary to refer to pre-covid pneumatics usage. The discussion of performance also isn't really relevant, as it's basically just the standard at this point.
| This section will cover the most common types of software controllers for motors in FRC. | ||
|
|
||
| ## Motor Controllers | ||
| Not to be confused with hardware motor controllers like the REV Spark Max or CTRE TalonFX, a software motor controller is a function that converts a setpoint input to a motor output. |
There was a problem hiding this comment.
I don't think this is really a standard term. At least, not something I've heard referred to like this before. This just feels very confusing to introduce a duplicate term that really only is used here
| The two most common open-loop setpoint types are duty-cycle and voltage. | ||
|
|
||
| Duty-cycle is a percentage of input voltage coming from the robot's battery to the motor controller. | ||
| WPILib refers to this percentage as throttle. |
There was a problem hiding this comment.
Duplicate explanation of throttle from above
| By attaching the encoder to the final shaft of a rotating mechanism, such as an arm, you can treat the encoder reading as _absolute_, requiring no homing sequence or specific power-on location. | ||
|
|
||
|
|
||
| ### Closed-Loop Velocity Control |
There was a problem hiding this comment.
This section should probably be above closed-loop position so that it's physically closer to closed-loop velocity
|
|
||
| ### Closed-Loop Position Control | ||
|
|
||
| Position control is the most common closed-loop control scheme in FRC. |
There was a problem hiding this comment.
I feel like this sentence is unnecessary. It really only makes sense if you go "I want closed loop control", then as "hmm what should I do, position or velocity?" and then decide position. Making the sentence go the other direction "If you need to control the position of a mechanism, closed-loop control is how you do that" (word it better of course), the sentence makes more sense in context.
| In years when you have to shoot multiple game pieces one after another, like in 2026 Rebuilt, closed-loop control can help your flywheel recover between shots in a way that open-loop alone cannot. | ||
|
|
||
|
|
||
| ## Choosing a control scheme |
| ## Open- and Closed-loop Controllers | ||
| The types of controllers that you can create can be split into two categories: open-loop, and closed-loop. | ||
| Open-loop refers to a mechanism that have only a single input, the setpoint. | ||
| Open-loop controllers will often, but not always, utilize a mathematical model of the motor and mechanism to make an educated estimate of how the motor should act in order to reach the setpoint. |
There was a problem hiding this comment.
Especially RE the comment about the open-loop section being titled better below, this line adds confusion.
| Not to be confused with hardware motor controllers like the REV Spark Max or CTRE TalonFX, a software motor controller is a function that converts a setpoint input to a motor output. | ||
| In the simplest case, the input _is_ the output, such as when using voltage or throttle (duty-cycle) control. | ||
|
|
||
| A more complex example would multiply the setpoint, say a flywwhel rpm, by some constant to convert to volts for the motor. |
There was a problem hiding this comment.
I feel like this is putting the cart before the horse. Using the example of FF before any of that is introduced doesn't make much sense.
|
|
||
| The simplest open-loop mechanisms require almost no configuration in code, since you don't need to configure gear ratios or feedback gains. | ||
|
|
||
| The two most common open-loop setpoint types are duty-cycle and voltage. |
There was a problem hiding this comment.
This discussion of duty cycle vs position really needs to be the first thing discussed on this page because how you actually make the motor spin and the concepts behind that is the root of everything else on this page.

No description provided.