LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VFD Torque Control using a PID controller and Force from a load cell as the process input

Hello,

 

I am unsure if the community can help with this, but I am having some tuning issues with the PID vi in LabVIEW to control a 3-phase motor using Torque Control via a VFD and monitoring using a load cell.

 

I am using Modbus via RS-485 for communication. 

 

My code has a while loop which monitors the Force using a load cell and sends the Force values to a PID vi as the process input with the output range (0 to max torque 8192, mentioned in the COM manual of the VFD) and sends the PID output to the write input of the Modbus for torque command to the VFD.

 

I have tried providing a set force and varying the gains but it seems to be not working to get a tuned PID. I have tried changing the gain but even if I get to lower the overshoot for a particular set force, when I provide another set force it behaves differently. Why can't I tune the PID? Also I have tried the autoTune PID, with no luck, but also I am not sure how to use it or if it can even help for my situation. 

 

I can post an image or a snippet of my code upon request from anyone interested in knowing more about my issue and who is willing to help.

 

Thanks for your time.

0 Kudos
Message 1 of 9
(570 Views)

Hello Can you show please your code snippet as i am certified LabVIEW architect

CLA
0 Kudos
Message 2 of 9
(517 Views)

Hello ahmed,

 

Thanks for your reply,

 

Here is a snippet of the code which receives the set force to the PID and then sends via Modbus to the VFD for torque control using Force and monitoring the load using a load cell. The set force is sent as a calculated fraction of the end force set based on the input speed and RTA (is french for RTS rated tensile strength). 

 

Also a snippet of how the set force is calculated. I can provide other info as requested. 

 

Thanks, 

0 Kudos
Message 3 of 9
(445 Views)

Hello Ahmed,

 

Thank you for your reply.

 

Here is a snippet of my code showing also the subvi which provides a calculated set point at each loop until end force set has been reached to the PID and then via Modbus to write the PID output as a torque input to the VFD.

 

There is a speed and timing discrepancy to reach the end force based on the calculated subvi set value from labview to the PID and the actual timing for the VFD to reach end set force.

 

I am hoping to match the calculated speed in N/s in labview based on force control using the load cells value and the VFDs speed to reach the required torque based on the set force required. Do I need to provide to PID instance before sending to the VFD? force and timing?

 

Thanks,

 

 

0 Kudos
Message 4 of 9
(471 Views)

@ikhan123 wrote:

Here is a snippet of my code ....


Please note that a LabVIEW snippet is a special image that turns into real code when pasted into a VI (details). All you have attached so far are plain screenshots that we cannot really debug well, especially if they are truncated and contain loads of local variables with the associated terminal nowhere in sight.

0 Kudos
Message 5 of 9
(441 Views)

Hi,

 

Here is a snippet of my main vi and also of the subi which does the calc for the set force to the PID.

 

Thanks,

0 Kudos
Message 6 of 9
(420 Views)

Hi ikhan,

 


@ikhan123 wrote:

Here is a snippet of my main vi and also of the subi which does the calc for the set force to the PID.


Thanks for posting code of 2 VIs, BUT: we still miss all those subVIs of your main routine…

(Why don't you just ZIP your complete project folder?)

 

And even worse your main VI is unmaintainable:

The highlighted area marks a FullHD screen: the block diagram is way too large!

Another red flag: there is a STOP function buried in this giant sequence structure…

 

(Please read the StyleGuide section in the LabVIEW help and follow those suggestions!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 9
(411 Views)

Hello GerdW,

 

Thanks for your reply.

 

I understand it is large block diagram but as you know it is running sequentially per frame, and also I am not sure what are you pointing at in the image you provided (zoomed in section youved highlighted) as it is simply reading the coefficient value from a file and providing to the acquisition subvi and reading data from sensors until operator is ready to type all inputs and configuration to press start or stop to end program. There is no HD screen. Perhaps what you intended to say see 2nd image below with the label of the subvi (Affichage), is to display running values on another monitor 2 graphs and some values, and they work fine.

 

Also, should I provide all the snippets of each subvi?

 

I agree that there are better practices that I could use, but that is surely not the reason why I am not getting my PID tuned to VFD.

 

Regards,

 

ikhan123_0-1727099071074.png

 

ikhan123_1-1727099315940.png

 

0 Kudos
Message 8 of 9
(398 Views)

@ikhan123 wrote:

Also, should I provide all the snippets of each subvi?

 

I agree that there are better practices that I could use, but that is surely not the reason why I am not getting my PID tuned to VFD.


NO, attach the VIs instead. It still will be of limited user, because we don't have any of your hardware.

 

The problem with your diagram is much deeper, because it makes it very hard for anyone to "follow the wire" and understand the dataflow. Most here will refuse to even look at it. We have more pleasant things to do!

 

PID failures can be due to code logic (race conditions, crossed wires, etc.) and your overuse of local variable make race conditions a real possibility. They can also be because of very poor choices of tuning parameters. Since we don't know any wire values, we cannot debug that either.

0 Kudos
Message 9 of 9
(380 Views)