08-13-2012 10:47 AM
Application:
We are designing a motion controller in labview which is then implemented on FPGA. Currently, we are using a PID controller which is implemeted using simple arithmatic blocks in labview and it gets easily ported to the FPGA.
Estimator
We want to try more complex control design which involves using an estimator. I tried playing with both control design module and simulation module. Simulation module seems simpler to use but I am not sure if I can use vi with simulation loop on FPGA.
Is it better to use control design module for real time implementation or is simulation module sufficient?
Example
Please can someone point me to an example where an estimator is implemented in labview which is later used on hardware. Most examples I saw for both simulation and control design module are for simulation and analysis purpose and not so much for hardware implementaion purpose.
Thank you
08-13-2012 06:28 PM
What exactly is it you are wanting to estimate ? e.g. just system gain, simple linear input-output dynamics, or internal modes, or nonlinear dynamics ?
How frequently do you need to do estimate ? offline, in real-time whilst controller running - if so at what sample rate - it generally does not have to be at the same rate as the feedback control, but more related to how fast your system changes.
08-14-2012 07:55 AM
Andy,
Thanks for the reply.
We have an encoders which measures the position of a mirror and a rocker. We want to calculate the velocities. We donot want to do diffrentiation of the encoder signal as it is noisy.
hence we plan to esimate the velocities using something like kalman estimator. Right now the estimator sits in the feedback loop. we are running the loop at 65 miro seconds. We are assuming the the estimator will run in real-time. The estimator is 5th order (same as the plant) and has linear dynamics.
08-14-2012 09:01 AM
Sounds a good reason to use an estimator:
Andy
08-14-2012 10:07 AM - edited 08-14-2012 10:09 AM
First, the LabVIEW Control Design and Simulation Module does not directly support the targetting of FPGA. However, it is easily supported on the RT side of the cRIO. And we do support Linear and Extended Kalman Filter. Here is the location of our examples that explain how you can use Kalman Filters algorithm.
C:\Program Files (x86)\National Instruments\LabVIEW 2012\examples\Control and Simulation\Algorithms\Extended Kalman Filter
C:\Program Files (x86)\National Instruments\LabVIEW 2012\examples\Control and Simulation\Algorithms\Kalman Filter
To more information about the kalman filter, I recommend you looking at our manuals:
LabVIEW Control Design and Simulation Manuals
Hope this helps.
08-15-2012 04:24 PM
Andy and Barp,
That was helpful. I went through the example in Andy's post. We will be using constant kalman gain atleast initially. I understand the calculations the vi is doing. But I am still confused about how i will use it in our application. I am cofused about the output data types.
The output of the estimator will be used to close the loop which for us is right now numeric data type. In the example I guess this is the output of the state trajectory block. But it seems of form cluster which I dont know how to use with blocks following with numeric input.
Thanks
08-15-2012 04:59 PM
The KF gives estimates of states of the model. You have to pick out the correct state corresponding to the velocity you need - I would expect that it will be just a case of extracting the correct element from within the cluster. Before closing the loop with your estimate, make sure your estimate tracks the actual velocity (maybe formed from a simple differentiation, which will be noisy) in open loop.