555 timer bistable mode isn't stable. Noise?  - Page 1
Forum section: electronics / beginners

author: torch
author_rank: Frequent Contributor
timestamp: March 12, 2023, 03:05:41 pm
content: EDIT:ok, this is weird, my images show in preview but not when saved. Standby...Ok, I guess the forum no longer allows remotely hosted images. I had to attach them and use the attachments. I wonder if that means all images I posted in the past are now defunct? Anyway, on with the topic at hand:Background: the high school robotics team I mentor was gifted a mini-lathe. It has a DC motor and had a variable speed control. "Off" is incorporated into the speed control POT switch, "On" is a momentary push-button. I did some tests powering the 1 amp motor with my DC bench supply in serial mode (so 62vdc max), a mosfet and an arbitrary function generator to drive it. Works well, motor seems happiest weth about a 500-600hz square wave.I figured I could make a simple PWM controller, based on a 555 timer, then upgraded that idea to use a 556, with one half as bistable mode to control the on-off and the second half to produce the PWM. I drew up the following circuit:

author: Zero999
author_rank: Super Contributor
timestamp: March 12, 2023, 03:31:15 pm
content: There's no decoupling capacitor on the VCC.What's the mains voltage? NTE7241 is only rated to 125VDC. If the mains voltage is 110VAC, the voltage on C1 & C2 will be 170VDC.The entire circuit needs to be treated with the same precautions as the mains. If the enclosure is metal it should be earthed. If potentiometer has a metal shaft, or screw thread, it should be earthed.

author: Terry Bites
author_rank: Super Contributor
timestamp: March 12, 2023, 03:34:40 pm
content: As far as I can unravel the diagram.... Threshold is set to 0V on the Bistable. This puts you down in the noise. I suggest you set the Th to a higher voltage. Add a small bypass to the Th ref voltage you set.Tip. Comparator inputs don't like working down near 0V. It usually takes you outside the CMV limits for a typical comparator. Theres nearly always junk and ripple down there, you dont want to compare your signal to it.Use a free sim package to draw neater schematics. FGS

author: torch
author_rank: Frequent Contributor
timestamp: March 12, 2023, 05:27:57 pm
content: Well I'm glad someone can see the images, because I still can't. I tried attaching them and then inserting links to the attachments inline and that didn't work either. File size and type are within allowed parameters so darned if I know what I'm doing wrong there.Quote from: Zero999 on March 12, 2023, 03:31:15 pmOk, I'll add one.QuoteYes, the peak-peak AC input will be ~170vac. But shouldn't the voltage be (2 * Vpeak)/pi after rectification? IE ~108vdc?QuoteEnclosure is plastic, as is the POT shaft. The lathe itself is earthed. I never thought of the POT threads though.Quote from: Terry Bites on March 12, 2023, 03:34:40 pmOk, so Threshold 1 to a voltage divider between Vcc and ground?QuoteWhat, you don't like my free copy of DaveCad?

author: Zero999
author_rank: Super Contributor
timestamp: March 12, 2023, 06:28:09 pm
content: Quote from: torch on March 12, 2023, 05:27:57 pmWhere did you get that formula from?The voltage on the capacitor is always equal to the peak voltage and the RMS mains voltage is specified. For a sinewave, the peak voltage is VRMS√2, so if you've got 120VAC, (110V in my previous post was a typo) you'll have 120√2 = 120*1.414 = 170V on the capacitor, which will blow up the NTE7241. The NTE7241 is a floating regulator, it's the input-output voltage which matters, so you could use two: one set to 80V and the other set to 12V. Don't use a potentiometer to set the voltage. Calculate the correct resistance value and use a fixed resistor, that way there's nothing to adjust and there's nothing to blow up, if it's set incorrectly.QuoteTo be honest, I didn't analyse the circuit in detail. I just spotted the most obvious issues. Drawing it as separate 555 timer circuits would make it easier to understand.

author: floobydust
author_rank: Super Contributor
timestamp: March 12, 2023, 06:29:39 pm
content: Caution theNTE7241(TL783) has a relatively high minimum load spec of 15mA, which I add an extra load resistor and of course there is a lot more heat. You could find a mains SMPS that runs at 90VDC input, or use a big zener to drop the 90V down.The MOSFET appears not protected from the motor's back-EMF, I think diode D1 is in the wrong place unless it's a TVS. It should go across the board's (motor) output terminals (before polarity switch).

