Teaching Robotic Control Concepts with a Robotic Arm, an Arduino Microcontroller, and Simulink
By Eric Marchand, Prytanée National Militaire
Whenever possible I introduce real systems into the classroom to analyze, model, and solve complex physical systems. When students can actually see how control commands affect system behavior, the entire learning experience becomes more meaningful to them. To help students tackle hands-on projects, I introduce them to MATLAB® and Simulink®. They grasp these tools easily and are soon using them to modify models to meet specific control requirements. More importantly, the students use MATLAB and Simulink to control real systems running in real time.
Recently, I added an ABB industrial robotic arm to my lesson plans (Figure 1). The control unit for the arm had been broken for some time, rendering the entire arm unusable. I seized the opportunity to create an entirely new control unit based on an Arduino Mega microcontroller managed via an interface based on MATLAB and Simulink.
Building New Robot Control Hardware
Before the ABB robot could be used in class, I had to replace its original control unit, which was damaged beyond repair. I constructed a substitute controller based on the Arduino microcontroller. It included all the necessary interfaces and boards for processing inputs from the robot’s encoders and motor current sensors (Figure 2).
Educational lab equipment can be very expensive. I was able to create a custom setup with a microcontroller ready to be programmed in the MATLAB and Simulink environment for less than 100 euros. Compared with a black-box system, this setup gives me much greater control over what I can teach and how.
Teaching Control Software Principles with ERICC3
To help the students get started, I created a simple presentation page in Simulink that outlines the startup, shutdown, and homing procedures to use when working with the robot (Figure 3).
In class, I introduced the principles of control theory. I highlighted the limitations of a direct control chain and explained how more complex feedback loops are often needed to meet the constraints or requirements of a particular control scenario. I then demonstrated these concepts via a simulation in Simulink and on ERICC3.
The class was divided into groups of four or five students, and each group was assigned a role, such as project management, experimentation, or simulation. In addition to completing the responsibilities of their assigned role, each group had to make a final oral presentation to the entire class.
Among the first tasks the students tackled was developing a PID control model in Simulink for a single motor. They used this model to optimize servo parameters via simulation before running the controller in real time on the Arduino Mega with the robotic arm. They then performed a gap analysis, generating a plot to compare commanded position and speed with actual position and speed measurements collected during experiments (Figure 4).
I gave the students a specification describing a series of movements for the arm to perform. They had to use the specification to extend or modify a Stateflow® chart (Figure 5), which they then used as a supervisory controller that automates initialization of the arm and its movement while continuously monitoring each motor’s current.
Next Steps
There are several areas in which I can improve the lessons that I teach with the robotic arm. I see opportunities, for example, to add more control parameters and to compare model simulation results with measured results. I also plan to incorporate frequency response analysis with Bode plots in MATLAB. Each concept or principle introduced will be tied to a practical implementation with the robot. Concrete, tangible experiences are more memorable than anything a textbook or on-screen simulation can provide.
Published 2019