Encoder
Measure incremental position and direction of rotating motor
Libraries:
Raspberry Pi Blockset /
Basic
Description
The Encoder block outputs the tick count from a quadrature encoder on a rotating motor connected to a Raspberry Pi® hardware board. Every increment in the tick count of the encoder indicates that the motor is rotating clockwise. Every decrement in the tick count of the encoder indicates that the motor is rotating counterclockwise. The total tick count represents the incremental position of the rotating motor.
You can reset the encoder readings from the block using the Reset mode parameter in the block parameters dialog box.
When simulating without hardware, this block outputs zeros. For more information, see Block Produces Zeros or Does Nothing in Simulation (Simulink).
Note
To generate code C/C++ code for this block, you must have an Embedded Coder® license.
Ports
Input
Output
Parameters
Extended Capabilities
Version History
Introduced in R2021a
