Computer & Microcontroller Based Closed Loop Robot Position Control System

Not : Daha önce yazdığım proje yazısının birebir olmasa da çevirisi sayılabilecek bir yazı hazırladım. This is a short summary of our (me and my friend Umut Yuksekbas) graduation project. Sorry for the grammatical mistakes.

Computer & Microcontroller Based Closed Loop Robot Position Control System

Abstract : Robot systems scope out the problems fast and sensitive, don’t affected the factors which destructive of health for humans. For this reason they are needed at industrial areas. Robots are used for precise applications in a wide area such as automotive industry, medicine, nuclear power stations and biomedical. They can be used in critical applications like sensitive surgical operations. That’s commonly utilized as a mechanical arm for handicapped ones. Our project’s subjects are automatic control systems and position control of a robotic arm with the coordinates that send from computer. We intended to design a closed loop control system of a mechatronic system. Manipulator system is a multi-input multi-output (MIMO) system and each joint is fed by different input signals for position check. Dynamic model of the manipulator system is not linear and contains interactive terms between joints. We have designed a 6-degree-of-freedom robot arm and a control system. DC motors on the joints provide the movement of the manipulator. We used L298 IC which contains H-Bridges for driving the DC motors and PIC 16F877 as microcontroller. Max232 serial interface sets up the communication between computer and microcontroller. We developed the position control algorithm in MPLAB IDE by using the Hitech PICC Compiler. Microcontroller takes the analog feedback signals from the potentiometers placed on joints then convert them to digital signals by built-in ADC modules. The PI control system uses the analog signals in order to calculate the optimum PI control parameters then provides the target movement with minimum error.

SYSTEM COMPONENTS

Hardware Component

PIC 16F877-20MHz contains 8 ADC channel and 2 PWM module and L298 contains two H-Bridge in it. This driver is very robust and is able to work with 46 V source voltage and 4 A source current. In this project  15 V source voltage and 0.5 A max current are utilized.

Block Diagram

Block Diagram

Position data which transmitted from computer come to the PIC’s serial port over the Max232 serial interface. After that, the ADC module reads and converts the analog values and transmits signals to the motor drivers for holding the arm in target position. The algorithm determines the transaction direction for decreasing the error and sends the signals. It breaks the motors when the arm is on the target position. Microcontroller checks all of the joint positions repeatedly and if it senses a deviation on the joint, brings the joint back to the target position. The algorithm changes the motor voltages directly proportional to the error

Schematics

Schematics

PCB Design

A 2-layer circuit board was designed and assembled. L298 ICs can be seen on the right side of the first image. The sockets from top to bottom;

  • Power
  • Analog Feedbacks (From joint pots)
  • Motors

PCB 1

PCB 1

PCB 2

PCB 2

Software Component

We developed the microcontroller code by using HITECH PICC in MPLAB IDE. The P.I. Control System on the microcontroller side, calculates the error by differentiating the feedback values which read from ADC module and the expected value, continuously for each joint. This error value multiplied by Kp constant. All these error values summed and multiplied by Ki constant. The control signal which derived by summing the proportional and integral control signals, limited in a desirable range.

Control Signal

Control Signal

This calculation repeats for each joint over and over again for providing the position control. Ziegler-Nichols method were used for designing the control system, because it was not possible to get the technical data about mechanical system for deriving the mathematical model.

Controller Design

Controller Design

D and I constants of PID controller let by zero and, the P constant were increased until the system oscillates. The P constant on that oscillation time called Kc and the oscillation frequency called Tc.

Oscillation

Oscillation

The optimum P.I. Control parameters were derived by using the Ziegler-Nichols method. The system response is below mentioned.

System Response

System Response

Graphical User Interface Design

Graphical User Interface (GUI) was developed by using QT Designer and Kdevelop Integrated Development Environment in C++ programming language. The GUI design can be seen below. QT libraries are suitable for creating platform independent code. By this way, the GUI can be compiled and run under various platforms, such as Unix, Linux, FreeBSD, MacOS and Windows.

GUI

GUI

The coordinate data transmitted over the USB bus by using a USB/Serial converter with a 57600 baud rate. Control System variables can be changed or modified with the GUI in realtime. Serial port device, baud rate and control system parameters can be selected and changed by using the GUI.

GUI Ayarlari

GUI Ayarlari

Conclusion

The system that we developed can do a position control in Cartesian Coordinate System. It keeps its position unless the operator will give a new coordinate, and can perform a coordinate change in a desirable time. I believe that this project is providing a useful design for industrial areas such as production and test, biomedical, security, situations that harmful for human, and academic study. The future plan for my study is making two robotic arms work together and in cooperation.

Related Posts
  1. Very nice post guy. I will very-very thank’s if you share the shema, code list and many other about this technology. Or, are you have a link to download this. Please give feedback for this suggestion.

  2. Hi.. im starting to work in the same thing, i have to repair a MA2000 arm, its original PC/MOTOR interface its completely damaged, the initial plan its to use a data adquisition card, and build the MOTOR DRIVER circuit, of course,i could the same H-bridge IC L298, but i have any technical data of the big DC motors: max current, voltage. Do u have this info? please help me.

    Excuse me for the spam, i had some ortography mistakes, u can delete the original message.

  3. @Juan
    Hi Juan
    Unfortunately I don’t have any information about motors now. I’ve lost all the project documents. But as you can see from schematics, you can use 5V for yaw/pitch/roll motors, and a bit higher voltage for others. I used 8V for waist, and 15V for shoulder and elbow. But used PWM for these two to set the speed. Actually it’s better to use PWM for all motors but this PIC only has 2 PWM outputs. That’s the demerit of this project.
    IMHO it’s better to use a good ADC card for PC to get feedback from joints and to use a DAC for PC to control the motor controller circuit. L298 is good enough but there are much more better ones in the market which have embedded PWM modules inside.
    I need to say that this system is not so efficient. Just take this as a reference and try to design a better one. And after finishing it, if you share with me, I’ll be grateful. If you need some different ideas from a different point of view, don’t hesitate to ask please.

  4. Hi Aydın, I’m working in a project with MA 2000 robot, as you know, the original controller of this robot works with ISA port to connect with PC, I want to develop some interface based in PIC, what i want to do is to connect the MA 2000 through USB, i have some questions for you, your design could replace the original controller??? :shock: could you helpme with some information about it?? :smile:

    thanks a lot!!!

  5. Actually this design is not a fully replacement for the original hardware. I used a serial interface between PCB and PC but needless to say u can change it to USB.But if you want me to give u and advice, no need to design the whole hardware, especially the micro-controller part. Use a fast and ready-to-use micro-controller like arduino or something else and just design the motor drivers. Or, use ADC and DAC cards to connect over PCI slot of ur regular PC. In that way, u will have multi threading, which will make ur system very accurate and have a smooth control.

  6. Hi Aydin i wanna ask u, if u have a papper or a copy or your work?, as u know i had been working im the ma2000, i used a dsPIC and my GUI its being development using Qt creator too. Your work its of course an antecedent to be mentioned in my project documents. Its for my graduation project.

  7. Unfortunately all I have now is what’s written in this page. My study was not that professional, I think yours will be much better than mine ;) When you finish your work, please share with me too.

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">