LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Robotic starter kit PID and SYSID

Hello there

 

 

I'm working in an issue of ACO (ant colony optimization) for PID tunning and I want to apply this algorithm to tune the PID for DANI's (ROBOTIC STARTER KIT) Motors control.

 

1st I have done the ACO using MATLAB using m- file and during the file in a loop  it calls a simulink file for simulation and subsitiuting with P I and D , till the algorithm ends and the optimal P I D is found, in the simulink I used a data for real motor from internet.

 

Now I want to apply this idea to DANI

 

so that I need to apply in the loop the P I D to the target VI ( containing a loop with PID controller for the KIT ) and then get the results to the loop again to complete my optimization code.

 

really I know about Mathscript RT module and Matlab script for Labview  or to convert the m code to labview code

but I'm not so good in labview coding for loops and so.

 

when I tried to use the MATLAB script for RT module I stuck with the issue of sending the P I D values in any iteration to the target VI, as the mathscript or MATLAB script wants to complete the whole loop and deliver the PID values...

 

I know its is some simple problem but I'm stuck...

 

another way:   I'm thinking to identify the DANI as a transfer function and apply it to my simulink

 

and I found an IEEE paper saying that the robot's has been identified with a T.F, but when I use this T.F  and create a Z-N PID using forexample MATLAB SISO, then I apply it to the real KIT, the results are nonsense

 

 

 

please help me... thanks

A.Hakim
0 Kudos
Message 1 of 4
(2,748 Views)

What is the structure of your code? Have you tried removing the loops from your Mathscript node and placing it and the PID controller inside of a loop that encompasses both? Are you getting errors when you run your code or just unexpected results? 

 

MATLAB® and Simulink® are registered trademarks of The MathWorks, Inc.

Miles G.
National Instruments
Staff Applications Engineering Specialist
0 Kudos
Message 2 of 4
(2,700 Views)

Hello...

 

Thanks for your reply

 

 

I would like to share with you the Matlab code and you can give me your ideas about conversion to labview code...

 

Note that:

 

I wanting to implement this on RT....such that:

 

I have sbRIO 9632 which is used in the Robotic starter kit (DANI), and I really used a Target VI which implements PID gains for the DC motors on the DANI, but I think that these gains are not optimal and I thought about better tuning method which can be using ant colony optimization (ACO) as a search space optimization technique.

 

 

So I wrote ACO algorithm using MATLAB m code...which during running it sends P I and D to a simulink model (having a PID and a model for the plant (Transfer function) ) and this simulink model returns values of Refernce and output to the m code, so that this code computes the cost function according to these values.. and so on till the minimum cost fuction is found with best P I D values.

 

The ACo by itself depends on iterations of tours and in each tour there is iteration of no. ants....and inside the subloop there is a comunication between my simulink and m code (as I describd above).

 

 

What I want is to implememt this on RT for the Motors of DANI, so that the simulink model is substituted with Labview PID simulation model.

and the ACO algorithm for optimal tunning should communicate with this PID simulation loop...

 

I know its is some simple problem but I'm stuck...

 

 

 

another way:   I'm thinking to identify the DANI as a transfer function and apply it to my simulink

 

and I found an IEEE paper saying that the robot's has been identified with a T.F, but when I use this T.F  and create a Z-N PID using forexample MATLAB SISO, then I apply it to the DANI in RT, the results are nonsense.

 

 

 

 

I hope my idea is clear and sorry for any wrongs or disturbance...

 

 

 

thanks

ahmed.hakim.mahmoud@gmail.com

A.Hakim
0 Kudos
Message 3 of 4
(2,680 Views)

Hi Ahmed,

 

If you want to incorporate a model from another environment into LabVIEW Real-Time you may want to look into using the Model Interface Toolkit. There is an overview help page here, with links to lots of other related help pages including this one that specifically talks about using Simulink® models. 

 

This toolkit is also known as the Simulation Interface Toolkit in versions of LabVIEW earlier than 2013. There is a wide variety of documentation on it under this name as well. You can find the product page here

 

Simulink® is a registered trademark of The MathWorks, Inc.

Miles G.
National Instruments
Staff Applications Engineering Specialist
0 Kudos
Message 4 of 4
(2,652 Views)