I'm not really sure if it was a PID controller but when I built the gyro boy that came with the ev3 set, the code was very hard to understand and there wasn't any way to change the PID values if it even had any. A video breaking down the code would be great!
The sensor is not a gyroscope, but a 3D acceleration sensor, so it basically can output angles based on the movement of 3 little MEMS mass-spring systems. Nothing to integrate. Just read out the spring movement in the 3 directions and calculate angles with plain gonio functions.
May I add some improvement to your algorithm? The motors are controlled by power, so I‘d say with torque. The torque required is not linear with the error of angle, but with sin(error), as this is gravity‘s vector component perpendicular to the lever. This results in a reduced correction around the target angle and a higher correction once deflected. So I wrapped the error Formular with a sinus function. Of coarse the PID values need to be adjusted afterwards. By doing so I could achieve a much more stable balance.
That’s pretty clever. But if error > pi/2 your torque is going to a big negative value. But to make things linear (and reduce computational effort), I would do a z-transform instead and tune the sample time.
Do you think it is possible to backsolve Kp, Ki and Kd by tracking the effect of power on the robot roll angle? So the idea is to let it play a little bit on its own by modifying the constants until it reaches the desired result and then these will become the constants to use. A little bit like the goal seek in excel.
Hey, mechanical engineer here. It should be possible. There are techniques already used in Technology, e.g plane stabilazation. Also bc you can analyze the swinging behaviour on the hub itself and calaculating the right parameters. Im currently working on this and let you know if i manage to do so ;)
If you linearize your system, and convert it into state space about an upright point (delta_xdot = A delta_x + B*deltau), then what you could do is plot your eigenvalues and vary it with respect to your PID gains. Your poles could potentially give you info on your settling and response times.
Why didn’t you just incorporate the .25 into Ki? Unless I’m very wrong, it’s mathematically equivalent and an extra multiplication you don’t need to keep repeating.
For me the program doesn't work. I don't know why. But also I don't think it's your fall, you are a very good guy who wants to help us better understand lego MINDSTORMS. You are the Best!!! RESPECT.
@@Builderdude35 How does this correction change the code for this robot? And how is "dt" defined or calculated. Please help. I've spent days on making this thing work, but to no avail.....
What other cool things have you used PID for? Let me know here!
I'm not really sure if it was a PID controller but when I built the gyro boy that came with the ev3 set, the code was very hard to understand and there wasn't any way to change the PID values if it even had any. A video breaking down the code would be great!
Same
O dont know why but it is not working for me im gonna restart and i checked the robot and code 100 times i hope when i restart it will work
Thanks!
What did Yaseen mean by this?
Thanks Jimmy :) that phrase is something of a meme among my friends, and Yaseen knows it all too well
no it's not about you haha
The sensor is not a gyroscope, but a 3D acceleration sensor, so it basically can output angles based on the movement of 3 little MEMS mass-spring systems. Nothing to integrate. Just read out the spring movement in the 3 directions and calculate angles with plain gonio functions.
May I add some improvement to your algorithm?
The motors are controlled by power, so I‘d say with torque.
The torque required is not linear with the error of angle, but with sin(error), as this is gravity‘s vector component perpendicular to the lever.
This results in a reduced correction around the target angle and a higher correction once deflected. So I wrapped the error Formular with a sinus function.
Of coarse the PID values need to be adjusted afterwards.
By doing so I could achieve a much more stable balance.
can you please share more details
That’s pretty clever. But if error > pi/2 your torque is going to a big negative value.
But to make things linear (and reduce computational effort), I would do a z-transform instead and tune the sample time.
Thanks
You're welcome!! :D
Weird why I tried making the program but my hub flopped to the floor… even when I change the balance variable’s angle
Same
@@reenabondada7490 same
Do you think it is possible to backsolve Kp, Ki and Kd by tracking the effect of power on the robot roll angle? So the idea is to let it play a little bit on its own by modifying the constants until it reaches the desired result and then these will become the constants to use. A little bit like the goal seek in excel.
Hey, mechanical engineer here. It should be possible. There are techniques already used in Technology, e.g plane stabilazation. Also bc you can analyze the swinging behaviour on the hub itself and calaculating the right parameters. Im currently working on this and let you know if i manage to do so ;)
If you linearize your system, and convert it into state space about an upright point (delta_xdot = A delta_x + B*deltau), then what you could do is plot your eigenvalues and vary it with respect to your PID gains. Your poles could potentially give you info on your settling and response times.
After making it balance, can you then make it drive around like the old lego mindstorms?
Why didn’t you just incorporate the .25 into Ki? Unless I’m very wrong, it’s mathematically equivalent and an extra multiplication you don’t need to keep repeating.
My robot keeps falling over it corrects it a little too late then over corrects can you help
I wonder if the Space-X rockets use PID programs to move the rocket gimbals when landing....
I will have to ask my SpaceX colleagues ;)
Should I change power variable and 0.25 or just k values?
Builderdude 35 returned back 👍🥳
yup!
@@Builderdude35
I love all your Videos ❤️👌
Thanks so much! I am thrilled you enjoy them! :D
For me the program doesn't work. I don't know why. But also I don't think it's your fall, you are a very good guy who wants to help us better understand lego MINDSTORMS. You are the Best!!! RESPECT.
Can you update the central position in real time? Suppose that you surface angle changes it Will nevet hold upright with the current implementatiob
hi! ma man yo i was wondering if you can bring the xiaomi robot and compare to a lego one. thanks!
Can you please explain this in ev3🙏🙏🙏🙏🙏🙏
Long time no see, guy.
Yeah
Can you do this with the EV3?
absolutely! One thing to look out for is that it may be more challenging to build a robot that has balanced weight
I want to remote control movement for this robot:
Fwd/bwd and turn.
I guess you could manipulate the roll target, to make it go fwd/bwd
Did you manage to get it working? I've got some problems with doing it so I'd be happy if I can get some advice
@@ImpostorSus I barely tried, but not giving it enough time for any success . Then canibalized parts for a different project.
@@ImpostorSus maybe check out their other video about this ua-cam.com/video/fazYC6cyAn8/v-deo.html
my robot is not working. it very slow sensing :(
Do you thing you can do this with Lego boost?
I will get one this week
Congrats!
Well it’s finally here it was only a day
Ok, but how can you programe it??? I don't even know what the heck to do with it.
i want to download this
It is fantastic! Can I download/buy the program?
cool pid
thanks chief!
What was your favorite part of the video?
@@Builderdude35 idk i guess the whole thing
hahaha I like that answer :D
You didn't divide by dt in the derivative.
You have out-mathed me, I tip my hat to you.
@@Builderdude35 How does this correction change the code for this robot? And how is "dt" defined or calculated.
Please help. I've spent days on making this thing work, but to no avail.....
This is not necesary to divide by dt because you can assume that the time between loops is almost constant
POV:You bought gyro boy on wish but it has a newer technoligy so its kind of beeter but not as pretty
Lmao
Collaboration with Thoroughfare production?
This is a cool idea! I hadn't heard of this channel before, but just checked them out and they have some cool content there.
Ok now one wheel
Your robots not balance enough. How can make it more stable. I'm dying
Not working
2 hours of adjusting variables to find different ways of making it not work. Oh well.
It took me several hours and trying a few different surfaces to get it to work. Don't get discouraged. If it were easy, everyone would do it. ;)
@@Builderdude35 is there at least some reasonable range for each of the P.I.D. variables to operate within? (So great to see you back again btw).
Hi
This is the first comment i think
Indeed you are the certified first commenter
@@Builderdude35 Epic, love your videos btw
@@LegoMaster5197 I'm thrilled to hear that! What's your favorite video so far?
@@Builderdude35 The one where you reviewed the Porsche 911 (10295)
👍👍
1.7
this is a bot
@@dinhtuan752 no its not Dinh Tuan
Scammer
Doesn't work. That is just a scam. Don't try it, it's just a waste of time and lego.
100% Agree this is bad
@@woodywong76 I know right!
Mabey
you did it wrong idiot cuz it worked for me
@@GOOFYAHTAGGERWow
I wonder what world you live in
True😢