User Manual
MCP Series
Brushed DC Motor Controllers
MCP Series User Manual
115
MOTORPWM (2)
Variable array holds the current PWM setting for both motor channels.
main
puts 0,[“Motor 1 PWM:”,dec MOTORPWM(0),13]
pause 100
goto main
MOTORCURRENT (2)
Variable array holds the current reading for both motor channels. Value is in 10ma increments
main
puts 0,[“Motor1 current:”,real MOTORCURRENT(0)/100.0\2,13]
pause 100
goto main
MOTORTARGETPWM (2)
Variable array holds the target PWM setting for both motor channels. This is the PWM value the
motor is increasing/decreasing power to reach.
main
puts 0,[“Motor1 pwm target:”,real MOTORTARGETOWM(0)/100.0\2,13]
pause 100
goto main
MOTORVELKP (2)
Variable array holds the velocity Kp setting for both motor channels.
;initialize motor Kp setting in script
MOTORVELKP(0) = TOINT(1.0*65536.0)
main
goto main
MOTORVELKI (2)
Variable array holds the velocity Ki setting for both motor channels.
;initialize motor Ki setting in script
MOTORVELKI(0) = TOINT(0.5*65536.0)
main
goto main
MOTORVELKD (2)
Variable array holds the velocity Kd setting for both motor channels.
;initialize motor Kd setting in script
MOTORVELKD(0) = TOINT(0.25*65536.0)
main
goto main