Changes between Version 12 and Version 13 of ControlSystems/SoftwareTeam/Training/GettingStarted/Encoders
- Timestamp:
- Oct 31, 2019, 1:17:38 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ControlSystems/SoftwareTeam/Training/GettingStarted/Encoders
v12 v13 2 2 [[Image(Encoder-Working-Principle.gif,right,350px,margin=10)]] In the [wiki://ControlSystems/SoftwareTeam/Training/GettingStarted/DCMotor previous example], we controlled the amount of power we were giving the motor (-1.0=full reverse 0=none, 1.0=full forward), but that doesn't tell us how fast or far the wheel is turning. Just like a car or a bicycle, for a given amount of power, the speed will vary with how heavy the robot is, whether it's going up a hill or down a hill, how good the traction is, etc. To determine how fast a wheel is turning or how much it has turned, we use encoders. 3 3 4 An encoder is a device attached to the motor or wheel shaft that generates a pulse with each partial rotation (e.g. every 1-degree or 5-degrees of rotation, another pulse is generated). By counting these pulses, we can tell how fast the wheel is turning or what position it is in. We can use this information to do things like make a robot travel a fixed distance or at a set speed. You can read more about encoders [https://wpilib.screenstepslive.com/s/currentCS/m/java/l/599717-encoders-measuring-rotation-of-a-wheel-or-other-shaft here].4 An encoder is a device attached to the motor or wheel shaft that generates a pulse with each partial rotation (e.g. every 1-degree or 5-degrees of rotation, another pulse is generated). By counting these pulses, we can tell how fast the wheel is turning or what position it is in. We can use this information to do things like make a robot travel a fixed distance or at a set speed. You can read more about encoders on [https://wpilib.screenstepslive.com/s/currentCS/m/java/l/599717-encoders-measuring-rotation-of-a-wheel-or-other-shaft ScreenStepsLive]. 5 5 6 6 We connect encoders either directly to !RoboRio DIO ports or to an intelligent motor controller such as the TalonSRX. Intelligent motor controllers can use encoder data to offload work from the RoboRIO (e.g. to keep a wheel spinning at a set speed); in general, if you have smart motor controllers, the encoders should connect to them. We'll provide examples both ways: