Two different controllers, not simultaneously

  • Thread starter Fernando Mier Hicks
  • Start date
F

Thread Starter

Fernando Mier Hicks

Hi,

I have a PID controller that magnetically levitates an object. A hall sensor is currently used as the vertical position feedback. This sensor is to be substituted by a differential optic shadow sensor. Basically the sensitivity/resolution of the new sensor is greatly improved but the range in which it gives measurements its greatly reduced.

I was hoping that once the object was levitated and somewhat stabilized (with respect of the lower resolution sensor) then switch to use the more sensitive sensor. Obviously when making the change new PID constants are introduced as well. Basically switch from one PID to another on the fly.

This is done all in software and basically I just update the new constants when I make the switch and get the feedback from the new sensor. Is there any other considerations I should make when making this switch? integral accumulators etc?

Currently it stops levitating when it switches. I assume my constants are tuned incorrectly, but since the high resolution sensor has such low range its difficult to test the tuning of the constants.

Any other advice on how can I integrate this 2 sensor system?

Thanks
Fernando
 
If you change resolution of feedback sensor, that control loop gain increased accordingly. Except necessity to assign the same actual position value with each transfer, you need to perform "bumpless" control for eliminate any possible spikes with such transfer.
 
interesting project!
as explained by Leon,
1. what is the range of the sensor of lesser resolution and that of the higher resolution( i hope the former range envelopes the latter)?
2. what is the software?
3. what is the actuator(the thing that takes the control signal from pid controller and levitates the object)?

>Currently it stops levitating when it switches. I assume my constants aretuned incorrectly.<

are you sure?
is the pid controller built in the software?
 
F

Fernando Mier Hicks

1. Range of lesser resolution sensor is 1cm. Range of higher resolution senros is around 0.1mm. (100 less) but with 100 more times resolution.
r

2. software is running on a microcontroller, standard PID algorithm.

3. Actuator is a PWM driven electromagnet

4. I assume my constants were tuned incorrectly because I have not a good of tuning them.(for the high resolution sensor only)

Thanks
 
>I assume my constants “were” tuned incorrectly because I have not a good of tuning them.(for the high resolution sensor only)<

Is the problem identified? If yes, kindly explain.

In case we are not that lucky, I don’t know how do you actually switch, and the exact algorithm that is employed but I hope you have taken care of the thing Leon pointed out in his first reply.

With resolution range is changing too.

Could you operate with the higher resolution sensor sensor alone, no switching.

0.1mm range, so its sophisticated.

By the way, what is the switching frequency of the present pwm? What is the max frequency possible with that microcontroller? Will the electromagnet conform to that?

You are currently using pid, what do you think about a fuzzy controller.
 
Top