RoboResto: PID Arm Motion Control

Posted by Reiner Schmidt on


Before we start trying to build controllers for this arm we need to make sure that the logic of the design is sound. We are going to do some simple "bread-boarding" to get this arm moving. We wont be using any actual breadboard just a motor driver and an STM32 Nucleo controller (stm32f0). 

The Bammer motor driver was released last week and we decided to use this driver to move the robot. The Bammer drive is designed for high power motors but it can also be used for smaller motors with high efficiency. We followed some basic steps to control this arm from the Bammer board. 

  • Connect the Direction, PWM, and Enable pin from the Bammer to a controller (we used an STM32 but really you can use most controllers)
  • Connect appropriate power to the motor driver (12V DC)
  • Connect the Potentiometer to the ADC (A0) pin
  • Write a program to look at the ADC values and move the motor towards the setpoint. This can be done with an if loop or you can use a PID loop for more responsive and smother control. 

From this experiment we learned that there is a bit of backlash in the robot arm system. Some of this error is in the spur gear drives and some is in the fastening of the drive to the arm. It would be very difficult to remove this backlash in hardware so we can hopefully remove it in software. We also learned that the gear drives are quite noisy, nothing we can do about that. 

The above video uses the code featured below. We use a very simple real-time operating system to manage different tasks to control the robot. The program was made with Mbed which is an online IDE. All of the libraries are built in and the below code will run without any background work required (other than wiring of course).