author: Zero999
author_rank: Super Contributor
timestamp: March 12, 2023, 07:49:37 pm
content: I missed that the diode is in the wrong place.S3 also must not be operated, whilst the motor is still turning, as it will probably destroy the gearbox, as well as blow up the MOSFET. If you can't rely on the user not do this, a more complex design with current and/or back-EMF sensing is required to monitor the motor's speed and torque.

author: Terry Bites
author_rank: Super Contributor
timestamp: March 12, 2023, 08:57:02 pm
content: That's not Davecad thats Kakasketch 94.Yes, set your th to a volt or so.

author: torch
author_rank: Frequent Contributor
timestamp: March 12, 2023, 10:01:04 pm
content: Quote from: Zero999 on March 12, 2023, 06:28:09 pmThe internet. The internet would never lie to me, I'll prove it:I hooked up the bridge rectifier to my variable transformer and connected the two 2200uF caps across the output, and then on to the lathe motor. I metered the AC input, the DC output and the AC current input. Just for good measure, I watched the spindle rpm with a laser tach too.I slowly brought the AC voltage up to 120, the current climbed to 1.1A, rpm to 2250, and the DC voltage was <drum roll please>: 154vdc -- wait, what? Unloaded it was 164vdc. Dammit, the internet lied to me! Again!QuoteYeah, I guess that's a better plan...Thanks.

author: floobydust
author_rank: Super Contributor
timestamp: March 12, 2023, 10:46:19 pm
content: Your multimeter could be reading inaccurately if it is not true RMS.Uh you can't connect your scope to this circuit if it's powered from mains. Scope ground is PE and the circuit (-) is not the same, you'll short out the bridge rectifier. You need to use an isolation transformer.C1 and C2 are huge at 2x 2,200uF 200V from rectified mains, that will have a massive inrush current and no way that fuse or the rectifier diodes will hold.I think you would need a soft-start circuit, at least aNTC thermistorfor pre-charge. Oh yeah, bleeder resistor too because those caps can bite if they ever stay charged and you go in.

author: torch
author_rank: Frequent Contributor
timestamp: March 13, 2023, 12:18:59 am
content: Quote from: floobydust on March 12, 2023, 10:46:19 pmAhhh, but Ididconnect the scope -- I just can't connect the scope probegroundclip. I learned long ago to measure the voltage between scope ground and any place I was contemplating connecting the ground clip to. If there's more than a few mv, I use two channels and math mode. But thanks for the warning!QuoteYeah, two of those caps are probably overkill for this motor. Maybe I'll drop one and I'll look into that thermistor idea. Sounds interesting. And the bleeder resistor is a good idea too.

author: Zero999
author_rank: Super Contributor
timestamp: March 13, 2023, 10:18:25 pm
content: Quote from: Terry Bites on March 12, 2023, 03:34:40 pmI don't think that's the problem. There's nothing in the data sheet about the threshold voltage not being allowed to go to 0V. Comparators normally work fine, as long as one of the inputs is within the common mode range, which is the case with the 555.Here's a link to the internal schematic, which I've also attached, just in case the site goes down.https://www.electricaltechnology.org/wp-content/uploads/2014/12/555-Timer-Internal-Schematic-Diagram.pnghttps://www.electricaltechnology.org/2014/12/555-timer.htmlQ1 & Q2 form one Darlington pair and Q3 & Q4 another one. Q1 to Q4 all form a long tailed pair, which acts as a comparator.If Q1's base is taken below2/3of the supply voltage, it will simply turn off. It will remain off, irrespective of whether it's at 0V, or 1V.Q2's emitter is held at two diode drops below2/3of the supply voltage by Q3 and Q4, a Darlington pair emitter follower. Q1 forms a Darlington pair with Q2 and its base needs to be two diode drops above Q2's emitter to turn on.

