Motor Carrier
使用 MKR Motor Carrie 或 Nano Motor Carrier 上的两个编码器输入,在闭环控制中控制伺服电机以及 DC 电机 M1 和 M2。在使用 motor carrier 函数之前,请创建 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.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 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)