Actuate Motors

The controller uses the information obtained from the reflectance sensor to decide the amount by which the Zumo Robot has to be turned. This output is fed to the model we had discussed in the previous tutorial as the 'omega' parameter to control the motors. For this model, we assume that the forward velocity of the Zumo Robot remains constant.
Thus with this workflow, at every time instant, we compute the position of the Zumo Robot relative to the black line. From that computation, we decide the amount by which the Zumo Robot should turn to continue staying on the line, and using that value we turn the Zumo Robot at that instant.

This process allows the Zumo Robot to follow the black line. This process can repeated an infinite number of times or till a stopping criteria is met, at which state, we can stop the computation. To vary the time duration for which the program runs, you can modify the value highlighted below to 'inf' for infinite time, or to any finite value (The unit for the number is seconds).

Once you have tuned the PD Controller, to build and download this model on the ZumoBot, click on the Build or Deploy on Hardware button in the right top corner of the model:
Read the messages in the bottom status bar in the model window to confirm that the model is successfully downloaded to the target.
This guide was first published on May 19, 2014. It was last updated on May 19, 2014.
This page (Actuate Motors) was last updated on Jul 04, 2020.