Connection to motors in closed-loop PID control on Arduino MKR Motor Carrier or Nano Motor Carrier
This object represents a connection to motors running in closed-loop PID control with the specified motor number on the MKR Motor Carrier or Nano Motor Carrier. You can control the DC motors M1 and M2 in closed-loop PID control using the functions in Object Functions.
creates a connection to the PID motor at the specified port number and the specified
control mode on the Arduino MKR Motor Carrier or the Nano Motor Carrier.pidObj = pidMotor(mcObj,PIDNumber,controlmode)
creates a connection to the PID motor at the specified port number with the specified
pulses per revolution on the Arduino MKR Motor Carrier or the Nano Motor Carrier.pidObj = pidMotor(mcObj,PIDNumber,controlmode,ppr)
creates a connection to the PID motor at the specified port number and specified PID gains
on the Arduino MKR Motor Carrier or the Nano Motor Carrier.pidObj = pidMotor(mcObj,PIDNumber,controlmode,ppr,[PIDGains])
Use these object functions to create a connection to the PID motor:
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 |
arduino | dcmotor | motorCarrier | rotaryEncoder | servo