Reaction Wheel Took Me 3 Years to Make Stable

  Рет қаралды 29,381

Nikodem Bartnik

Nikodem Bartnik

Күн бұрын

Пікірлер: 60
@nikodembartnik
@nikodembartnik 9 ай бұрын
Check out our sponsor BetterHelp and get 10% discount on your first month of therapy: betterhelp.com/nikodem
@Schmogel92
@Schmogel92 9 ай бұрын
Hey, I know you mean well, but maybe choose another sponsor in the future. Betterhelp does some sketchy and unethical stuff...
@nrdesign1991
@nrdesign1991 9 ай бұрын
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.
@dmitribovski1292
@dmitribovski1292 7 ай бұрын
Why didn't you enclose the wheel so id it fell over it wouldn't touch the surface & run away.
@andreasportillo2064
@andreasportillo2064 9 ай бұрын
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!
@3dPrintCreator
@3dPrintCreator 9 ай бұрын
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.
@jacekgrzybowski5427
@jacekgrzybowski5427 9 ай бұрын
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
@143Mazz91
@143Mazz91 9 ай бұрын
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.
@Enderkruemel
@Enderkruemel 9 ай бұрын
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 ...
@dominikzz6667
@dominikzz6667 9 ай бұрын
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ę ;)
@Monosscema2012
@Monosscema2012 9 ай бұрын
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!
@Axatron
@Axatron 9 ай бұрын
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.
@scaytrase
@scaytrase 9 ай бұрын
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
@Kmnri
@Kmnri 9 ай бұрын
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)
@BenKDesigns
@BenKDesigns 9 ай бұрын
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-xp8nx
@throwawaypt2throwawaypt2-xp8nx 5 ай бұрын
homie gets pressed when work is done on his work table , do ur stuff in the garage then what a time to be alive
@andymclaughlan3132
@andymclaughlan3132 9 ай бұрын
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!
@RemoteAccessGG
@RemoteAccessGG 9 ай бұрын
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.
@sethdhanson
@sethdhanson 9 ай бұрын
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.
@paulroberto2286
@paulroberto2286 9 ай бұрын
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-techindustries
@russ-techindustries 9 ай бұрын
You might try moving the MCU up and closer to the actual reaction wheel so it has a more precise reading of the movement.
@boostedhuman
@boostedhuman 9 ай бұрын
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.
@deathshaker0026
@deathshaker0026 9 ай бұрын
It's always interesting going back to finish old projects.
@SalimsWorkshop
@SalimsWorkshop 2 ай бұрын
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).
@stevewebb5735
@stevewebb5735 9 ай бұрын
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_Leiva
@M_Leiva 9 ай бұрын
Nice video. For control projects, work with register programming is also a good option.
@evanbarnes9984
@evanbarnes9984 9 ай бұрын
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
@davidtucker1555
@davidtucker1555 9 ай бұрын
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)
@evanbarnes9984
@evanbarnes9984 9 ай бұрын
@@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.
@94todd
@94todd 9 ай бұрын
Would definitely recommend the creality k1 over the bamboo labs
@WoLpH
@WoLpH 9 ай бұрын
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!
@cozmo4694
@cozmo4694 9 ай бұрын
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
@WoLpH
@WoLpH 9 ай бұрын
I recommend installing sponsorblock to skip stuff like that ;)
@gr82moro
@gr82moro 2 ай бұрын
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
@viniciusfriasaleite8016
@viniciusfriasaleite8016 9 ай бұрын
Maybe MPU6050 has not a good zero offset. Have you calibrated for that?
@geekmystique
@geekmystique 9 ай бұрын
As said before, VSCode, PlatformIO, ESP32 will change a lot for this
@vintagemotorsalways1676
@vintagemotorsalways1676 9 ай бұрын
I think the silicone mat may be influencing the stability.
@alfredonovoa8124
@alfredonovoa8124 9 ай бұрын
There are many Nidec motors in Aliexpress
@samm7716
@samm7716 9 ай бұрын
Have you tried making a simulink model and then try tuning on that? maybe try sis id tools to get a model?
@jeffschroeder4805
@jeffschroeder4805 9 ай бұрын
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.
@gurkiratsingh553
@gurkiratsingh553 9 ай бұрын
why didn't you used matlab for tunning or auto tunning libraries? 🤔🤔
@JTST1234
@JTST1234 Ай бұрын
30% of video- "This project is making be mad" lol
@ivko5673
@ivko5673 9 ай бұрын
Great job. IT'svery impressive!
@hydropage2855
@hydropage2855 4 ай бұрын
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
@92gunnerjoe
@92gunnerjoe 9 ай бұрын
Time to ditch the arduino for something with wifi, esp32 or picow maybe
@jazekerxx7535
@jazekerxx7535 9 ай бұрын
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?..
@VENONixGaming
@VENONixGaming 9 ай бұрын
kiedy po polsku ?
@rasgamer1213
@rasgamer1213 9 ай бұрын
🔥
@michaelschmidt850
@michaelschmidt850 9 ай бұрын
Probably you should try to use AI for the tuning
@nrdesign1991
@nrdesign1991 9 ай бұрын
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.
@michaelschmidt850
@michaelschmidt850 9 ай бұрын
@@nrdesign1991 yeah but AI is more fancy
@wayne1950
@wayne1950 8 ай бұрын
🙈 "Promo SM"
@joetkeshub
@joetkeshub 9 ай бұрын
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...
@gianlucabelgrado3624
@gianlucabelgrado3624 9 ай бұрын
😂
@paulcunnane
@paulcunnane 9 ай бұрын
You think young people don't have mental health challenges? Wow.
@vishal01mehra
@vishal01mehra 9 ай бұрын
What is age has to do with mental health? Apparently you seem to be the perfect audience for the sponsor. Good luck.
@arbitrary_username
@arbitrary_username 9 ай бұрын
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.
@sethdhanson
@sethdhanson 9 ай бұрын
Shut up
What is the Difference Between Reaction Wheels and  Gyroscopes?
14:21
I Made a $4000 Water Cooled Bed
19:45
Nikodem Bartnik
Рет қаралды 71 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
Can Reaction Wheels control a Drone?
24:32
Tom Stanton
Рет қаралды 2,4 МЛН
I Designed, 3D Printed, and Sold a Product in 24 Hours.
10:40
Nikodem Bartnik
Рет қаралды 18 М.
Tightrope Walking Cheat Device
14:22
James Bruton
Рет қаралды 1,5 МЛН
How to turn a Satellite
11:54
Thumblegudget
Рет қаралды 17 М.
Building a Mini Vegas-Sphere
7:16
Carl Bugeja
Рет қаралды 1,7 МЛН
Cheap DIY Robot Lawn Mower - IndyMower #1
16:12
Nikodem Bartnik
Рет қаралды 48 М.
I tried to make my self balancing cube better
16:26
ReM-RC
Рет қаралды 9 М.
Alternative to bearings for tiny robots
12:05
Breaking Taps
Рет қаралды 959 М.
I built a rover using a Raspberry Pi & Arduino
16:56
Lukas Deem
Рет қаралды 255 М.
Gyro-Stabilized Monorail Train
18:10
Hyperspace Pirate
Рет қаралды 145 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН