LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID controller

Hi Saed,

 

 

Thank you for contacting National Instruments. I have been looking at your problem and I have a few suggestions. I would recommend following the advice of the other posters above.

 

My suggestions concern a couple of structures that you could implement if you are wanting to simply use a Formula or if you are trying to use code similar to MATLAB

 

1. Formula node - If you go the the Search feature of the Block Diagram Palette and search for "Formula node" this will take you to the formula structure. You can use these to implement formulas from within a VI. In the LabVIEW example finder, there is an example called "calculate volume" which gives a good overview of how to use these within LabVIEW. 

 

I would strongly recommend looking at the following article, which gives a good introduction of how to use both the formula node and the Mathscript node.

 

2. Mathscript node - You can use the Mathscript node to write textual mathematics like you would in MATLAB. Again I would recommend looking at the example finder. Specifically, if you search for mathscript and then open the heat equation example.

 

Those where two alternative ideas I had that I thought would help you develop your code. 

 

If you do not wish to redevelop your code using the tools suggested above, I would ask you to refactor your attached VI into a number of Sub VIs. This will allow everyone here to clearly see what you are trying to do with your code. You can highlight areas of code and then go to Edit>>Create SubVI...

 

This will greatly improve readability and help us work out the source of your difficulties. 

 

I would personally recommend trying to pull together subVIs into the different sections of your PID controller. Maybe have one VI that does the P, one that does the I and one that does the D. These could further be packaged into an overall PID VI.

 

Please let me know how you get on,


Many thanks,

Andrew McLennan
Applications Engineer
National Instruments
Message 11 of 18
(1,307 Views)

Hi All,

 

Andrwow, GerdW, nathand, simercurio_fc .... Thank you all for your comments.

 

I will try this time to describe the whole thing clearly.

 

First, what I want to do now is controlling the inner closed loop of a DC motor. I've done the controller and some of you told me that I have to change some of extra things in the controller. You can see a the PDF file that I've attached which has faced a near project.

 

I've done the complete system on (matlab) and you can see (attached world file) the response that suppose to get.

 

I've done every thing to make my simulation of the system on labview but I got nothing. I shows that labview that I'm using doesn't know what is (tf) transfer function mean ??

 

I've even test some other examples like one on youtube which has the link :http://www.youtube.com/watch?v=sbUqlhpaHoU

but I didn't get any thing and the message that come up is : Unknown symbol ????

 

anyway please find the attached files and tell me what do think .

 

thank you,

 

saed

 

0 Kudos
Message 12 of 18
(1,276 Views)

I forget to attach the last one

 

here is it :

0 Kudos
Message 13 of 18
(1,275 Views)

where you guys ???Smiley Surprised

0 Kudos
Message 14 of 18
(1,238 Views)
I mean where are you?? >>> Smiley Happy
0 Kudos
Message 15 of 18
(1,237 Views)
Hi Saed,

I have been looking at the documents that you submitted to us.

Firstly, the command "tf" will not work with the Mathscript node if you don't have the Control Design and Simulation module. I can say that a "tf" function will work in the Mathscript node if you happen to have this module installed.

Secondly, I noticed that PIDpaper.dpf file shows a large amount of code that you were originally using. I would be wary about copying someone else's material particularly if you do not know them personally.

Having looked at this paper, Figure 9 b suggests to me that the PID controller you have designed was part of a much larger system and this may be why you are not getting the results you require. I suspect that you will need to implement this PID controller within a larger control system in order to get a  good step response.

Can I ask why you are building this PID controller? What is the application?

Many thanks,
Andrew McLennan
Applications Engineer
National Instruments
0 Kudos
Message 16 of 18
(1,225 Views)

Hi Andrew,

First, I think that you didn't get the point even with whole documents that I've attached. Yes I've done a similar to the paper controller but have you seen the second one ?? It was for sure different and developed compared to my primary knowledge. Where the first one was only to test the connections.

Secondly, I thought with the explanation using ( matlab) world file was clear that I want to control DC motor where the PDF file talked about Temperature system !!!! (did you see that ???) and forgive me I noticed that none of your replies wasn't professionally helpful to me apart from some general information and with your experience, you should be better.

And finally I know that (tf) is not identified but where the solution then ???

0 Kudos
Message 17 of 18
(1,205 Views)

Hi saed,

 

hohoho - no need to get "emotional"! We only try to help... (If you can afford you may even pay a LabView freelancer to do your work Smiley Wink )

 

From the point of PID controller it's completely irrelevant if there is a DC motor or a temperature system. The system's reaction may show slightly different timings - but the principle stays the same for all PID controllers.

 

So again: start with a simple P-type controller, then add integrational behaviour, then add differential behaviour. And do tests in between those steps...

Message Edited by GerdW on 07-17-2009 09:53 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 18 of 18
(1,195 Views)