How to build a low-cost USB controlled treadmill

This post discusses how to develop a low cost treadmill with a closed-loop feedback controller for reinforcement learning experiments. MATLAB and JAVA code is linked.

Hardware – Treadmill

  • Get a standard household treadmill Samples
  • Note: It should work with a DC-Motor, otherwise a different controller is needed!

 Hardware – Controller

  • Pololu Jrk 21v3 USB Motor Controller with Feedback or stronger (max. 28V, 3A)
  • Comes with a Windows Gui to specify the control gains
  • Sharp distance sensor GP2Y0A21, 10 cm – 80 cm or similar
  • USB cable
  • Cable for the distance sensor
  • Power cables for the treadmill
  • User Guide: https://www.pololu.com/docs/pdf/0J38/jrk_motor_controller.pdf

 Matlab Interface (max. 50 Hz)

  • Get the java library  build or the developer version, both from Sept 2015 created by E. Rueckert.
  • Run the install script installFTSensor.m (which add the jar to your classpath.txt)
  • Check the testFTSensor.m script which builds on the wrapper class MatlabFTCL5040Sensor (you need to add this file to your path)