Changes between Version 4 and Version 5 of ControlSystems/SoftwareTeam/Training/GettingStarted/Encoders
- Timestamp:
- Oct 31, 2019, 12:43:43 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ControlSystems/SoftwareTeam/Training/GettingStarted/Encoders
v4 v5 2 2 In the [wiki://ControlSystems/SoftwareTeam/Training/GettingStarted/DCMotor previous example], we controlled the amount of power we were giving the motor (0=none, 1.0=full power), 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].[[Image(simple_encoder.jpg )]]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].[[Image(simple_encoder.jpg,right,150px)]] 5 5 6 We connect encoders either directly to !RoboRio DIO ports or to an intelligent motor controller such as the !TalonSRX. The intelligent motor controllers can make use of the encoder data independently which offloads work from the !RoboRIO; in general, if you have smart motor controllers, the encoders should connect to them. We'll provide examples both ways:6 We connect encoders either directly to RoboRio DIO ports or to an intelligent motor controller such as the TalonSRX. The intelligent motor controllers can make use of the encoder data independently which offloads work from the !RoboRIO; in general, if you have smart motor controllers, the encoders should connect to them. We'll provide examples both ways: 7 7 8 8 === Encoder connected to RoboRIO DIO (Macademia)