From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Self Balancing Robot (The PID Configuration)

Hello everyone,

I'm a student who's working on my final year project, a self-balancing robot.

and while working on it, I've found a problem...

the problem is the PID value, the robot is working but can't balance properly, I tried to change the PID values too many times.

another problem is, we did not have so much time to understand the PID theories(without studying the transfer function) 

I will upload the photos of my LabView code, and the vi file, and please if anyone could help me, it will be a pleasure...

Thank you all and have a nice day 

Download All
0 Kudos
Message 1 of 6
(4,885 Views)

Hi,

 

Ultimately, I think you'll benefit from investing more time into understanding the PID parameters . I'd suggest as a good starting place this white paper from NI

 

You could also implement existing PID algorithm code in your application instead of writing your own. LabVIEW even includes a VI (PID Autotuning, linked below) that will help you to tune your robot properly.

 

Regards,

Regards,

Michael Whitten
Senior RF Applications Engineer
0 Kudos
Message 2 of 6
(4,826 Views)

Hello sir,

Thank you for replying to my question. I actually have used both of these PIDs and they gave me the same results as this code (still unstable). With changing the proportional and the other PID gains values I can see the robot acting a little better but it doesn't give me the wanted result. So I was wondering how to tune the PID in a more proper way to give me better results.

thank you 

0 Kudos
Message 3 of 6
(4,812 Views)

I have another question Sir,

 

I wanna ask about the accelerometer and PWM,If these two are not from the same type, could the PID work correctly or not ? .

I will upload a photo.

0 Kudos
Message 4 of 6
(4,791 Views)

nourhene,

 

Can you clarify what you mean by "type" for the PWM and accelerometer? The attached image didn't clarify what you are asking.

 

TyVo

0 Kudos
Message 5 of 6
(4,746 Views)

Hello TyVo,

Thank you for your respond.

What I meant by type is that in my PID Input i put the axe of the accelerometer of myRio and in the output after the regulation I put the input of the duty cycle of the PWM of myRio. Is it possible ?

Thank you,
Nourhene

0 Kudos
Message 6 of 6
(4,743 Views)