Reaction Wheel Took Me 3 Years to Make Stable

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 มี.ค. 2024
  • Check out our sponsor BetterHelp and get 10% discount on your first month of therapy: betterhelp.com/nikodem
    Instagram: @nikodembartnik
    Patreon: / nikodembartnik
    3D files: www.printables.com/pl/@Nikode...
    GitHub: github.com/NikodemBartnik/Rea...
    ✉️Business inquiries: nikodem.bartnik@gmail.com
    Subscriber count at the time of upload: 130 644
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 56

  • @nikodembartnik
    @nikodembartnik  2 หลายเดือนก่อน +3

    Check out our sponsor BetterHelp and get 10% discount on your first month of therapy: betterhelp.com/nikodem

    • @Schmogel92
      @Schmogel92 2 หลายเดือนก่อน +11

      Hey, I know you mean well, but maybe choose another sponsor in the future. Betterhelp does some sketchy and unethical stuff...

    • @nrdesign1991
      @nrdesign1991 2 หลายเดือนก่อน

      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 14 วันที่ผ่านมา

      Why didn't you enclose the wheel so id it fell over it wouldn't touch the surface & run away.

  • @143Mazz91
    @143Mazz91 2 หลายเดือนก่อน +2

    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.

  • @andreasportillo2064
    @andreasportillo2064 2 หลายเดือนก่อน +6

    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!

  • @jacekgrzybowski5427
    @jacekgrzybowski5427 2 หลายเดือนก่อน +14

    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

  • @Enderkruemel
    @Enderkruemel 2 หลายเดือนก่อน +4

    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 ...

  • @Monosscema2012
    @Monosscema2012 2 หลายเดือนก่อน +10

    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 2 หลายเดือนก่อน

      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.

  • @3dPrintCreator
    @3dPrintCreator 2 หลายเดือนก่อน +2

    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.

  • @dominikzz6667
    @dominikzz6667 2 หลายเดือนก่อน +2

    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ę ;)

  • @Kmnri
    @Kmnri 2 หลายเดือนก่อน +10

    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)

  • @scaytrase
    @scaytrase 2 หลายเดือนก่อน +1

    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

  • @deathshaker0026
    @deathshaker0026 2 หลายเดือนก่อน

    It's always interesting going back to finish old projects.

  • @russ-techindustries
    @russ-techindustries 2 หลายเดือนก่อน +1

    You might try moving the MCU up and closer to the actual reaction wheel so it has a more precise reading of the movement.

  • @M_Leiva
    @M_Leiva 2 หลายเดือนก่อน

    Nice video. For control projects, work with register programming is also a good option.

  • @paulroberto2286
    @paulroberto2286 2 หลายเดือนก่อน +2

    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

  • @RemoteAccessGG
    @RemoteAccessGG 2 หลายเดือนก่อน +1

    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.

  • @andymclaughlan3132
    @andymclaughlan3132 2 หลายเดือนก่อน +2

    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!

  • @sethdhanson
    @sethdhanson 2 หลายเดือนก่อน

    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.

  • @94todd
    @94todd 2 หลายเดือนก่อน

    Would definitely recommend the creality k1 over the bamboo labs

  • @boostedhuman
    @boostedhuman 2 หลายเดือนก่อน

    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.

  • @WoLpH
    @WoLpH 2 หลายเดือนก่อน

    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!

  • @ivko5673
    @ivko5673 2 หลายเดือนก่อน

    Great job. IT'svery impressive!

  • @geekmystique
    @geekmystique 2 หลายเดือนก่อน

    As said before, VSCode, PlatformIO, ESP32 will change a lot for this

  • @BenKDesigns
    @BenKDesigns 2 หลายเดือนก่อน +1

    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...

  • @stevewebb5735
    @stevewebb5735 2 หลายเดือนก่อน

    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

  • @vintagemotorsalways1676
    @vintagemotorsalways1676 2 หลายเดือนก่อน

    I think the silicone mat may be influencing the stability.

  • @alfredonovoa8124
    @alfredonovoa8124 2 หลายเดือนก่อน

    There are many Nidec motors in Aliexpress

  • @samm7716
    @samm7716 2 หลายเดือนก่อน

    Have you tried making a simulink model and then try tuning on that?
    maybe try sis id tools to get a model?

  • @viniciusfriasaleite8016
    @viniciusfriasaleite8016 2 หลายเดือนก่อน

    Maybe MPU6050 has not a good zero offset. Have you calibrated for that?

  • @gurkiratsingh553
    @gurkiratsingh553 2 หลายเดือนก่อน

    why didn't you used matlab for tunning or auto tunning libraries? 🤔🤔

  • @evanbarnes9984
    @evanbarnes9984 2 หลายเดือนก่อน +1

    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 2 หลายเดือนก่อน

      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 2 หลายเดือนก่อน

      @@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.

  • @rasgamer1213
    @rasgamer1213 2 หลายเดือนก่อน

    🔥

  • @jeffschroeder4805
    @jeffschroeder4805 2 หลายเดือนก่อน

    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.

  • @92gunnerjoe
    @92gunnerjoe 2 หลายเดือนก่อน

    Time to ditch the arduino for something with wifi, esp32 or picow maybe

  • @cozmo4694
    @cozmo4694 2 หลายเดือนก่อน +7

    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 2 หลายเดือนก่อน

      I recommend installing sponsorblock to skip stuff like that ;)

    • @hung8969
      @hung8969 2 หลายเดือนก่อน

      Glad betterhelp is getting dawg on. My favorite podcast used to push them and then one day they came out and just bashed them like crazy. Later found out they sell your information since it doesn’t fall under hippa.

  • @VENONixGaming
    @VENONixGaming 2 หลายเดือนก่อน

    kiedy po polsku ?

  • @jazekerxx7535
    @jazekerxx7535 2 หลายเดือนก่อน

    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?..

  • @michaelschmidt850
    @michaelschmidt850 2 หลายเดือนก่อน

    Probably you should try to use AI for the tuning

    • @nrdesign1991
      @nrdesign1991 2 หลายเดือนก่อน +2

      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 2 หลายเดือนก่อน

      @@nrdesign1991 yeah but AI is more fancy

  • @wayne1950
    @wayne1950 หลายเดือนก่อน

    🙈 "Promo SM"

  • @joetkeshub
    @joetkeshub 2 หลายเดือนก่อน +2

    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 2 หลายเดือนก่อน

      😂

    • @paulcunnane
      @paulcunnane 2 หลายเดือนก่อน +10

      You think young people don't have mental health challenges?
      Wow.

    • @vishal01mehra
      @vishal01mehra 2 หลายเดือนก่อน +6

      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 2 หลายเดือนก่อน +5

      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 2 หลายเดือนก่อน

      Shut up