Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PID controller for lavitation

Status
Not open for further replies.

nileshthakare2

Member level 1
Joined
Jul 16, 2011
Messages
34
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,618
Hi,


I want to levitate the magnet with the help of electromagnet.Same like this link(_-= Uzzors2k =-_ Project Site am using micro controller to control the PWM cycle.I am very near to levitation but my magnet is not able to levitate.if Magnet reach up to my set point i pass 0 duty cycle then also my magnet collapse with electromagnet.I want to tune the PID.Please help me.I change my set point at all the thing but magnet never levitate.If anyone knows about that please help me.
thanks in advance
 

It sounds like your PID loop needs tuning-it's unstable. Since your duty cycle goes to zero when you reach your setpoint, it sounds like you might have too much gain; trying lowering your P value. Also, too large a value for I will also cause instability.
 

Hi Sir,

This is my PID loop.#define dt 0 //100ms loop time
#define Kp 0.5

#define Kd 0.0
#define Ki 0.0//0.0005


static float pre_error = 0;
static float integral = 0;
float error;
float derivative;
float output;


void PID (float setpoint,float actual_position)
{



//Caculate P,I,D
error = (actual_position-setpoint);

//In case of error too small then stop intergration
if(abs(error) > epsilon)
{
integral = integral + error*dt;
}
derivative = (error - pre_error)/dt;
output = Kp*error + Ki*integral + Kd*derivative;

//Saturation Filter
output = ( output < 0) ? 0: output;
output = ( output > 100) ? 100: output;
//Update error
pre_error =error;

PWM_change(output);
USART_Transmit_String("\r\nADC=,");
convert(actual_position); // ADC value
USART_Transmit_String(",PID=,");
convert(output); // PID output

}
I have used Single hall effect sensor. How can I tune my PID ? I think 0.5 proportional gain is constant to get 0 to 40 % duty cycle. My Ton + Toff =0.12 ms .Whats i do to tuning my PID.

thanks in advance
 

You shouldn't expect, that any controlled system or plant can be controlled by a PID. There are some points, why it may be not the case for a levitation magnet:
- it's an inherently unstable control process, means you can't keep a balanced position with a constant output
- the current-to-force characteristic is most likely strongly position dependent
- the position sensor (is it a light barrier?) may be non-linear in addition

If you are able to determine statical magnet and position sensor characteristics, you should be able to decide about controller requirements.

In control theory, a state space controller, possibly utilizing additional linearization elements is the general approach to deal with problematic control processes.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top