author: torch
author_rank: Frequent Contributor
timestamp: March 14, 2023, 05:10:04 pm
content: Ok, I got some time to get back to it this morning.I added 100uF and .1uF decoupling capacitors to VCC. And another .1uF at R4 (the input to Trigger 1, the start button) just for good measure. No difference.I added a resistor divider to bring Threshold 1 up to 1vdc. No difference. I monitored the threshold voltage on the scope and it remained a steady 1v, with no spikes or variation, but the motor would still only run a few seconds after the Start button was pushed -- but will run forever with the start button held down.The source of the noise seems to be the mosfet itself. Even with no load (ie: motor disconnected from drain) there is high frequency noise on the 556 Output2 pin (ie: mosfet gate). Disconnect gate or source and the noise goes away, leaving a nice clean square wave PWM signal from Output2. I'm still not clear why that would cause things to reset.I suppose an alternative would be to forget the 556, just use a 555 to generate the PWM signal and mechanical relays for the on-off function. But a relay will add +/-30mA to the current load across the regulator. Without a relay it's running about 60°C, with a relay coil added that jumps to 90°C. And that's just running the thing off 62vdc from the bench supply. I believe heat will increase significantly when the voltage drop is 80v or so over each regulator.I've been looking at NTC thermistors. Some experimentation shows a 10ohm resistor on each leg of the bridge rectifier will limit inrush current to 2 amps. No problem finding an NTC rated 3 amps, but the maximum wattage I can find in stock (at Mouser) is 2.5W. (They also show a 4W version, but backordered). That's about 1/100 of what I figure I need (120v x 2a = 240 watts, right?) What am I missing here?

author: torch
author_rank: Frequent Contributor
timestamp: March 15, 2023, 01:34:21 am
content: A 100 ohm resistor between output and mosfet gate cleaned up the signal almost completely.But I think I'm going to abandon the 556 in favour of a 555. Powering it through an SCR brings the current down to 14mA. A resistor divider from Vcc to SCR gate and grounded through the switch on the back of the POT ensures the speed knob must be set to 0 to start, preventing a high-speed start.I'd still appreciate some advice on sizing the NTC thermistors though.

author: torch
author_rank: Frequent Contributor
timestamp: March 15, 2023, 01:50:10 pm
content: Ok, I think I've figured out the NTC varistor sizing. I'm looking at these:https://www.mouser.ca/ProductDetail/603-N10SP010MAccording to the datasheet, it is rated 3a, 2.5w, 10 ohm. But the steady-state resistance at 25°C is 0.273 ohms.So, given a steady state current of <2a, the steady-state voltage drop across the device should be 0.546v. Times 2 amps, would be a power dissipation of 1.092 watts, well within the 2.3 watt and 3a rating. Correct?

author: Zero999
author_rank: Super Contributor
timestamp: March 15, 2023, 09:19:43 pm
content: Quote from: torch on March 15, 2023, 01:34:21 amGood. I was going to suggest that, but I've been away from the forum and I'm glad you figured it out for yourself.QuoteHow about the 7556?QuotePlease post a schematic. I don't see how that's supposed to work.QuoteDo you really need one?What's the voltage rating of the motor? Does it really need smooth DC? The inertia might be enough to smooth out the torque.If the motor will work fine off an unsmoothed PSU, then add a blocking diode in series with C1 & C2, which should also be reduced to 10µF and a 1k inrush limiting resistor added, and connect the motor directly to the bridge rectifier.

author: torch
author_rank: Frequent Contributor
timestamp: March 16, 2023, 02:19:12 am
content: Quote from: Zero999 on March 15, 2023, 09:19:43 pmOk, but I warn you: it's still hand drawn. Although this time I did use a ruler to mollify the critics.QuoteI don't know for certain -- it's not listed on the motor. The lathe itself plugs into 120 and has a 2 amp fuse. Somewhere between that and the motor there should be a control board. There's a POT for speed control, a power switch and a start button that would have plugged into it.But if I connect the motor directly to a bridge, and power the bridge via a variable transformer, the lathe rpm gets pretty close to the listed maximum and the motor is drawing 1.1 amp just about the point where the variable transformer hits 120v. So I'm going with that.QuoteNot much inertia in this tiny lathe, unfortunately. I do prefer to filter out 60hz. I have used other DC lathes that use SCRs for speed control, and the 60hz becomes apparent at lower speeds. It can actually affect the finish. My own lathe PWM controller is something like 17KHz, and it runs so smooth and quiet compared to SCR controlled machines. My aim is to smooth out the 60hz as much as is reasonably possible.

