直交エンコーダー
Arduino® ハードウェアに接続された直交エンコーダーの制御
直交エンコーダーは、回転シャフトの速度と方向の測定に使用できるインクリメンタル エンコーダーです。シャフトの角回転を、シャフトの移動方向を示すデジタル パルスに変換します。パルス間の時間差を測定することで、速度を導出できます。直交エンコーダーは、双方向の位置検出と長さ測定の用途で使用できます。直交信号を復号化してシステムへの感覚入力として使用し、回転デバイスの速度、加速度、および位置を判定できます。復号化には X1、X2、X4 の 3 種類があり、それぞれ各回転サイクルで 1、2、4 パルスを提供します。精度と角度分解能が最も高い X4 復号化のみがサポートされます。
直交エンコーダー関数を使用する前に、arduino を使用して Arduino オブジェクトを作成します。詳細については、Connect to Arduino Hardwareを参照してください。
関数
rotaryEncoder | Connection to quadrature encoder on Arduino or ESP32 hardware |
resetCount | Set count value to zero or user-specified value |
readCount | Read current count value from encoder with X4 decoding |
readSpeed | Read current rotational speed |
トピック
- Control Rotary Encoder Knob
This example shows how to use the MATLAB® Support Package for Arduino® Hardware to control a 12-step rotary encoder with a built-in push button.
- Steer Two-Wheel Robot
This example shows how to use the MATLAB® Support Package for Arduino® Hardware to steer a two-wheel Arduino-based robot with closed-loop control.