Announcement

Collapse
No announcement yet.

Weirdness with a filtered PWM through a coil

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Weirdness with a filtered PWM through a coil

    This is connected to the electromagnetic stirrer that I'm working on which I discussed in another post - for those who remember...

    Anyways, I wanted to smooth out the voltage going through the coils as I vary the voltage to get a smooth spin on the magnetic pill. And since I'm doing this project with an Arduino, I only have PWM to work with. So to smooth it out, I use an RC filter which initially works pretty good.

    Here is the input PWM vs filtered output before putting the load on it



    Then, I attach the coil and move the leads of the scope as per this drawing



    However, this is the final result...



    The voltage going through the coil seems to spike pretty quickly on the up and the down swing...

    Using photoshop, this image is more what I would LIKE the wave through the coil to look like.



    Is there anything I can do to smooth it out? I'm assuming that the spiking is because of the inductive properties of the coil?
    Attached Files

    #2
    Re: Weirdness with a filtered PWM through a coil

    your going to see back emf from the stirer and backpulses from the coil itself - good luck trying to kill that.

    Comment


      #3
      Re: Weirdness with a filtered PWM through a coil

      Originally posted by stj View Post
      your going to see back emf from the stirer and backpulses from the coil itself - good luck trying to kill that.
      Back EMF usually happens when you suddenly cut power or reverse it quickly, no?

      Comment


        #4
        Re: Weirdness with a filtered PWM through a coil

        no, your stirer is in constant motion so when you have no coil pulse the stirer will transfer some current back into it. (because it is still in motion)

        Comment


          #5
          Re: Weirdness with a filtered PWM through a coil

          Originally posted by stj View Post
          no, your stirer is in constant motion so when you have no coil pulse the stirer will transfer some current back into it. (because it is still in motion)
          The "stirrer" will be the magnetic pill, and it will be in a liquid that is VERY vicious. It's going to offer plenty of resistance for the coils ... that's why I'm doing this in the first place. When I built one with a neodymium bar magnet (the strongest one I could find) and the same magnet in the pill ... got them as close together as I could, and the bar magnet just couldn't hold the pill down while it spun because the liquid was so thick. When these coils stop, that pill will stop really fast so it MIGHT induce a little emf into the coils for a fraction of a second, but not much, and I doubt it would be more than the mosfet could handle ... I could throw a diode in just in case.

          Comment


            #6
            Re: Weirdness with a filtered PWM through a coil

            You need to correct the MOSFET, you show P-CH in your schematic, it will not work, the current will flow through coil straight to circuit ground via body diode of the MOSFET. Did you actually use P-CH MOSFET?
            Never stop learning
            Basic LCD TV and Monitor troubleshooting guides.
            http://www.badcaps.net/forum/showthr...956#post305956

            Voltage Regulator (LDO) testing:
            http://www.badcaps.net/forum/showthr...999#post300999

            Inverter testing using old CFL:
            http://www.badcaps.net/forum/showthr...er+testing+cfl

            Tear down pictures : Hit the ">" Show Albums and stories" on the left side
            http://s807.photobucket.com/user/budm/library/

            TV Factory reset codes listing:
            http://www.badcaps.net/forum/showthread.php?t=24809

            Comment


              #7
              Re: Weirdness with a filtered PWM through a coil

              Originally posted by budm View Post
              You need to correct the MOSFET, you show P-CH in your schematic, it will not work, the current will flow through coil straight to circuit ground via body diode of the MOSFET. Did you actually use P-CH MOSFET?
              No, I am using an IRF520

              Comment


                #8
                Re: Weirdness with a filtered PWM through a coil

                You're dealing with the unpredictable gain of the transistor around its threshold and will be tough to do without a feedback system, perhaps with an op amp. Unless you have special needs I'd say do away with smoothing the pulses with PWM, you'll be fighting it to no avail.

                Plus as you have it now you'll be wasting quite a bit of power... alas it's all a tradeoff anyway.

                Comment


                  #9
                  Re: Weirdness with a filtered PWM through a coil

                  Originally posted by budm View Post
                  You need to correct the MOSFET, you show P-CH in your schematic, it will not work, the current will flow through coil straight to circuit ground via body diode of the MOSFET. Did you actually use P-CH MOSFET?
                  Here's a corrected schematic

                  Comment


                    #10
                    Re: Weirdness with a filtered PWM through a coil

                    Originally posted by eccerr0r View Post
                    You're dealing with the unpredictable gain of the transistor around its threshold and will be tough to do without a feedback system, perhaps with an op amp. Unless you have special needs I'd say do away with smoothing the pulses with PWM, you'll be fighting it to no avail.

                    Plus as you have it now you'll be wasting quite a bit of power... alas it's all a tradeoff anyway.
                    Yeah the coils do get pretty hot fairly quickly when I apply 19 volts to them through the mosfet, which is still not powerful enough yet so I don't know what the final voltage will be ... I'm considering actually stacking two of these coils and connecting each stacked pair in parallel just because I need more magnetic flux from them ... but I haven't started playing with that yet, I want to get the timing down first.

                    Comment


                      #11
                      Re: Weirdness with a filtered PWM through a coil

                      i dont see how that circuit works,
                      the fet is voltage-driven, not current driven.

                      so once that 22uf cap gets charged - it stays charged.
                      shouldnt it have a parallel discharge resistor if your trying to use it as a "shock absorber"?

                      Comment


                        #12
                        Re: Weirdness with a filtered PWM through a coil

                        Also, are those screen shots of your Oscilloscope or screen shots of the simulation program?
                        The cap will have to be discharged through that 3K5 Ohms resistor when PWM goes low but if the PWM frequency is too high for that RC time constant then the cap will never be discharged completely. It also looks to me that the MOSFET is operating in linear region with that 3V of Gate drive.
                        What is the PWM frequency? Your screen shots are just hard to read/see.
                        Last edited by budm; 11-14-2020, 07:56 PM.
                        Never stop learning
                        Basic LCD TV and Monitor troubleshooting guides.
                        http://www.badcaps.net/forum/showthr...956#post305956

                        Voltage Regulator (LDO) testing:
                        http://www.badcaps.net/forum/showthr...999#post300999

                        Inverter testing using old CFL:
                        http://www.badcaps.net/forum/showthr...er+testing+cfl

                        Tear down pictures : Hit the ">" Show Albums and stories" on the left side
                        http://s807.photobucket.com/user/budm/library/

                        TV Factory reset codes listing:
                        http://www.badcaps.net/forum/showthread.php?t=24809

                        Comment


                          #13
                          Re: Weirdness with a filtered PWM through a coil

                          Originally posted by stj View Post
                          i dont see how that circuit works,
                          the fet is voltage-driven, not current driven.

                          so once that 22uf cap gets charged - it stays charged.
                          shouldnt it have a parallel discharge resistor if your trying to use it as a "shock absorber"?
                          He probably programmed the driver to both source and sink current, so yes this should work as long as the RC delay is shorter than the desired low frequency cycle time... much shorter...
                          Originally posted by budm View Post
                          Also, are those screen shots of your Oscilloscope or screen shots of the simulation program?
                          Scope of course.

                          If he wants to get the input to look like output, needs negative feedback to get amplification ratio down to 1:1.
                          It also looks to me that the MOSFET is operating in linear region with that 3V of Gate drive.
                          Yep sure is, and he has to in order to get it to work the way he drew it, and then hence the concern about power.
                          Last edited by eccerr0r; 11-14-2020, 09:50 PM. Reason: clarification

                          Comment


                            #14
                            Re: Weirdness with a filtered PWM through a coil

                            Originally posted by budm View Post
                            Also, are those screen shots of your Oscilloscope or screen shots of the simulation program?
                            My osciliscope.

                            Originally posted by budm View Post
                            The cap will have to be discharged through that 3K5 Ohms resistor when PWM goes low but if the PWM frequency is too high for that RC time constant then the cap will never be discharged completely. It also looks to me that the MOSFET is operating in linear region with that 3V of Gate drive.
                            What is the PWM frequency? Your screen shots are just hard to read/see.
                            If you click on the screenshot image, it should pull up the full-size version which is exactly what I see on my screen. All of the values are calculated by the software and shown at the bottom of the display under the wave.

                            Originally posted by stj View Post
                            i dont see how that circuit works,
                            the fet is voltage-driven, not current driven.

                            so once that 22uf cap gets charged - it stays charged.
                            shouldnt it have a parallel discharge resistor if your trying to use it as a "shock absorber"?
                            It works ... you can see by the screenshots of my oscilloscope that it works... I think the cap discharges through the resistor maybe? Or maybe the load that I have attached to it which would be the gate of the mosfet.

                            Comment


                              #15
                              Re: Weirdness with a filtered PWM through a coil

                              I see a problem with your project- the coil can only generate one magnetic pole or nothing- let's say it's the North pole. For any kind of motor or spinner, you also need to generate the opposite (South) magnetic pole.
                              Because current can only flow in one direction, the coil only makes a magnetic field to attract the magnet but not repel it.

                              So an H-bridge or AC drive current is needed for both directions. The sine-wave you are trying to make is only half a wave (of current) really. It goes up and back to zero but does not reverse polarity.

                              Comment

                              Working...
                              X