author: Zero999
author_rank: Super Contributor
timestamp: March 16, 2023, 10:05:22 pm
content: That's better. It's much easier to read.The 12VDC connection on IC2 is wrong.Are you sure the 555 draws enough current to keep the SCR on? It needs to draw at least the holding current.How is the SCR supposed to turn off? Is it a GTO SCR?Why not simply connect the potentiometer switch in series with the 555 circuit to switch it off when it's not needed?You could use a microcontroller, with the potentiometer connected to an ADC pin. The power consumption would be so low, a zener diode regulator could be used.

author: torch
author_rank: Frequent Contributor
timestamp: March 16, 2023, 11:50:51 pm
content: Quote from: Zero999 on March 16, 2023, 10:05:22 pmOh geez, nice catch, thanks. I breadboarded it correctly, but I clearly drew it wrong.QuoteSeems to be working fine.QuoteNo, just a regular old SCR. It turns off when the power switch turns off. The purpose of the SCR is to prevent the lathe from spinning up at high speed unexpectedly when power is turned on. IE: the speed control must be all the way to the stop position before pressing the "Start" button, then the speed turned up to the desired setting. This will conform to the behaviour described in the operator's manual (and is pretty much the way my lathe works too).QuoteI suspect that is similar to how the original board worked. The original POT had a switch that was closed when "Off" and opened when the knob was rotated. Unfortunately, the original POT also has an intermittent connection on the rheostat. And darned if I could find a POT with a switch that opens when rotated in the Mouser website.QuoteTrue. But whether or not I could get a replacement microcontroller a few years from now is debatable. The 555 timer has been around since time immemorial. If all the manufacturers who currently crank them out ceased production tomorrow, there would still be 555s somewhere in the supply chain for decades.

author: Zero999
author_rank: Super Contributor
timestamp: March 17, 2023, 11:06:59 pm
content: There are microcontrollers which have been in production for decades and will still likely to be production for decades to come. Even if the chip you choose becomes obsolete, there'll still be a similar one in production and if you've written it in C, it will be easy to port.Why use the 555 for PWM?The LM393 can do PWM all the way from 0% to 100%. It will need another couple of transistors to drive the MOSFET.

author: BillyO
author_rank: Super Contributor
timestamp: March 18, 2023, 12:47:20 am
content: At 8:33 in this video it goes into the theory of how a 555 works in astable mode. Maybe that might give you a clue to what is going wrong.

author: torch
author_rank: Frequent Contributor
timestamp: March 18, 2023, 02:09:50 am
content: Quote from: Zero999 on March 17, 2023, 11:06:59 pmWell, one reason is I have some. So I'm familiar with the beast. The 555 is also capable of going from 0 to 100% PWM, and doesn't need additional transistors to drive the mosfet -- it can source or sink 200mA all by itself. It's reasonably robust with a wide voltage tolerance. 555 circuits are simple enough that even I can understand most of them. Meaning I can explain the circuit to the high school robotics students that are going to be using the lathe. I grant that it's not especially accurate by today's standards, but it's good enough for this application.That's not to say there are not other -- possibly better -- ways to skin the cat. Depending on your personal definition of "better", of course.

author: jonovid
author_rank: Super Contributor
timestamp: March 18, 2023, 03:30:57 am
content: for effortQuotesame here but maybe its time to look at younger through hole chips with better spec.

author: torch
author_rank: Frequent Contributor
timestamp: March 18, 2023, 01:02:14 pm
content: Quote from: jonovid on March 18, 2023, 03:30:57 amI won't argue with that -- as my brother used to say "All learning is knowledge, and therefore good". I do like to tinker and fry -- er, try -- new things. Even microcontrollers -- although in the form of Arduino Nano and ESP32 boards. It's amazing what those things can do.At least, it's amazing to me. Understand that I started off tinkering with electronics as a boy, fixing tube radios. I did delve into the shallow end of microelectronics, building a few simple transistor amplifiers and the like. (It was about that time when I picked up my copy of "555 Timer Circuits" by Forrest M. Mims III.)Then I took time off to raise a family and have a career that had nothing to do with electronics. The closest I came was installing a cassette deck in the car or wiring the kid's train set (It was for the kids, honest). Now that said kids have moved on, I have some free time, a spare room and bit of disposable income, so this old dog is trying to learn a few new tricks.But in this case, the objective was different. I just need a simple robust circuit that can provide a variable PWM current to a DC motor. The frequency is not critical. It doesn't need to talk to the drill press or the bandsaw. It's powered by the mains, so it doesn't need an idle current measured in nanoamps. I have 555 & 556 timers. I have voltage regulators and SCRs. I have 200volt 2200uF and 1uFcaps. I have bridge rectifiers. And I have that 39 year old copy of "555 Timer Circuits". Apparently it set me back $1.59 -- I wouldn't want that expense to go to waste, now would I?

