LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ball and beam Pid problem

iam currently doing a college experiment that i am having difficulties with. it is a ball and beam project controlled using a PID in labview and arduino mega. i know the output range for the pid to move the motor angle. this distance sensor is an ultrasonic ping which i'm getting a reading from. the problem is the pid doesn't try to reach the set point instead it just lifts the beam all the way up and stays there. i used both the lifa and linx interface for the arduino with the same results.  could you suggest what i may be doing wrong?

0 Kudos
Message 1 of 7
(4,281 Views)

Hi george,

 

when a PID control loop isn't working as expected most often the PID gains aren't correct.

But as you decided to show just an image of your blockdiagram (without using AutoCleanup before taking screenshot) you also decided to hide important information…

 Did you set any reasonable gains?

 

How fast does your loop iterate? It might help to use a fixed loop rate by setting some wait time in the loop…

Best regards,
GerdW


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

thanks for the reply. sorry for not using the auto clean up i'm still relatively new to labview. i uploaded a VI i tried using the linx interface with the same results. i have tried changing the gains but not a timer in the loop.  

0 Kudos
Message 3 of 7
(4,247 Views)

Hi george,

 

i have tried changing the gains

So you still use the default gain values? And the standard ±100 output range?

You need to set both to values suitable for your control system…

I recommend Wikipedia (or some control theory lessons in highschool)!

Best regards,
GerdW


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

sorry i must not have saved the VI when i last used it. the output range is 1900 to 1100. i change the gains also. maybe i should try a loop timer. would you be able to suggest a time i use

0 Kudos
Message 5 of 7
(4,230 Views)

Hi george,

 

all those settings (gain, loop time, output range) depend on your system - you need to find them either by modelling/measuring or by "guessing" as explained at Wikipedia!

Best regards,
GerdW


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

after trying varies techniques to tune the pid nothing changes. the output ranges are correct. the ping sensor reads the ball distance but the beam angle will not change no matter where the ball is on the beam

0 Kudos
Message 7 of 7
(4,206 Views)