Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

simulation vs control design module for estimator implementation on FPGA

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

0 Kudos
Message 1 of 7
(6,363 Views)

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.

 

Consultant Control Engineer
www-isc-ltd.com
0 Kudos
Message 2 of 7
(6,354 Views)

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.

 

0 Kudos
Message 3 of 7
(6,346 Views)

Sounds a good reason to use an estimator:

 

  • Do you really need to estimate the velocity every 65 microseconds ? Sounds very fast for something with inertia (even if small). Maybe the estimator can run slower than the control loop.
  • Is the Kalman filter fixed - or does the Kalman gain get updated every iteration (i.e. requiring the solution to Riccati equation) ? If it is fixed then the KF can be nothing more complicated than some matrix multiplications, with the Kalman gain being calc'd once offline.
  • Here's an example which looks like it does not resort to CD&SIM - http://www.ni.com/white-paper/8224/en#toc3

 

Andy

Consultant Control Engineer
www-isc-ltd.com
Message 4 of 7
(6,342 Views)

truptimr

 

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.

Barp - Control, Simulation, RTT and HIL - National Instruments
Message 5 of 7
(6,338 Views)

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

0 Kudos
Message 6 of 7
(6,308 Views)

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.

Consultant Control Engineer
www-isc-ltd.com
0 Kudos
Message 7 of 7
(6,306 Views)