author: Zero999
author_rank: Super Contributor
timestamp: March 18, 2023, 02:07:37 pm
content: Quote from: torch on March 18, 2023, 02:09:50 amIt doesn't though. It will go from near 0% to near 100% but not fully on or fully off.Why have you got the switch? I thought it was to ensure it goes all the way off.QuoteI agree those are better reasons for using a 555 timer.One thing to note: the 555 timer is not a beginner friendly IC. It draws huge current spikes from the power rails. Good supply decoupling is essential to ensure reliable operation.Regarding understanding: the circuit I posted is pretty simple. U1A is a Schmitt trigger oscillator, which generates a sawtooth waveform on C1. U1B is a comparator which compares the voltages on the potentiometer and C1.

author: torch
author_rank: Frequent Contributor
timestamp: March 19, 2023, 09:03:26 pm
content: Quote from: Zero999 on March 18, 2023, 02:07:37 pmIt is to ensure the POT is fully rotated to Off before the motor will start. Otherwise, the lathe could start spinning up as soon as the power switch is turned on. To start the motor, one must take positive action: turn on the power, ensure the POT is all the way counter-clockwise, push the Start button, then rotate the POT clockwise until it reaches the desired speed. No surprises.I don't claim authorship; that's how the manual describes the operation, so that's what i'm emulating.

author: Zero999
author_rank: Super Contributor
timestamp: March 20, 2023, 08:17:23 am
content: Quote from: torch on March 19, 2023, 09:03:26 pmI see, so the potentiometer switch is normally closed. Your schematic shows normally open. The convention is a schematic should show all switch contacts in the unpowered or default state.That makes sense. It's probably for safety purposes, but mustn't be relied upon because semiconductors such as MOSFETs and SCRs have a nasty habit of failing on.

author: torch
author_rank: Frequent Contributor
timestamp: March 20, 2023, 11:05:01 am
content: Quote from: Zero999 on March 20, 2023, 08:17:23 amI see the confusion. The OEM POT on the panel closed when fully rotated CCW and opened when rotated CW for the balance of the sweep. I was thinking of that as being NC; ie "Normal" being the inactivated state of the circuit and I assume it was wired in series with the Start button.However, it turns out that the OEM POT has a loose contact and was unusable. I could not readily find one with such a switch (I did find a manufacturer in England that listed such a switch as "Option 2" on the datasheet for their product, but couldn't find a vendor with stock).It seems every readily available POT switch is configured to be open when fully rotated CCW, and closes when rotated CW for the balance of the sweep. As might be used in, say, an audio amp Volume/Power control knob. I was thinking of that as being NO, again with "Normal" being the inactivated state of the circuit.So I am using the SCR and voltage divider to effectively invert the logic of the switch. When the POT is fully CCW, pressing the momentary ON button applies sufficient voltage to turn on the SCR gate through R8 (2.2K). Once the SCR has turned on and as long as there is sufficient holding current through the anode, and the POT switch has no effect, so the SCR will stay on allowing the motor to run as the POT is rotated.If the power is interrupted, as in the case of a power failure or operation of the power switch, with the POT anywhere except fully CCW, then the switch is closed and R6 (100 ohms) forms a voltage divider with R8 (2.2K), preventing the ON button from applying sufficient voltage to turn on the SCR gate.I agree that no power tool can be considered "safe" unless unplugged. I tell the students "Power tools are perfectly safe, until you forget how dangerous they are." (not original to me, I stole it from the internet). I demonstrate by chucking up a bit in the drill press, turn it on at a fairly low speed, then hold a paper towel to the bit and let them see just how fast the bit snatches the paper towel from my hand. After that little demo, they are quite eager to comply when I have them tuck in their necklaces or hoodie strings, tie back long hair, etc. And they understand the strict rule about never leaving the key in a chuck, even for a moment.