Check out our sponsor BetterHelp and get 10% discount on your first month of therapy: betterhelp.com/nikodem
@Schmogel929 ай бұрын
Hey, I know you mean well, but maybe choose another sponsor in the future. Betterhelp does some sketchy and unethical stuff...
@nrdesign19919 ай бұрын
Betterhelp is an evil company exploiting their workers and are betting on customers leaving after a short time. This isnt really meaningful longterm therapy but q uick fix mentality that might even do more damage.
@dmitribovski12927 ай бұрын
Why didn't you enclose the wheel so id it fell over it wouldn't touch the surface & run away.
@andreasportillo20649 ай бұрын
Here my 2 cents to help you fixing the problem: - write down the equation of motion of the system and simulate it (i.e. python, or Matlab/Simulink) - add a controller to the simulation and perform a preliminary tuning. - take into account the lag that your sensors have (they work in discrete time, and the microcontroller processing time is not infinitesimal) - consider using a control strategy more sofisticated than PID. - code the controller in Arduino and fine tune it withe the real system. Good luck!
@3dPrintCreator9 ай бұрын
Hi Nikodem, great video again. To prevent scratching your table, and the reaction wheel driving away from you, place a simple belt and hook on the top of it, and connect it with a piece of fishing wire to you ceiling. When the wheel leans over, there is no problem but when it tries to go away from you, the fishing line catches it and keeps it in place. I also did that with my reaction wheel, but I never got mine working as good as your wheel is working. Good luck.
@jacekgrzybowski54279 ай бұрын
1. 2 PID loops work better, especially as you are steering position using acceleration, so one PID loop sets angular speed and second angular position. 2. In tuning it is handy to do something like that: (P*x + I*integral(x) + D*dx) -> P*(1*x + I' * integral(x) + D'*dx), in this way I and D are proportional to P (sometimes called K in this configuration) which makes tuning easier. There is always control theory path of doing this xd, which is designing mathematical model and tuning it in simulation, I wanted to try this with inverted pendulum on a cart
@143Mazz919 ай бұрын
Checked your code and it looks fair enough. But note that your gyro measurement is your derivative error as you want it to stand still. Use it directly instead and you will reduce the amount of noise in your feedback loop. As for dev practices, make sure to log to log relevant data so that you can plot them afterwards and study in detail the difference between two settings. That helps a lot when working with controller tuning. Finally make sure you learn the dynamics of your motor. The control method for reaction wheels is torque, does it have enough? The motor is using a optical encoder does that yield minimum velocities that it can work with. What actually happens when you change direction of the motor? If it triggers a brake sequence (not unlikely) then that might cause a torque spike much larger than you anticipated. My experience is that the PID tuning usually is the easy part, its properly handling measurements and non linear behaviors that is the true tricky part.
@Enderkruemel9 ай бұрын
i would use a simple hinge for screwing it to a wooden base and limit the angle, so it cant tip over too much and run away ...
@dominikzz66679 ай бұрын
Z mojego doświadczenia: 1. to potrzebujesz 2 PID - jeden szybszy do stabilizacji wahadła i drugi wolniejszy do stabilizacji prędkości koła (żeby się nie nasyciło). W zasadzie to do prędkości koła wystarczało samo PD. I trzeba też dobrze dobrać filtr członu D. 2. Środek ciężkości WYŻEJ sprawia ze łatwiej jest balansować (ale za to w mniejszym zakresie). 3. Lepiej działa LQR. Do określania pozycji kątowej wahadła complementary filtry na podstawie acc+gyr trochę słabo działały, lepiej filtr kalmana na podstawie modelu. A może i warto zrobić krok wstecz, zawiesić wahadło na osi i skorzystać z enkodara. Ja wybrałem tę opcję ;)
@Monosscema20129 ай бұрын
9mins into the video and I saw something!.... you have the accelerometer placed at the bottom of the design, where there is less angle of movement, rather than at the top where there is more!!! Now I have pointed out this basic factor, I'm sure you know why it is struggling to respond more quickly to any changes in its angle right? It's so normal when you are designing something to overlook an obvious error like this because you are soo focused on the process.... So I hope this is the issue and helps to resolve it and it not being the code you are fine-tuning!
@Axatron9 ай бұрын
In addition of that is the combination of Gyro and Acc values and the % of each of them that is used (for fast and noise free reaction). Also "integral windup" must be kept in check, it can cause the wheel to spin very fast when it doesn't need to.
@scaytrase9 ай бұрын
There is a thing, called PID autotuning. For example one is implemented in Marlin 3d printer firmware to tune heater PID values. You can check one out, maybe it helps
@Kmnri9 ай бұрын
Some tips: 1. Platformio is far better solution for both arduino as well as other frameworks because it keeps cache and subsequent compilations are far faster it is also a lot more flexible (editor is much better too ex vscode or clion) 2. ESP32 have OTA built in (over the air updates) been using it for a while now so it saves you trouble of adding another BT module 3. Bluetooth can be driven directly from web pages (WebBluetooth) and it works on mobile phones so that saves a lot of time (no need to make phone app)
@BenKDesigns9 ай бұрын
Dumb question, but shouldn't you have an equal amount of bolts all the way around the reaction wheel? Seems like the current configuration would make it unbalanced, which is probably not what you want for a reaction wheel...
@throwawaypt2throwawaypt2-xp8nx5 ай бұрын
homie gets pressed when work is done on his work table , do ur stuff in the garage then what a time to be alive
@andymclaughlan31329 ай бұрын
I don’t know if it’ll make a huge difference but any imbalance or runout in your fly wheel it’s going to cause a lot of instability in how the result of the reaction torque is perceived by the controller. Might be a reason you were constantly chasing values? Best of luck!
@RemoteAccessGG9 ай бұрын
No way, this mpu thing is following me. I spent 5 hours “playing” with it and trying to make screen position detector. Now I got fear of PID algorithms too.
@sethdhanson9 ай бұрын
You know what might be interesting is to put two contacts on a frame on the sides of the devise and let it cycle through PID values, adjusting them if the contacts close. In this way it could learn to tune the values on its own.
@paulroberto22869 ай бұрын
You should try using CEM (Cross entropy Methods) to optimize your PID values. It'll require automating the whole testing process, but could be fun!, here's a simple explaination: So, for every parameter you want to tune (3 in this case), you create a normal probability distribution which requires 2 parameters: mean and standard deviation. Initialize these parameters with arbitary values. Then, run a bunch of trials, but in each trial, sample from the normal distribution to get your gains for P I and D. (hence why you need to automate it) Now, take the top 10% of trails, and use those values to recaluculate the mean and standard deviation of your normal distribution. Repeat. Eventually, it'll converge to a normal distribution with low standard deviation, hence you can simply use the mean of the distribution as your tuned value. Is this excessive? Yes. Is it worth it? probably not. Would it be fun? well... that depends on you! :D
@russ-techindustries9 ай бұрын
You might try moving the MCU up and closer to the actual reaction wheel so it has a more precise reading of the movement.
@boostedhuman9 ай бұрын
The issue i had when trying to build a balancing robot was noise on my i2c bus due to wire length and BLDCs and because of that, bus locking when accessing the IMU. I had better luck with a BNO080 on a board right next to the MCU.
@deathshaker00269 ай бұрын
It's always interesting going back to finish old projects.
@SalimsWorkshop2 ай бұрын
06:14 lowering the Centre of mass will not make it easier to control. In fact it makes the system more dynamic and even harder to control. Imagine you try to balance a long stick on your hand. Now imagine balancing a short one. Which will be easier ? (The long one).
@stevewebb57359 ай бұрын
Never give up :) and yes a simple BT GUI certainly helps remote debug/tuning I often use Teraterm/Hyperterm with VT100 text GUI + coded save settings option (to flash/EEPROM)... once implemented it can be useful for many projects. PID for this/balance bot/drone/gimbal applications can be better implemented via nested loop techniques which helps tuning and performance. The method is to have an outer P(angle) loop commanding an inner PI(rate) loop - roughly these lines... set_rate = Kp _angle * (set_angle - meas_angle); if (set_rate > 180) set_rate = 180; if (set_rate < -180) set_rate = -180; integral_rate_error += (set_rate - meas_rate); motor_signal = Kp_rate * (set_rate - meas_rate) + Ki_rate * integral_rate_error; Where: - set_angle is the command input such as the tuned balance point angle - meas_angle and meas_rate are from IMU calculation - 3 tuning constants: Kp_angle, Kp_rate, Ki_rate - tune inner loop first with low outer gain, then outer, then tweak again - the differential D term is effectively performed by the inner loop - ie. rate being the differential of angle Note outer loop is simple P, not PI so there is only one integral time constant and no inter loop fighting. The method also allows software controlled clamping of rates to keep within IMU gyro spec limit such as maybe
@M_Leiva9 ай бұрын
Nice video. For control projects, work with register programming is also a good option.
@evanbarnes99849 ай бұрын
Did you run into buffer overflow problems with the MPU6050? my friend is making a balancing robot, but keeps hitting buffer overflow errors with the IMU. It sounds like that's a known problem with that IMU, but we can't find known good solutions
@davidtucker15559 ай бұрын
You need to poll this module and not use its internal buffer. I also ran into this instability when I tried it there way. It can run very stable if you poll in a separate thread (aka on an esp32 with multiple cores)
@evanbarnes99849 ай бұрын
@@davidtucker1555 oh interesting! Good tip, thank you. Have you had success with that approach on the Atmega328P? For some silly reasons we're constrained to that microcontroller for now, although I'm trying to get us to make the switch to the ESP32, which I prefer. I wonder if setting up frequent polling driven by a timer interrupt would do it.
@94todd9 ай бұрын
Would definitely recommend the creality k1 over the bamboo labs
@WoLpH9 ай бұрын
Can you go into a little bit more detail as to what was the issue with the PID algorithms? Did you have issues with the algorithms themselves or with finding the right parameters resulting in overshoot? Very cool project in any case!
@cozmo46949 ай бұрын
Great video as always, it is a bit of a shame you went for the betterhelp sponsorship as the company is kind of predatory/sketchy
@WoLpH9 ай бұрын
I recommend installing sponsorblock to skip stuff like that ;)
@gr82moro2 ай бұрын
Great video, just one question - the motor seems using frequency control, not regular PWM. Do you know how read its encoder ? I've been looking for the detail for quite a while. Thanks
@viniciusfriasaleite80169 ай бұрын
Maybe MPU6050 has not a good zero offset. Have you calibrated for that?
@geekmystique9 ай бұрын
As said before, VSCode, PlatformIO, ESP32 will change a lot for this
@vintagemotorsalways16769 ай бұрын
I think the silicone mat may be influencing the stability.
@alfredonovoa81249 ай бұрын
There are many Nidec motors in Aliexpress
@samm77169 ай бұрын
Have you tried making a simulink model and then try tuning on that? maybe try sis id tools to get a model?
@jeffschroeder48059 ай бұрын
Not to complicate things even more but incorporating AI to learn and even adapt the PID components in real time would make the ability to balance or shift the center of balance on the fly even more flexible. Might be something best left to NASA but: Rather than trying again and again to change your PID parameters and guess whether it is better or worse, could you make a stand that introduced different measured forces and monitored the effects more objectively? Change the forces, measure the effectiveness, over and over ........ automatically, programmatically.
@gurkiratsingh5539 ай бұрын
why didn't you used matlab for tunning or auto tunning libraries? 🤔🤔
@JTST1234Ай бұрын
30% of video- "This project is making be mad" lol
@ivko56739 ай бұрын
Great job. IT'svery impressive!
@hydropage28554 ай бұрын
That’s what you get for sticking to PID for everything and being too scared of linear algebra and differential equations to learn how to derive a Linear Quadratic Regulator and Kalman Filter
@92gunnerjoe9 ай бұрын
Time to ditch the arduino for something with wifi, esp32 or picow maybe
@jazekerxx75359 ай бұрын
i'm no expert but i think reaction wheels are suppose to move only in one direction. and spin at a certain rpm. and use conservation of momentum. in other words slightly speed up or down to move a certain way. i think it works that way in spacecraft too, and by seeing your video i see at certain moments where it is stable and spins pretty fast, i think my initial thoughts of how this works are right.. maybe you should give it a try?..
@VENONixGaming9 ай бұрын
kiedy po polsku ?
@rasgamer12139 ай бұрын
🔥
@michaelschmidt8509 ай бұрын
Probably you should try to use AI for the tuning
@nrdesign19919 ай бұрын
or established tuning algorithms that give a great initial guess result. Or formulate the system as a set of differential equations and derive a set of tuning parameters from there.
@michaelschmidt8509 ай бұрын
@@nrdesign1991 yeah but AI is more fancy
@wayne19508 ай бұрын
🙈 "Promo SM"
@joetkeshub9 ай бұрын
C'mon Nikodem! Mental health therapy? How did you manage to get such sponsors? At your young age, mental health shouldn't be a concern, C'mon! Next time who could be sponsoring you? Nurse services for elderly? C'mon! You need money, I understand, but don't bother us with such ads please... please...
@gianlucabelgrado36249 ай бұрын
😂
@paulcunnane9 ай бұрын
You think young people don't have mental health challenges? Wow.
@vishal01mehra9 ай бұрын
What is age has to do with mental health? Apparently you seem to be the perfect audience for the sponsor. Good luck.
@arbitrary_username9 ай бұрын
I wish I had access to such services when I was young. I really like that knowledge and help about mental health issues gains visibility and accessibility. Your luck if you don‘t need it, but other people do, especially at young age and the earlier, the better.