Announcement

Collapse
No announcement yet.

Non inverting Schmitt Trigger question

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

    #21
    Re: Non inverting Schmitt Trigger question


    https://www.ametherm.com/blog/inrush...inrush-current
    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


      #22
      Re: Non inverting Schmitt Trigger question

      Originally posted by Longbow View Post
      Your description of the power windows is interesting. Depends upon how many functions are already controlled by the main computer. How much of the logic is local (inside the door itself)? All this logic CAN be implemented locally, but I would first ask if there is something faulty with the present setup?

      Another example is a powered antenna. My car has a local circuit attached to the motor. That circuit assumes that the antenna is in the down position when the car is shut off. In this case, the antenna is either all the way up, or all the way down. For your window, it seems like the motor should only be required to close the window when you lock the car, regardless of where the window might be. So the direction would only be "up". If the window is already all the way up, then the stall circuit will detect it.

      Since there is no mechanical limit switch, the up and down limit is a circuit that senses the stall current in the motor, and then shuts it off.

      If I have the antenna assembly on the bench, the measured inrush current is not an issue because the motor is relatively small and geared down. The circuit is designed to detect the limit condition by sensing a current peak that lasts for a certain length of time. The stall event can last as long as your design says it should for reliable detection. So, including special circuitry to detect startup (inrush) current is unnecessary. There is no micro on that board, either. Just a couple of relays and a few discrete transistors and other parts.
      Ok cool, let's dig in further and clarify some stuff: the car's computer is not connected to the windows at all. The windows are controlled by the traditional rocker switches for going up or down. There's no electronics whatsoever involved in running them and the car's service diagram confirms this. I already have an aftermarket box thingamajig that sort-of does what I want it to: it taps into the lock signal of the ECU and through a relay, it connects the "up" terminal of the window to 12v, essentially mimicking the button being pressed in the UP position. The shortcoming is the one in my previous posts: while it DOES work, sometimes it doesn't roll them all the way up, since it doesn't actually know whether the window has closed or not, so if there's a smudge or something sticky on the window or rubbers or for some other reason the window takes longer to roll up, the box will cut out even if it's not up yet, so I want to build something more reliable, mostly for the sake of learning and experimenting. Like I said, sadly there's no way I can test this with the car's windows directly, since I don't have a garage, so I grabbed the next best thing which is a motor from a cordless drill and we'll prototype with that instead.
      Wattevah...

      Comment


        #23
        Re: Non inverting Schmitt Trigger question

        Oh yeah, the reason I want an H-bridge is because I thought while we're at it, I might as well add that "latch" function that other cars have, whereby if you press the rocker in one direction and hold it there for a little, the window will go down/up by itself without you having to hold the button down - useful in summer when you hop in and want to buckle up at the same time. I've already simulated this and it works, though building the thing will be.....interesting
        Wattevah...

        Comment


          #24
          Re: Non inverting Schmitt Trigger question

          Originally posted by Dannyx View Post
          The shortcoming is the one in my previous posts: while it DOES work, sometimes it doesn't roll them all the way up, since it doesn't actually know whether the window has closed or not, so if there's a smudge or something sticky on the window or rubbers or for some other reason the window takes longer to roll up, the box will cut out even if it's not up yet
          If you think about it, the premature cutout is due to the current level sensing in your circuit. The design current limit is set too low for this particular job. It isn't a reliability problem at all. In fact, the circuit is working very reliably. Since it is already built, all you have to do is find out how the current sense/current limit is set and change the part values a little. You would be doing the same thing starting from scratch.

          Here is an interesting article on start and stall dc motor current. As you can see, the stall current is actually greater than the maximum start current. The stall current is steady state, whilst the start current is a short pulse (depends upon the load).



          Your particular application is relatively simple because you don't care too much about speed. The load is fairly constant and the duty cycle of each event is short. The automatic closing circuit always runs the motor in the same direction (to close the window). So you don't need a fancy H-bridge, just a relay or a single control FET.
          Attached Files
          Last edited by Longbow; 06-24-2017, 08:43 AM.
          Is it plugged in?

          Comment


            #25
            Re: Non inverting Schmitt Trigger question

            Originally posted by Longbow View Post
            If you think about it, the premature cutout is due to the current level sensing in your circuit. The design current limit is set too low for this particular job. It isn't a reliability problem at all. In fact, the circuit is working very reliably. Since it is already built, all you have to do is find out how the current sense/current limit is set and change the part values a little. You would be doing the same thing starting from scratch.

            Here is an interesting article on start and stall dc motor current. As you can see, the stall current is actually greater than the maximum start current. The stall current is steady state, whilst the start current is a short pulse (depends upon the load).



            Your particular application is relatively simple because you don't care too much about speed. The load is fairly constant and the duty cycle of each event is short. The automatic closing circuit always runs the motor in the same direction (to close the window). So you don't need a fancy H-bridge, just a relay or a single control FET.
            While that's exactly what I WANT this circuit to do, I doubt the aftermarket box I currently have installed has such a current sensing feature. The box does have a potentiometer on its side, but it's only for setting the maximum roll-up time allowed (from around 5s to 20s I THINK). I can confirm this, because if I sit in the car and lock it, I can hear the relay for each window closing inside this box and staying closed for the same amount of time, regardless of what the window is doing. What I want it to do is close the relay for around 1s, sending 12v into the motor, sense that the motor is stalled (all the way up) then stop and then move on to the next window. Well, the box does this, but based on a timer, not on current drawn.....hope it's not too confusing. Also, yes, I know the H-bridge is overkill and a simple relay would suffice, but like I said: if I also build that "latch" feature, it would just be a matter of sending the "lock" signal the H-bridge in "up" mode.....the window starts going up and does its thing and when it's closed (assuming it was down in the first place), the H-bridge resets to its off state and stops.
            Wattevah...

            Comment


              #26
              Re: Non inverting Schmitt Trigger question

              Oh btw: any "good" H-bridge MOSFET driver recommendations ? Preferably easily available, aka "common" and easy to find.....let's disregard the price for now.
              Wattevah...

              Comment


                #27
                Re: Non inverting Schmitt Trigger question

                Quick update: admitting I go with the simplest P-N channel MOSFET H-bridge, would THIS schematic be good for the purpose ? Don't mind the FETs themselves, they will be different and suitably sized to handle the rush and stall currents of the windows - it's the drive I'm interested in, namely those 2 BC547 transistors. In my setup, since I will not have 4 individually addressable output pins, just a 12v and GND pin, I'm thinking of tying A and D together and B and C together. That way, when AD goes HIGH, the bottom left FET will turn on (since it's N channel) and the NPN on the right will pull the gate of the top-right FET to GND, also causing it to turn on. We've now got current flowing "top-to-bottom" and the motor turns in one direction. To make it go the other way, BC goes high and the mirror image of what I previously said applies. To stop it, all inputs go to GND. Would this circuit work for our purpose ? One thing that's vitally important is very low stand-by power consumption (since absolute zero idle current is obviously not possible), because this thing will be in a car, meaning battery power....the car might not get started for as much as a week to charge the battery, so I wouldn't want to come back to it one morning only to discover the battery is flat and I have to push the damn thing I have a separate car battery I'll use to run extensive tests on the bench before even daring to bring it near the car, so we don't have to worry about that just yet.
                Wattevah...

                Comment


                  #28
                  Re: Non inverting Schmitt Trigger question

                  You need to consider dead-time in H-Bridge also.
                  Last edited by budm; 06-27-2017, 08:56 AM.
                  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


                    #29
                    Re: Non inverting Schmitt Trigger question

                    Originally posted by budm View Post
                    You need to consider dead-time in H-Bridge also.
                    I suppose you're referring to the time it takes for the bridge to switch from 1 pair of FETs to the other and make sure they don't "shoot-through" as it's called. In my case, I will still be using the rocker switches, so (I think) there will be a pretty big delay between AD closing and then BC closing - impossible to power BOTH pairs at once if that's what you mean.
                    Wattevah...

                    Comment


                      #30
                      Re: Non inverting Schmitt Trigger question

                      When you turn off the FET they do not turn off right away due to GATE capacitance of the MOSFET, you will need to the scope circuit to look at the switching action.
                      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


                        #31
                        Re: Non inverting Schmitt Trigger question

                        Originally posted by budm View Post
                        When you turn off the FET they do not turn off right away due to GATE capacitance of the MOSFET, you will need to the scope circuit to look at the switching action.
                        I don't have a scope sadly, but I understand what you mean. I read somewhere that to overcome the issue of gate capacitance, a NPN+PNP driver can be used, where the gate is driven by BOTH of these, so when one turns on, the other goes off and "discharges" the gate...I just read this today in fact
                        Wattevah...

                        Comment


                          #32
                          Re: Non inverting Schmitt Trigger question

                          BTW, does it matter what op amp I use for the amplifier stage after the current sense resistor ? I mean of course it matters, but I'm planning to build this thing with parts found in my junk drawer as much as possible
                          Wattevah...

                          Comment


                            #33
                            Re: Non inverting Schmitt Trigger question

                            At this point, a block diagram of your design is needed. Obviously, the timer approach to window closure is not the one you want. I am unclear on whether you have discarded the car's stock circuit completely? In that case, control of both directions is needed so an H-bridge will do the job. It isn't necessary to re-invent the circuitry for this motor control application since dozens of IC's exist that will do what you want. Bi-directional control of a d.c. motor is a standard industry application so you won't be needing much more than a few peripheral parts. I'm sure that some of the chips have a current sense feature, so all you need is a measurement of motor run and motor stall current to make the chip work with your window motor. Scrap the timer.
                            Is it plugged in?

                            Comment


                              #34
                              Re: Non inverting Schmitt Trigger question

                              Originally posted by Longbow View Post
                              At this point, a block diagram of your design is needed. Obviously, the timer approach to window closure is not the one you want. I am unclear on whether you have discarded the car's stock circuit completely? In that case, control of both directions is needed so an H-bridge will do the job. It isn't necessary to re-invent the circuitry for this motor control application since dozens of IC's exist that will do what you want. Bi-directional control of a d.c. motor is a standard industry application so you won't be needing much more than a few peripheral parts. I'm sure that some of the chips have a current sense feature, so all you need is a measurement of motor run and motor stall current to make the chip work with your window motor. Scrap the timer.
                              Yes, a diagram will be coming soon - it's getting too complex to follow, I admit. Like I said, I shall replace the box I currently have installed (the one with the timer) and create it from scratch. The car's circuit has not been altered: it consists of just those rocker switches and that's it - no other active components. When I bought the gadget I currently have installed, all I had to do was break the wire that went to the window motor and splice that through the box, so the box could connect it to 12v when it got a signal from the key fob. Now I'll retain that idea, but incorporate a stop feature based on current rather than on time. For controlling direction I think I'll go with a good old fashioned DPDT relay.
                              Wattevah...

                              Comment


                                #35
                                Re: Non inverting Schmitt Trigger question (+circuit)

                                Here is the (still crude schematic) of the current sensing circuit I envision. You can simulate it here. Just go to "file", select "import from local file" and load the TXT file I provided (let me know if it works). Now please bare with me as I'm sure it lacks a lot of things and there are probably many others wrong with it and my idea (no filter caps anywhere for example - I know), but that's precisely the point: to polish it and make it work

                                This is just the current sense part - I'm still working on the latch and stop circuits which will turn on the circuit when the car is locked, latch it on (since the lock signal is only present for a brief moment) for as long as necessary and then stop it once the window is closed.

                                I'll walk you through: in lack of a proper motor piece, I simulated it using a potentiometer on the left: as the motor halts, it will draw more and more current, which can be simulated with that pot....FAR from ideal, but it got the job done in the simulator. The current shunt resistor is a 0.05 Ohm (50 mOhm) resistor, which I imagine is STILL too high for a motor that draws as much as 20-25A when locked, but I chose it because I'm planning to test this out on the bench and the only thing I have handy are some 100 mOhm resistors which I'm going to parallel to drop to 50 mOhms and see if I at least get a reading with that drill motor I told you about.

                                Anyway, regardless of what this resistor is going to be, its output will be far too low to drive anything, so it MUST go through the non-inverting op-amp amplifier represented by U1. Here's where the math starts: I've also included that excel calculator with the actual values used in the simulation. The numbers (and Dave from EEV ) tell me that amp has a gain of 11 in this configuration...which it does: 0.1v in results in 1.1v out (the graphs at the bottom of the simulator also show this pretty well: if you move the pot around, as the "load" increases, so does the output of U1).

                                The output then goes to the main event: the schmitt trigger represented by U2. After MANY hours spent calculating and researching, I put together the excel calculator to simplify my work and played around with the values to get them as round as possible and used them in the simulator. It works to a degree, but the upper threshold is off: the numbers tell me it should be 2.2v, however I need to crank much higher than that (to around 3v) to get U2 to trip over. The lower threshold works fine though: when current drops enough, the non inverting input of U2 also drops down and when it reaches around 1v, U2 turns off like it should. It could be a simulation error though...let me know what you think and by all means feel free to play around with it and post it back Cheers
                                Attached Files
                                Wattevah...

                                Comment


                                  #36
                                  Re: Non inverting Schmitt Trigger question

                                  http://www.analog.com/en/analog-dial...mic-range.html
                                  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


                                    #37
                                    Re: Non inverting Schmitt Trigger question

                                    So you're suggesting I should go with high-side current sensing rather than low side ? Math ahoy !
                                    Wattevah...

                                    Comment


                                      #38
                                      Re: Non inverting Schmitt Trigger question

                                      You also get common mode rejection too. Car is noisy environment for electronics.
                                      Last edited by budm; 06-30-2017, 12:01 AM.
                                      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


                                        #39
                                        Re: Non inverting Schmitt Trigger question

                                        How's this sound ? Seems I'd be better off with an off-the-shelf solution.
                                        Wattevah...

                                        Comment


                                          #40
                                          Re: Non inverting Schmitt Trigger question

                                          This might be a stupid question, but I don't understand in the article budm provided why the negative supply rail (VSS let's call it) of the op-amp is not connected to GND, but instead to the zener diode and resistor. I know how that zener operates - it regulates to 5.1v and the resistor prevents too much current from flowing and burning the zener (though I would've placed the resistor at the cathode, correct me if I'm wrong). Now let's If I have 12v as "Bus voltage" and the zener is 5.1v as the article says, what would the supply for the op-amp be ? 7v ? The article DOES explain the purpose of the zener further down, but it throws some pretty fancy terms around, mainly common-mode voltage which I can't possibly grasp for some reason Other than that, it's just "simple" math
                                          Wattevah...

                                          Comment

                                          Working...
                                          X