モーター キャリア
MKR Motor Carrier または Nano Motor Carrier 上の 2 つのエンコーダー入力を使用して、閉ループ制御でサーボ、DC モーター M1 および M2 を制御します。モーター キャリア関数を使用する前に、arduino オブジェクトを作成します。詳細については、Connect to Arduino Hardwareを参照してください。
関数
motorCarrier | Connection to Arduino MKR Motor Carrier or Nano Motor Carrier |
pidMotor | Connection to motors in closed-loop PID control on Arduino MKR Motor Carrier or Nano Motor Carrier |
readAngularPosition | Read angular position of DC Motor in closed-loop control |
readSpeed | Read current rotational speed of DC Motor in closed loop control |
writeAngularPosition | Rotate DC motor by specified angle in closed loop position control |
writeSpeed | Write speed of PID motor |
rotaryEncoder | Connection to rotary encoder on Arduino MKR Motor Carrier or Nano Motor Carrier |
readCount | Read current count value from encoder connected to MKR Motor Carrier or Nano Motor Carrier |
readSpeed | Read current rotational speed of motor from rotary encoder |
resetCount | Set encoder count value to zero or specified value |
servo | Connection to servo motor on Arduino MKR Motor Carrier or Nano Motor Carrier |
writePosition | Write position of servo motor connected to MKR Motor Carrier or Nano Motor Carrier |
トピック
- Using Arduino Engineering Kit Rev 2 with Pre-Configured Projects in Support Package
Learn how to use Arduino® Engineering Kit Rev 2 with the support package.
注目の例
Webcam Controlled Rover Using Arduino Engineering Kit Rev 2
Use Arduino® Engineering Kit Rev 2 to program a differential drive robot that can be remotely controlled by MATLAB® over Wi-Fi® to perform operations such as path following and moving objects with a forklift along with obstacle avoidance.
Drawing Robot Using Arduino Engineering Kit Rev 2
Use Arduino® Engineering Kit Rev 2 to build and program a robot that extracts line traces from an image and reproduces it as a drawing on a whiteboard. The project uses MATLAB® code to capture an image using a webcam, and then convert it into a set of motor commands using image processing techniques, which drive the robot across a whiteboard and reproduce the captured image as a drawing.
Self-Balancing Motorcycle Using Arduino Engineering Kit Rev 2
Use Arduino® Engineering Kit Rev 2 to build and program a motorcycle bot that self-balances and maneuvers by itself using a flywheel. The project models the motorcycle with the help of inverted pendulum dynamics and performs inertial sensing to balance the motorcycle by controlling the flywheel, located at the center of the motorcycle.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)


