Sticky Notes

This blog is officially closed. Do check out the new blog at http://www.utmrobocon.com

Thursday, January 27, 2011

A Word on Controllers

Introduction
We are living in a world of dynamics. What ever physical parameters in this world keeps changing dynamically. What is important is these parameters cannot change instantaneously. For example, John is in London right now and for the next second, he cannot appear in Paris. There have to be a way for him to travel from London and reach Paris.


He may use a plane, or he can swim and walk there, or he can use a bus, or even teleport using some sophisticated technology (if there is one). One important thing is John cannot suddenly appear in Paris. This is the reason we need controllers. So does robotics.

"Control engineering is often called a hidden technology" (Christian Schmid, 2005). I really do agree on this. Control engineering is not like mechanical or electrical or chemical or civil. Those is where the result and product is apparent. For control, the result is not apparent.

People might say human can send people to the moon because of mechanical engineering, or aerospace engineering, or electronics engineering, but they will not say it is because of control engineering. It is not apparent enough. But believe me, control do plays an important role is our daily life.

Examples
Feedback System by K.J. Astrom really provides good examples of control system in life. It ranges from electrical to mechanical, sociology to ecosystem, internet to human. Even control of HIV and AIDS can be related to control system engineering.


In robotics, control is very important to have a desired movement for our manipulator or navigation of wheeled robot. There are few types of controller discussed here namely, Bang bang Control, PID Control, Modern Control, and Intelligent Control.

Bang Bang Controller
This controller is the simplest type of controller. It is easy to implement in a microcontroller using a IF-THEN-ELSE-THEN pseudo-code. For example if we wanted to control a position of a robot, we could read a counter from a rotary encoder and set the motor speed.
___________________________________________
while(1){
    if(counter > DESIRED_POSITION){
        motor_speed = 1000;
    } else {
        motor_speed = 0;
    }
}
___________________________________________
Example of position control using bang bang

Although bang-bang controller is simple, but the response is not really desirable. For example the position control, the robot will just oscillate rigorously in the desired_position.

Good implementation of a bang-bang controller is a line following robot.



PID Controller 
This type of controller is also known as a frequency domain controller. If you have taken Control System Engineering in any institute, PID controller is actually placing two poles and one zero.


In other way to put it, PID is a three term controller. The proportional, integral and derivative of error. Integral contributeto one pole and derivative contribute to another pole and another zero.

Of course it is not hard to find the way to implement PID controller and almost 90% of industrial controller is a PID controller.

Modern Controller

For frequency domain controller, only linear actuators can be used. Take for example, if a 5 volts are input to a motor, the speed is 50 rpm, 10 volts, 100 rpm. But it is not necessary if we input 100 volts, the motor will run at 1000 rpm. The relationship is not linear. Again, another example, if we input 5 volts, 50 rpm, 1 volts 10 rpm, not necessary if we input 0.1 volts, it will be 1 rpm. The motor will not move at all at this low a voltage.

Frequency domain analysis cannot take this non-linearity into account. Only time domain analysis can. Therefore, a modern control of state-space representation is needed for analysis.

Another advantage of modern control is the ability to use intelligent control. Most of modern controller analysis uses modern control.

Intelligent Control
This controller deals with artificial human reasoning. When human reasons, they need to have certain kind of inputs and they produce the decision. For example driving a car.



If there is a car in front of me, then I should slow down. Note that this is not similar to a bang bang controller. An example of intelligent control is fuzzy logic.

Conclusion
If we want to have a desirable movement for our robot, we cannot escape from using a controller.

All photo credit goes to respective owner via the link at the photo itself.

Tuesday, January 18, 2011

Singapore Robotic Games 2011


25 January 2011 - 27 January 2011 08:00 - 18:00
Location: Annexe Hall 1

First held in 1993, the annual Singapore Robotic Games puts robots developed by academic, research and industrial institutions through a series of challenging events. These range from the Legged Robot Obstacle Race and the Pole-Balancing Robot Competition to the Robot Soccer Competition and much more.

Find out more at the SRG website.

On 25 Jan, the SRG Opening Ceremony starts at 10am.

On 27 Jan, there will be a Public Lecture at 3pm, followed by the Prizegiving & Closing Ceremonies


(Adopted from http://www.science.edu.sg/Events/Pages/EventDetail.aspx?ID=124@event?ID=124)

Friday, January 7, 2011

Practical PID Controller Part II

First of all, sorry for the late delay after promising for following parts of the practical PID controller. This is going to be a short post as few more parts are going to come up. And in the final post, I will upload the C file and H file for public use along with the documentation.

In this post, I will describe about the derivative part of the controller. From the formula in the first part, it is a derivative of the error that we wants. But in real life situation, usually the sensors data obtain usually are noisy. We can have a simple example here.

Take a function, x(t).
  
The derivative of the sin function will control the frequency. So if the frequency is high, then the value will create a high value of amplification. If the x(t) signal is the noise, then the derivative will cause very high noise.

Therefore, to solve, I have used the approximation of the derivative component by attenuating the higher frequency components. If you have taken Signal classes, you will learn what is Bode plot (anyway, it is pronounced Bow-Dee). Derivative can be approximated with S and the plot for S is shown in the picture below as the dotted line.


To have the higher frequency attenuated, I have added a low pass filter to the Bode plot appears to be like the solid line in the picture above. The formula in frequency domain used is like the formula below.
This will solve the problem of high frequency noise being amplified. But we will face another problem. This problem have been mentioned in the first part, the derivative kick.
Take the formula above, the derivative of the error include the derivative of the set point and the feedback. Where feedback cannot change instantaneously, the set point can. If the user change from one set point to another surely the derivative is very high.
To solve it? Quite a simple solution, just assume the set point as a constant value and only take the derivative of the feedback like the formula above.

All right. For now it is all talk and no action. Of course the action will have to wait. There are few more posts on this practical PID articles and finally I will share the code on how to implement it. Stay tuned.

Link:
Practical PID Controller Part I
Related Posts Plugin for WordPress, Blogger...