writeAngularPosition(pidObj,position)
rotates the DC motor shaft with feedback from the encoder in closed loop position
control by the position specified in radians.
writeAngularPosition(pidObj,position,mode)
rotates the DC motor shaft with feedback from the encoder in closed loop position
control by the position specified in radians, and the specified mode.
Connection to the PID motor on MKR Motor Carrier or Nano Motor Carrier in
the position control mode, specified as an object.
position — Position of the shaft double
Position of DC motor shaft, specified in radians.
mode — Mode of calculation of angle of rotation abs | rel
Mode of calculation of angle of rotation, specified as
abs or rel. In both the
abs and rel mode, the angle of
rotation of motor shaft is calculated based on current count of the encoder
register. In the abs mode, the motor rotates by a
difference in the angle between the current and desired position. In the
rel mode, the motor rotates by the angle that is
input.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.