Electronic Basics #34: Two-Position Controller & PID Controller

Поделиться
HTML-код
  • Опубликовано: 14 дек 2024

Комментарии • 577

  • @pierrec1590
    @pierrec1590 6 лет назад +142

    Hi, I am not a PID specialist, but I suspect that gluing the sensor right on the electromagnet may be the source of some instability, because the sensor is exposed to two variable fields, as well as some interactions between the neodymium magnets and the coil of the electromagnet. This has all the features of a chaotic system, including non-linear feedback. You might want to place the sensor underneath the neodymium magnets, or use a photocell instead of a hall effect sensor.
    Good luck!

    • @noweare1
      @noweare1 6 лет назад +30

      You may not be a PID specialist but you are special because you know what you are talking about. Great points.

    • @ricardomaggiore5518
      @ricardomaggiore5518 6 лет назад

      what photocell sensor can work variating the output?? i have searched a lot but just found on/off type... not ideal for these aplications of positioning.

    • @merlinsghost756
      @merlinsghost756 6 лет назад +3

      Shielding the HALL sensor on the backside with mu metal can also help, as well as moving the HALL sensor off to the side of the metal core of the electromagnet where the field from the electromagnet is less concentrated. A bar electromagnet is also helpful and should give you more distance as some of your field lines are going to take the path of least resistance and go nearly straight across the gap between the elctromagnet north and south pole, although if the HALL effect sensor is placed in the right spot between the north and south pole you may get them to zero-out their effect on the HALL sensor, not sure on that one though.

    • @senceryazici
      @senceryazici 5 лет назад +2

      You are correct, in those kind of systems where the feedback is non-linear (changed by multiple effects other than the levitating magnet) completely changes the dynamic model of the system, that will lead to unstability when the control signal aka the electromagnetic force applied by the electromagnet, will change the feedback dramatically, thus will lead to a situation that the controller thinks that the magnet position changed much. So it will try to compansate that big change which will result in a bigger control signal which causes a bigger feedback change even tough the magnet hasn't moved much. and this goes on and on... So the control signal will be affected by this problem more and more after a certain time system will go unstable. Instead of hall sensor, a distance sensor could be used. Anyway, Great work. !

    • @lorhancosta622
      @lorhancosta622 4 года назад +2

      I was also wondering if you could simply consider the contribution of the magnet as a function of the current supplied to it. And then you just subtract this value from the value given by the sensor. The function could be determined experimentally.

  • @Brendead8
    @Brendead8 4 года назад +48

    Lesson learned here: As long as you have enough power and the right components, it's all in the programming.

  • @WalidIssa
    @WalidIssa 6 лет назад +93

    This kind of systems is nonlinear and the controller can really struggle to stabilize the system around an equilibrium point. However, Two nested (inner and outer) loops can improve the performance much more.

    • @phantom349uj
      @phantom349uj 6 лет назад +6

      Walid Issa typically nested loops require another input. One slow and one fast input. It is non linear so I think he'd need to linearized the pv or cv before feeding it into the pid algorithm

    • @Pablososki14
      @Pablososki14 6 лет назад +4

      Maybe a sensor which indicates the vertical distance of the magnet from a certain spot in the structure?

    • @maku6087
      @maku6087 6 лет назад +3

      He should use a filter in the system so that unwanted frequencies can not get through.

    • @AdaptivePhenix
      @AdaptivePhenix 6 лет назад +1

      @@Pablososki14...With as much resolution as possible.

    • @dlptube1
      @dlptube1 3 года назад

      You are wrong, a PID controller can be used to control a non linear- non stable transfer function.

  • @nicholashemenway2787
    @nicholashemenway2787 4 года назад +3

    In high performance applications, the way magnetic levitation is performed is by using two control loops. You have an inner control loop using typically a PI controller that regulates current (you need current sensors) into your RL load (electromagnet). You then have a an outter control loop that regulates position typically using a PID controller with a low pass filter on the derivative term. Your sensor reads in position which goes through your PID controller... the output of this motion controller is a force command. This force command is then inverted into the corresponding current needed to produce that force. This current command is then fed into your inner loop controller which regulates your current to the desired value. The desired current flows and produces the force commanded by your PID position controller and the overall loop is closed. Tuning the current regulator is pretty simple... using pole-zero cancellation, you set kp = L * w_b and ki = R * w_b where R and L are the resistance and inductance of your electromagnet respectively and w_b is the desired bandwidth of your current controller in rad/s. Tuning the position controller is a little more involved as you must move your unstable RHP pole into the LHP. Although tuning can be done manually, it is very difficult as you're trying to make an inherently unstable system stable. Frequency domain methods usually work really well for tuning it. Cheers!

  • @ShomiTheGreat
    @ShomiTheGreat 6 лет назад +34

    From a mechatronics student- inertia, drag and friction all help stabilise the system which utilises a PID.
    The reason why a "bigger" magnet had more stability is that it had more mass, thus it was less prone to sudden position changes due to its greater inertia. This way you can slip out of complicated automatic control systems calculations and simplify experimental PID method. I think that (instead of adding additional magnets to the elongated structure which changes the field's geometry) you should try attaching non-magnetic material to the bottom of the magnet, as a weight.
    Lead is easy to melt/ shape, it has brutally high density and it is a diamagnetic. You could maybe try experimenting with small lead pellets, sticking them to the bottom of the elongated magnet until you hit the required weight for approximated parameters.

  • @Rainbowang123
    @Rainbowang123 6 лет назад +5

    Greeting GreatScott!, I have seen a lot of giveaway events, but by asking participants to find and publicly expose own mistakes in a giveaway, this is my first time. Salute your humility and efforts in doing better in educating people.
    Below are the mistakes I have found:
    1) You shouldn't be gluing your hall effect sensor to the electromagnet. The sensor should be 'focus' on detecting the magnetic field strength of the magnets without being affected by the electromagnet. In other words, during automatic control, you are changing the gain of the electromagnet, the distance you desired is no longer 700mV. The way you did causes the control system to be non-linear and time-varying.
    2) SS49E, not SS49A
    3) Hysteresis, not hysterisis
    4) Derivative controller is actually based on the rate of change of ERROR to be precise, de(t)/dt, not rate of change of actual value (mentioned at 6:04). It sounds the same and intuitively no difference, but the rate of change of error and rate of change of actual value is totally two different things.
    5) And of course, at 6:05, df(t) / dt, not df(x) / dt
    6) At 6:10, Kd factor not Kp.
    I am not sure what type of mistakes you want (minor or major?). If I need to choose only two, I will choose (3) and (5) mistakes since they are obvious in your video.
    And I hope the following will be helpful to everyone who are interested in control system engineering:
    - Normally, people use displacement sensor to do positioning of magnetic levitation (maglev) system.
    - Maglev system is a highly non-linear system, using merely conventional PID controller is never sufficient to control. Classical control (PID controller is in this section) emphasizes on LTI system, which LTI stands for linear time-invarient.
    - I believe that the performance of the MOSFET is non-linear. In other words, the supply voltage and the lifting force is not directly proportional, thus non-linear. Two ways of solving this problem - first, identify the LTI range of the MOSFET and make sure your system works only within that range, second, accept the non-linearity and uses a controller that works with non-linear properties, for example, Fuzzy-Logic controller (FLC).
    - At 7:21, the tuning method is belongs to Ziegler-Nichols tuning method. Such tuning method is easy to be implemented, and unfortunately causes it to be 'exploited' and 'abused'. The tuning method by the original author/creator emphasizes that such tuning method is only applicable to first-order plus time-delay system (FOPDT). Maglev is indeed not one of them. But still, people are using it everywhere for all kind of system without actually understand the tuning method's requirement.
    - At 7:25, I have never seen such high Ki is required for a system. I think eventually, you are implementing I controller instead PID controller, which is why it still works (and even better) and you got it theoretically correct - it will never last forever.
    I am extremely welcome to any feedback regarding what I've posted here. Anyway, I am a control student who self-fund for my own study and researches (sadly no free education at all in my country). I only has a DSO138 oscilloscope on my workbench and wanted to upgrade since long time ago, so hopefully I get to win this giveaway.

    • @antoniomeraz520
      @antoniomeraz520 3 года назад

      Awesome dude, mechatronic student here, we see some control engineering but what you said is awesome

  • @qwaqwa1960
    @qwaqwa1960 6 лет назад +6

    Scope the magnet current vs. PWM. Your freewheeling diode will keep the current flowing for a while after voltage is removed, so you may need to subtract a time offset from your PWM setting to help stabilize response.

  • @edslab5383
    @edslab5383 6 лет назад +5

    First of all you need to identify your system in order to know if it is a first order, a second order system or even higher, from that you will be able to get the correct values for the three parmeters using the appropriate methods. Mathematics are mandatory for the PID controller designing if you want to get better results. Please consider make more videos about this topic it is really interesting and helpful.

    • @nonamenoname6445
      @nonamenoname6445 5 лет назад +1

      Or don't, since you obviously don't know how to use a PID..

  • @younalazzawi
    @younalazzawi 6 лет назад +2

    I Really enjoyed the idea of applying principles of PID to this project. You made the explanation of a PID controller very simple and easy without delving into mathematical jargon, the kind we used to endure in the old days. And .... thanks for the JLCPCB link.

    • @noweare1
      @noweare1 6 лет назад

      Ha ha, so right...."the kind we used to endure in the old days." Excellent

  • @SunnyJerai
    @SunnyJerai 6 лет назад

    I have been watching you videos for a while now and I find them really informative and intriguing. The fact that you also show things and projects that didn't work out as expected or didn't work out at all ( while many other channels just fake it for views) is what makes you stand out. It gives us insight for what to look out for and how to avoid them. Hope to see more great content from you. Kudos.

  • @edwardalmanzar3927
    @edwardalmanzar3927 6 лет назад

    I made this project totally with an analog circuit. It was difficult but I managed to move the setpoint without shutting down the magnet. Is an amazing project.

  • @nivensmith6043
    @nivensmith6043 Год назад +1

    This is fantastic using the hall effect sensor. Excellent.

  • @Minecraftmigapiku
    @Minecraftmigapiku 6 лет назад +13

    You should consider that switching on and off by itself changes readings from hall effect sensor

  • @milan.stankovic
    @milan.stankovic 6 лет назад +4

    The mistakes are :
    Hysterisis is actually hysteresis and you said Kp factor the Kp factor is used in the proportional term while you were talking about the Kd factor which is used in the derivative term :D Awesome video, I had to learn about this in Uni 2 years ago it would be easier if I had this video at that time :D

  • @hasemhasan1151
    @hasemhasan1151 2 года назад +1

    Hi, I tried your methods in my Lab. It is super unstable, you're right. But I fixed it. What I did was change the shape of the levitating body. I cut out a piece of circular light weight cardboard and attached it to the magnet. Like this:
    -----()------
    Now the magnet rarely topples or falls down, because it is hard for the levitating body to topple side ways.
    Your idea works, it just needed a little mechanical touch to it.

  • @enricorov
    @enricorov 6 лет назад +1

    Automatic Control is tough stuff. Hats off, man.

  • @StanleyKubick1
    @StanleyKubick1 6 лет назад +6

    incredibly interesting project. I barely understood any of it and was completely engrossed =)

  • @power-max
    @power-max 6 лет назад +15

    Either a faster microcontroller or an analog op-amp PID controller would probably work out well. Tuning an analog PID controller would not be as easy as simply changing constants though. (Instead requiring changing component values, variable capacitors and pots would probably make this easy)

    • @DavidP_98
      @DavidP_98 6 лет назад +3

      Even better: use a fast comparator like the lm319 (or a newer high speed comp)

  • @LeadSkillets
    @LeadSkillets 6 лет назад

    PID tuning is definitely an art that takes time to master. When you get comfortable try your hand at servo systems. While they are more expensive than steppers, they are far superior in some applications.

  • @soranuareane
    @soranuareane 6 лет назад +38

    6:02 df(x)/dt? Integrating a positional function with respect to time? I don't think your IV is x here. Shouldn't that be df(t)/dt?

  • @maxtorque2277
    @maxtorque2277 6 лет назад +17

    one fundamental issue with your setup (and in fact all electromagnet setups) is that the attractive force varies linearly with coil current, but is inversely proportional to the square of the separation distance between the coil and the target magnet! So, increasing coil current by say 1amp, might be enough when the magnet is close, but not nearly enough when it is far away! That square term means as the magnet approaches the coil, the current in the coil must fall with the square of the rate of change of distance! The two step (bang-bang) controller works better because the inductance of the coil effectively stores energy, and that energy is then set by the average duty cycle of the output. With its higher gain (max on, or max off) and faster loop (less time between changing the state) that system works better than a slow, poorly tuned PID. If you want to use a PID, then two options are possible, 1) non linear gains, or (easier) 2) a feed forward table of duty cycle values. Populate that table with the duty cycle that just balances the magnets mass at each distance away from the coil. That open loop feed forward table means the PID then just has to mop up the error (in fact, you'll find a simple P controller will work) as the intrinsic phase lag of the I term has been removed!

    • @SFCounterfeiter
      @SFCounterfeiter 6 лет назад

      Max Torque Thats right! Also because of the integral process you do better if you tune a PD controller. That means set the Ki to zero!

  • @junjett6358
    @junjett6358 6 лет назад +9

    Hi, I study control systems for a living. The system you described can never be truly 'stable' from a single loop PID. What you need is a cascaded PID. The first loop should look at the derivative of position of the magnet, and the outer loop should look at the position of the magnet itself.

    • @St0RM33
      @St0RM33 6 лет назад +2

      what you mean is control both the position and velocity of the magnet, correct?

    • @junjett6358
      @junjett6358 6 лет назад +5

      St0RM33 Well, correct in a way. A cascaded controller would mean you have one loop taking in magnet position and outputting velocity, which is fed into another loop that takes in velocity and outputs electromagnet output. :)

  • @ELEKTROGOWK
    @ELEKTROGOWK 6 лет назад

    Schön zu sehen, dass auch Andere damit Probleme haben .-)

  • @patprop74
    @patprop74 6 лет назад +2

    I would like to be as smart at electronics as you are! I kind of understand just enough to watch and enjoy.

  • @carlosagorreta5276
    @carlosagorreta5276 5 лет назад +1

    the problem of this sytem is that it's not a linear system, but a non-linear one, what means you can't use linear control techniques to control it. Also PID linear tuning method like ziegler-nichols won't work with a non-linear system (a PWM control, for instance).

  • @anonymoususer6448
    @anonymoususer6448 Год назад

    I have seen several explanations of a PID controller, but this one is the best.
    It's even better than the one by @AndreasSpiess.
    And that is an achievement !
    Another GreatScott moment !

  • @AlexRhodesMV
    @AlexRhodesMV 6 лет назад +1

    This is was one of my favorite videos you've made. Good explanation of PID controllers. Thanks!

  • @yuxin7440
    @yuxin7440 6 лет назад +3

    I think a faster controller might help. And also, as someone has mentioned, position the setup in vacuum eliminate the uncontrollable air turbulence. Moreover, The initial condition of the system matters since it is a nonlinear system, so try to come up with a setup that put the magnet in the same position before every test will reduce the complexity as well.

  • @isettech
    @isettech 5 лет назад

    Before digital became common, this was all analog. The whole thing is built on a quad op amp. 3 of the amps are PID portions and the 4th sums the currents. Each portion had more control. For example the P factor has gain and offset so the linear portion is balanced with high gain with an offset to target the setpoint. The integrator and diritive has gain as well as tuning for the time constants. The time constants are selected to be complimentary to the mechanical moment of inertia for critical damping. The analog systems when properly tuned perform very well without the lag of A/D and calculation cycles on a processor. This is important when the moment of inertia is low such as the single magnet in the video. Many of these systems are linear for a low noise figure in the system without PWM.
    Would you like to try to make a video of the analog version of this? I would recommend the Active Filter Cookbook by Don Lancaster for reference in design of the low and high pass filters for the time constants.

  • @y2ksw1
    @y2ksw1 6 лет назад +1

    Ok, since you insist with the on/off hall sensor madness 😋 here another approach which works, too: switch the magnet on and off in a certain frequency and vary it based on the hall sensor values. The PID can be used to essentially control the duty cycle and fine tunes the attract and release periods.
    Please note that reliable systems use light though, because the reaction time is much faster and the proportional measurement more accurate.
    Another project could also include 2 electromagnets pulling on both ends. A practical application would be an accelerometer. Professional ones use 3 axis, 6 magnets and a steel ball, and some of those are filled with a liquid in order to throttle the movement.

    • @ryccoh
      @ryccoh 6 лет назад

      What would be a better alternative to the hall effect on/off madness?

    • @y2ksw1
      @y2ksw1 6 лет назад +1

      Light, and for extreme precision, laser. Hall effect sensors within a dynamic magnetic field are not precise enough to capture only changes from a permanent magnet, when this measurement also depends on electromagnetic fields. This method could only work if the electromagnetic field (EMF) would be static, but it isn't. An EMF builds up over time, time passes when switching on and off.
      In order to keep on/off times short, no ferromagnetic core would be ideal, but event then there are slopes depending on the inductance.
      So if you forget about sensing magnetic fields and use other means, the suspension could be close to perfect and have no visible oscillation. Light is ideal because the technology available is really fast (see light cables) and even rudimental light traps are way faster and accurate compared to hall sensors.
      PS: I've been using magnetic elevation in industrial plants. However I am curious if Scott can manage to elevate magnets with an electromagnet using hall effect sensors ... it would prove me wrong, but it is worth to watch :-)

  • @javierperez_21
    @javierperez_21 6 лет назад +2

    The hall effect sensor glued to the electromagnet might be the problem. I think something like an optical sensor would do the job well. Thanks! I really like your videos!

  • @nr7000000001
    @nr7000000001 6 лет назад

    You can make a nice rail system for trains (or little toys) with this; the rail is made of steel and the electromagnet is on the train, the train hangs down but is attracted to the steel. you can make a propulsion system when you have multiple electromagnets. And when you place this in a vacuum you have a kind of hyperloop train

  • @lauretivan6231
    @lauretivan6231 6 лет назад +1

    i really love your videos, always wanted to do more in eletronics and your way of explaning it with these nice colored schematics in action is far more better than just plain theory. i'd love to do a Moodle or Wiki of some sort of all your videos and tutorial (writing it would help me remenber more)

  • @extraace
    @extraace 6 лет назад +2

    I would switch from digital write to port registers. Digital write is slow and can do strange things long enough for magnets to get out of place and mess up the pid loop as i have discovered in my project. Worked perfect with direct port.

    • @greatscottlab
      @greatscottlab  6 лет назад +1

      +extraace I used the port registers. Look closely.

    • @brandonsaffell4100
      @brandonsaffell4100 6 лет назад

      The same could be true of using analogRead vs putting the ADC in free running and directly reading the ADC register.
      Of course it could also be true that the time to calculate the PID output is too long and a faster micro is required.

    • @extraace
      @extraace 6 лет назад

      Oh yeah I see it now. Looked through it again. I missed that screen snapshot .

  • @bur1t0
    @bur1t0 6 лет назад

    I must be learning, I was half way there with the PWM suggestion. I'm crediting your excellent teaching style :-)

  • @researchandbuild1751
    @researchandbuild1751 6 лет назад

    PID mainly help account for nonlinear systems. A magnet is non linear in its attraction. Same as inertia of a heavy object is. So just using a simple switch on/off isnt enough to accounnt correctly for error since its a nonlinear function. Thats why PID works for these problems

  • @FirechipAcademy
    @FirechipAcademy 6 лет назад

    I expect this time you make new project but you completed your previous project. that is awesome

  • @Speglritz
    @Speglritz 6 лет назад +1

    I think there is a problem with using just one linear Hall effect sensor. The sensor will naturally sense the electromagnet as it switches as well as the neodymium magnet as it changes its distance. If you install two hall effect sensors on each side of the electromagnet then you could use their difference to sense only the magnetic field from the neodymium magnet.

  • @hashemmi24
    @hashemmi24 6 лет назад +1

    The patreon guided you to a simplified ziegler nichols method, basically, eliminate Ki and Kd, and set Kp to a value, and monitor the sensor with an oscilloscope, lf the wave form's amplitude rises, decrease Kp , if the amplitude decays, increase Kp, try as hard as you can to get a sin wave, that 1 second you reached was almost it, at this point the Kp value is Ku (ultimate gain), then you use Ku value in ziegler nichols equations to derive Kp, Ki and Kd. Fine tuning is another thing.
    Edit: the equations are really simple, one or two multiplication at most :p

    • @smeezekitty
      @smeezekitty 6 лет назад

      Why toss out Ki though? Having a Ki means you have to worry about setting the center point precisely

    • @rodneygian12
      @rodneygian12 6 лет назад

      Can this method be used for slow reacting outputs like temperature? Im trying to tune my PID for my temperature control system. Trial and error takes too long. TOO LONG!

    • @hashemmi24
      @hashemmi24 6 лет назад +1

      @smeezekitty You toss Ki and Kd only at first, so you'd have only one variable to worry about(Kp), which after trial and error give me Ku, i then use Ku to get the exact Kp, Ki and Kd.

    • @hashemmi24
      @hashemmi24 6 лет назад

      @Rodney Yruretai believe it does, trialing three variables could take alot of time and might never work, trialing only Kp at first and using the oscope as a reference can be done quickly

    • @rodneygian12
      @rodneygian12 6 лет назад

      I'm using PID library by Brett Beauregard and It doesn't respond to just Kp with both Ki and Kd at 0. Any suggestions? Thanks for the help, brother.

  • @dinesh8238
    @dinesh8238 6 лет назад +7

    I think you have to make part 3 to fix issues

  • @apostolosvrontos5792
    @apostolosvrontos5792 6 лет назад +8

    You can try the Matlab PID Tuner. You give the Voltage and the Distance as a plot and it spits you the KKK factors

  • @TheJay6621
    @TheJay6621 6 лет назад

    Awesome.. watching an object levitating is satisfying..

  • @sjoervanderploeg4340
    @sjoervanderploeg4340 6 лет назад +2

    You are modulating the voltage, I think you should wire the the MOSFET to modulate current instead!

  • @playvectrex
    @playvectrex 6 лет назад

    I think the reason a larger mass of magnets is more stable could be due to the fact that you increased your electromagnet capability. To see if that's true try decreasing the peak current to the coil while using smaller magnets. A larger mass dampens out the instability. Also try to remove the D (derivative) portion of your PID controller. I've experienced instability when adding this term when the value is not calibrated properly. Sometimes analog hardware is the right tool for the job.

  • @shibi1010
    @shibi1010 8 месяцев назад

    Awesome
    Great learning
    Thanks for sharing
    I wish I had teachers like you..

  • @DavidP_98
    @DavidP_98 6 лет назад

    What also could help is using a high voltage zenerdiode as flyback diode for the electromagnet. Higher voltage = faster discharge of the electromagnet. If you have a slow discharge the magnetic field will also slowly decrease when the elktromagnet is supposed to be off. Might make it more stable ;)

  • @insightfool
    @insightfool 6 лет назад +1

    I think you will have better luck if you use a wider electromagnet. There's more "buffer" if you will and it will give you more of a cushion in your P values. When you look at most of the levetators out there the controller magnet is always wider than the floating magnet.

  • @Just_call_me_M
    @Just_call_me_M 6 лет назад +1

    i dont understand some times but i keep watching ur videos because they are intersting and i learn something new every video u release

    • @greatscottlab
      @greatscottlab  6 лет назад

      Happy to hear that. That is what I am trying to achieve.

    • @Just_call_me_M
      @Just_call_me_M 6 лет назад

      GreatScott! Well ur doing a great job well done

  • @tk2life
    @tk2life 6 лет назад +1

    Maybe the problem is the lateral oscillations, vertically it work well but when it moves horizontally the sensor detect fakes measures because the moving magnetic field of the magnet is changing, and the fake measures take out of set point the system

  • @InFAMOUSPS4_19
    @InFAMOUSPS4_19 4 года назад

    I might have this wrong but that long ferromagnetic rod might have a higher moment of inertia than your other magnet configuration types thus it doesn’t want to oscillate as much. The magnetic field lines are also different (this case the poles have a smaller area) thus giving the circuit a more precise signal on the Hall effect sensor an easier job to do

  • @meem9328
    @meem9328 4 года назад +1

    If you add another e-magnet under the permanent magnet so that when the permanent magnet falls, the other magnet pushes it up, this will create an ocilation

  • @anishsarkar120
    @anishsarkar120 6 лет назад

    i think this the community tab you mentoned about :---
    1.(6:05)Derivative controller is actually based on the rate of change of ERROR to be precise/correct (in control systems), de(t)/dt, not rate of change of actual value
    2. Kd factor not Kp at 6:10
    BTW a grt idea for giveaway and i ddint knew you had covered PID of control systems

  • @aslambatcha5683
    @aslambatcha5683 5 лет назад

    You got a good handwriting mate.

  • @En1Gm4A
    @En1Gm4A 6 лет назад +1

    I am always wondering how many textmarkers you need per video. Since their tip gets dity by marking black liner

  • @maulanaabdulmalika6814
    @maulanaabdulmalika6814 6 лет назад

    Finally, the basic electronic video has been release

  • @waltsteinchen
    @waltsteinchen 6 лет назад

    Hi Scott, as mentionend to the last video I build such a system long time ago (without a Microcontroller). These days I just had 3 potis to adjust the K* values, which worked pretty good. So my hint would be to use 3 potis on ADC channels to adjust the values simply with a screedriver, not having to run though a build cycle. Hope this helps!

  • @Maxisokol
    @Maxisokol 6 лет назад +8

    Hey Scott!
    The sensor in your setup is the weak spot - since it changes the output not only due to magnet movement, but also when you change the current in the coil.
    I have instructed a student project with the same topic, you can see how we solved this problem with 2x hall sensors: /watch?v=1JjDcn8fHO0
    Hope you'll make your prototype work!

  • @billhickswasgreat3421
    @billhickswasgreat3421 6 лет назад +2

    How do you just glue a hall effect sensor to a magnet? Shouldn't the magnet interfere with the sensor?

    • @DieBastler1234
      @DieBastler1234 6 лет назад

      Georgi Chh It does. The magnets magnetic field interferes with the electromagnets field, depending on the distance.

    • @noweare1
      @noweare1 6 лет назад

      I know the hall effect sensor has an orientation so it may not respond, but that is a good question..

  • @kecoaberkacamata6128
    @kecoaberkacamata6128 5 лет назад

    hah, here you are, I saw your another video before this one. i read also the comments with pid controller, but for magnetic levitation, it's better to use z-transform, or n-order discrete controller.

  • @Greg_ThymeTraveler
    @Greg_ThymeTraveler 6 лет назад

    Hey, I'm not sure if anyone has mentioned this or if you knew this already but I noticed at 7:25 that the PID values had decimals. I was working on a PID project for one of my classes and one of the guys in my group recommended not using decimals due to something about the language that Arduino's are coded in. I'm still getting the hang of coding and I forget what his exact explanation was but when we changed the values, we got immediate results. Maybe you can try that if you haven't already.

  • @geetanshujain3154
    @geetanshujain3154 6 лет назад +7

    Use MATLAB to tune ur pID controller... there u dont evn need the system characteristics you can jst enter ur response type and sampling time ... it will automatically give u values of Kp Kd and Ki automatically

    • @nonamenoname6445
      @nonamenoname6445 5 лет назад +2

      @@rauankaldybaev4770 or you could actually study the PID controller and use a proper method(like nichols ziegler) and not a stupidly slow manual calibration/or an unnecessary complex method..

  • @ksfakianakis1
    @ksfakianakis1 6 лет назад

    Nice project please let me know what did you use for feedback for the system.if you haven t use any thats the main reason for not levitating .you must have a sensor that determines the exact position of the magnet.(maybe a camera).plus if you use a camera you can change the magnet without changing the pid values.

  • @SinanAkkoyun
    @SinanAkkoyun 6 лет назад +2

    But the hall sensor also captures the magnetic field of your electromagnet, how do you cancel that out?

    • @greatscottlab
      @greatscottlab  6 лет назад +1

      You don't

    • @SinanAkkoyun
      @SinanAkkoyun 6 лет назад

      GreatScott! Thanks for that fast reply, why is it irrelevant?

  • @TheS1l3ntOne
    @TheS1l3ntOne 5 лет назад

    You just need more electromagnets to create a magnet free core. The core's diameter should be larger than the to be levitated magnet. And use a h-bridge to create an alternating field. Like this : as the magnet flips you should also flip the polarity of the electromagnet. It should work.

  • @sunny90908
    @sunny90908 6 лет назад +2

    Nothing beats PID CONTROLLER!! Nice to know you are still working on magnetic levitation. What's next ???

    • @greatscottlab
      @greatscottlab  6 лет назад +1

      I don't want to spoil what comes next.

    • @sunny90908
      @sunny90908 6 лет назад

      GreatScott! Understood!!!!

    • @sunny90908
      @sunny90908 6 лет назад

      Have you got increased subs?? I told my friends to subscribe to your channel.

  • @Cheese_1337
    @Cheese_1337 6 лет назад +3

    wait why didnt you try that arduino compatible board? the one with higher output bit rate , etc. ?

  • @pedrogramos
    @pedrogramos 4 года назад +1

    Can you re-upload the spreadsheet? I'm curious about the method used

  • @gervas8457
    @gervas8457 6 лет назад

    I will admit I truly understood very little of this video. But I have found something interesting to investigate further. Thanks!

  • @adamharris6557
    @adamharris6557 4 года назад +1

    Great project! I'd like to build it but the link to the spreadsheet is broken. Could you upload it again please?

  • @fifaham
    @fifaham 4 года назад

    Have you tried to use the Gyro mechanism and the high EM voltage generator, to forcefully spit electrons downward, with large caps? Some people on RUclips have done something similar and need improvement.

  • @visionofwellboyofficial
    @visionofwellboyofficial 6 лет назад +1

    Help me how to solve these PID equations easily
    Thanks

  • @arnavmarchareddy1831
    @arnavmarchareddy1831 6 лет назад +2

    Hey Scott!! When you build your projects how do you plan it??? How do you know that this frame should be 10 in by 6 in or this piece should be this size so it all fits together, I struggle with that!!

    • @m.usamausman
      @m.usamausman 6 лет назад

      Arnav Marchareddy i use a cad i design the layout of the parts with a real world size and build a frame around it

  • @Chiller3k
    @Chiller3k 6 лет назад +4

    One of the problems you are facing is that the system is non linear. The force weakens with 1/r^2. PID controllers can do a lot... but controlling more complex non linear systems sometimes requires a non linear controller. (I'm not saying, this system can't be controlled by a PID though)

    • @matthewmaxwell-burton4549
      @matthewmaxwell-burton4549 6 лет назад +1

      You are right, lets not forget the dead time induced by the arduino and its calculation time. PID is very old and extreamly outdated. This system won't be robust at all too.

    • @Chiller3k
      @Chiller3k 6 лет назад

      Matthew Maxwell-Burton I wouldn't go as far too say PIDs are outdated =D Depends on the field of work and what you are trying to do. But you are right, nowadays there are way more options that sometimes have quite good self tuning as well.
      But I agree with the dead time part! I imagine that's also why the longer magnet worked better. It made the system slower and thus the dead time of the arduino had less of an effect

    • @GrumpyOldTech
      @GrumpyOldTech 6 лет назад

      Chiller3k I have gotten around similar non-linear issues in the past by applying an appropriate equation between the pid output and the actual control element and achieved reasonable results. I tend to agree though, the deadband will be a significant issue, maybe, just for fun, implement in analog form, it’s just a few opamps and a handful of components....

    • @matthewmaxwell-burton4549
      @matthewmaxwell-burton4549 6 лет назад

      Haha i was joking a bit, but my prof at uni hates pid controllers. His phd was on control theory.
      Yes the deadtime does not suit a pid controller. You could always implement a smith predictor. Which would help a lot ! No point going analogue nowadays, control theory has gone a long way since. I which he'd brake out the simulink.

    • @PunitSoni00
      @PunitSoni00 6 лет назад

      Curious. Can you please point to some of the other more robust alternatives?

  • @infinitepower6780
    @infinitepower6780 6 лет назад

    Just a completely random thought...
    Is the housing of the electromagnet steel? If so, then the magnet may reach a "point of no return" if it is pulled too high.
    This may also explain why a longer, thinner magnet is more stable as the mass is more but the top surface area is lower than that of a magnet of the same mass.
    ...I might be totally wrong, but this was just a thought that popped into my mind.

  • @SMITHII_
    @SMITHII_ 6 лет назад +2

    Scott, you should get into fpv quadcopters. Right up your alley. Especially when you smoke the flight controller, because you could actually fix it instead of just replacing it.

  • @publicmail2
    @publicmail2 6 лет назад

    Perhaps the EMF of wires near is a problem?

  • @sipbit
    @sipbit 6 лет назад

    Had a similar set up. I found in some forum that the Hall effect needs to be positioned a few (1-2)mm away from the electromagnet to get it stable. Don’t know why it worked. It just did.

  • @rondlh20
    @rondlh20 6 лет назад +1

    4:16 hysterisis -> hysteresis, 6:11 Kp->Kd factor

  • @dlptube1
    @dlptube1 3 года назад

    Another way to do this, is sensing the position with a light and a photoresistor or phototransistor. I get Much more control range and stability than with magnetic flux sensors.

  • @kornshadow097
    @kornshadow097 Год назад

    Get a Bluebird pid controller and look at its software. It has an automatic K value determination algorithm.
    If you can add this to your ardruino, you should be able to have it automatically do this for you!

  • @AlbusUmbrus
    @AlbusUmbrus 6 лет назад +1

    First of all, my advise: do not use side-code on such simple but sensitive stuff, like PID-controllers.
    This realization of PID have no winding compensation.
    I.e. when kP kD values are big enough it is happened magnet is fully on or fully off (PWM at it's max or low value), which means you cannot make it more "ON" or more "OFF" than it is. In this periods the load above is begins to move, until it reaches the point, where, according to kP and kD, the output power should return back to intermediate values.
    But at that period of time, where power was maxed out, the integral component continued to accumulate the error. So it's have a much bigger value that it should have, and magnet generates bigger and smaller force than it required.
    So, the solution is "unwinding" - i.e. stopping to calculate integral value, when control is maxed out. Brett Beauregard's PID realization does not do it.

  • @rickyleung5890
    @rickyleung5890 6 лет назад +1

    the derivative in 6:04 should be df(x)/dx or df(t)/dt
    also,can you introduce the ziegler-nichols method?

  • @ionforbes4155
    @ionforbes4155 6 лет назад

    I can see this channel reaching 1m subs

  • @matejhusek6855
    @matejhusek6855 6 лет назад

    I would really like to make my own 100N electromagnet . Can you please give an idea on how to make it (what wire? dimensions? wiring? material?) ? Please , help.
    Thanks

  • @NNNILabs
    @NNNILabs 6 лет назад

    Just one look at all you videos will make anyone an electronics expert.

  • @wyattharmon7609
    @wyattharmon7609 3 года назад

    You didn't add gravity in as a factor, or momentum?

  • @VIVEKKUMARYADAVnullRA
    @VIVEKKUMARYADAVnullRA 4 года назад

    Can you please give us the link for PID calculation again as the previous one is not working ? And also the coding.

  • @timobk14
    @timobk14 6 лет назад

    Hey Scott... again nice video. For a basic understanding I'm agree with you, but I hope there will come more videos about PIC. Like...scoping set and act values to improve pic values. Keep on going dude. Thumbs up

  • @Thenerdytraveller
    @Thenerdytraveller 5 лет назад

    Why don't you add another hall effect sensor at the bottom and whenever the magnet comes near the bottom hall effect sensor it activates the external interrupt of the arduino to activate the electromagnet to pull the magnet towards itself.

  • @NivagSwerdna
    @NivagSwerdna 6 лет назад

    @06:04 should be df(t)/dt; @06:14 should be Kd (diagram is correct, voice-over refers to Kp the P constant)

  • @hammerkino
    @hammerkino 6 лет назад +1

    Maybe include a smith predictor if you can describe your system precise enough. This would solve the issue of the dead time your system needs to react.

  • @GeorgeGeorge-xj2bc
    @GeorgeGeorge-xj2bc 6 лет назад

    Pulling the mass against gravity is much difficult rather than pushing it upwards i think because there are two out of controls points,completely stuck and fall down.When pushing it there is no chance to go higher from a certain distance but it needs to maintain equal distance in the center so it needs multiple magnets.

  • @Kalanchoe1
    @Kalanchoe1 6 лет назад

    If the magnet were to be kept rotating, would there be some kind of gyroscopic effect that could help increase stability?

  • @vaioskaliakoudas6388
    @vaioskaliakoudas6388 6 лет назад

    The only thing you have after this, is to make a new DIY Or Buy episode, comparin' what worths for an electromagneticaly-elevated rotational display

  • @sunsun19831206
    @sunsun19831206 6 лет назад

    at 0.54 diode leg is broken at 4:16 hysterisis hysteresis at 6:11 Kp Kd factor

  • @assadij
    @assadij 6 лет назад +1

    You shouldn’t place the hall effect sensor anywhere near the solenoid! Place it below the magnet instead!

  • @javalin597
    @javalin597 6 лет назад

    Hey! If you want to make this even better, you could use a phase-lead compensator!

  • @nickdrobec7665
    @nickdrobec7665 6 лет назад

    There system on which you are trying to apply the PID isn't linear. Which is also why the PID doesn't work, since it is used only for linear ones. Try using a fuzzy controller.

  • @ECrackers
    @ECrackers 6 лет назад +1

    I have many cameras which i extracted from old mobiles. So can i directly interface them with arduino and raspberry pi module?

    • @ECrackers
      @ECrackers 6 лет назад +1

      Please reply or make a video on it.

  • @mohsenk4278
    @mohsenk4278 5 лет назад

    How about using two or even four electro magnets? (Top,bot,right,left) creating a void in the middle...