Oscillating DC motor driver help needed - Page 1
Forum section: electronics / beginners

author: Richb77
author_rank: Contributor
timestamp: September 12, 2022, 01:13:49 pm
content: Hi all.A little background about me to explain my level of stupidity in order to help you with your answers.I am a Mechanical Engineer (Booooos from the back!) that in another life about 15 years ago actually worked as a (VERY specialised) circuit and PCB designer for the worlds top capacitive sensing company. So I know a capacitor from a resistor. I know an inductor from a...varistor...etc.I am working on a personal project and have reached an impasse with either my knowledge or terminology.I am making a cleaning machine with a "basket" that will be submerged into a solution and rotated back and forth 360 degrees one way (give or take) then the other. To do this I want a simple DC motor to reverse polarity...Or is there a better way??? Not OTT though. I would rather control this through passives than a microprocessor, Arduino etc if possible. I do plan on a gearbox reduction (mechanical) but if an MPU is the only way to go then i could junk the box and go with PWM and polarity reversal.How can I get a DC motor (6v) to do this without me manually switching polarity every femtosecond? (in all honesty it will only be running about 50(ish) rpm but could you imagine 20 minutes of switching!).I looked up oscillating motor driver and it teaches me how to oscillate the frequency of the motor in Hz which is not what I am after. Maybe my terminology is wrong?Any help would be greatly appreciated as I no longer work with Electrical Engineers (which I sorely miss) to pester with thisThank you ladies and gentlemen, thank you for listening to my babble

author: Ian.M
author_rank: Super Contributor
timestamp: September 12, 2022, 02:09:37 pm
content: You need to automate switching the motor polarity, or you need a reversing gearbox and need to automate toggling its direction control. To do this mechanically or mechano-electrically, you are looking at a considerable amount of mechanical complexity, and poor reliability due to frequent switching of electrical contacts + fluid contamination, or high stress on the gearbox due to frequent reversing.Therefore as you have already surmised electronic switching using a H-bridge is the only sensible way to tackle this. The problem then becomes what controls the H-bridge. It needs a direction control signal that toggles either at a suitable frequency or at suitable shaft angles, which could be as simple as a 555 timer toggling a flipflop or limit sensors that set and reset a flipflop. However using a cheap MCU lets you PWM the motor for controlled acceleration during reversal, reducing the stress on it, and may well let you eliminate the gearbox.

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 12, 2022, 04:34:31 pm
content: Quote from: Richb77 on September 12, 2022, 01:13:49 pmfrom what i understand, as ian said, h-bridge is what you are looking for. if you want to save time, attached is my circuit start developed 7 years ago from original circuit using BJTs, now i'm using mosfets. TMU and TMD is controlled from 5V arduino/mcu to make motor forward or reversed, both cannot be ON (HI) at any same time, otherwise magic smoke. Vcc can be whatever your bjt and mosfet and motor can support, anything 5-24V is typical. you should know gearbox is usefull to increase torque and reduce speed vice versa, even if you want to implement soft/ee PWM (reduced speed, but also very much reduced torque)... or if you want to save even more time, just buy it$5 Arduino UNO L298NH 2A H-Bridge Two Way DC Motor Driver Shield Modulewhat took you so long gen77s? it took me ~9 years from graduation to work and marriage until stable income to buy my first oscilloscope and then i'm here, ~12 years already, time passes too fast.being a bit of different culture, Booooos is my food around here. cheers.

author: james_s
author_rank: Super Contributor
timestamp: September 12, 2022, 05:01:34 pm
content: An H-bridge or a DPDT relay will do this. A classic approach would be to use a pair of microswitches to sense end of travel in each direction and use those to control the coils in a latching relay then take the output of the latching relay and use that to control the DPDT relay controlling the motor direction. The same thing can be accomplished electronically by using transistors in an H-bridge controlled by a flip flop. For the electronic approach you could use microswitches, optical sensors, magnetic Hall sensors, a mercury tilt switch or any number of other methods to detect end of travel.

author: Richb77
author_rank: Contributor
timestamp: September 14, 2022, 10:46:32 am
content: Thanks for all the input fellas. Its given me some ideas...One of which is that maybe this would be easier with a stepper motor? Speed is not high and a driver could count the steps and then reverse...surely?But that option also opens up a whole can of "i have never programmed a stepper...but it cant be that hard".

author: james_s
author_rank: Super Contributor
timestamp: September 14, 2022, 04:56:59 pm
content: A stepper motor would work, but I'm not sure it would offer any advantages. You'd still need at least one end of travel sensor because stepper motors are open loop devices and they will miss steps if driven too fast or mechanically overloaded. Driving them is easy, typically you'd use a microcontroller and either transistors or a dedicated driver IC. Total system complexity would be similar, perhaps a bit higher for the stepper, but you'd have some advantages such as no brushes to wear out, finer control over position, and no need for gearing to reduce the speed. Stepper motors are typically used where you need fairly precise positioning over a range whereas your application sounds like you only need to oscillate back and forth between two extremes.Let's not forget the mechanical approach either, you can achieve an oscillating motion by using a crank on the shaft of a gear motor connected to a larger crank on the thing you want to move. A car windshield wiper mechanism is a common example of this and in fact perhaps you could just use a salvage yard wiper motor from a small car.

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 14, 2022, 11:26:50 pm
content: stepper motor is suitable if you need precise motion and the load is guaranteed not to cause miss steps in the motor. its jerky and noisy, and at high speed, its torque is compromized. depending on your application, if all you need is move 360 degree and back, a limit/position switch maybe a simple solution to open loop dc motor.

author: james_s
author_rank: Super Contributor
timestamp: September 15, 2022, 12:38:32 am
content: You might even find a latching relay with DPDT contacts capable of carrying the full motor current. Then all you need is that one relay and a couple of microswitches and the mechanical bits to link it all together.

author: themadhippy
author_rank: Super Contributor
timestamp: September 15, 2022, 01:09:33 am
content: QuoteDoes it have to be DC? you can get syncronise motors that rotate in a random direction,add a mechanical stop and the motor will reverse without any fancy electronics.Its a pretty common method used in disco lights like moonflowers and pin spot scanners

author: Whales
author_rank: Super Contributor
timestamp: September 15, 2022, 01:43:07 am
content: How much current does you 6V brushed DC motor draw during operation with weight loaded in the basket and under fluid? You can buy H bridges off the shelf that might do what you want. If you build your own H-bridge from mosfets then be wary of the difficulty of driving the high-side mosfets (there are a few options to make this easier, depending on your power supplies).I assume you're already ontop of gearing.Endstops: might be worth putting a rotating shape further up the shaft near the motor (rather than down low near the baskets) so you avoid your fluids. Optical or magnetic switches are also an option, depending on how dirty the environment is and how many cycles you need it to last.

author: james_s
author_rank: Super Contributor
timestamp: September 15, 2022, 06:38:42 am
content: Quote from: themadhippy on September 15, 2022, 01:09:33 amThat's an elegant idea. You can get salvage motors like that from old microwave ovens, they're used for the turntables.

author: Circlotron
author_rank: Super Contributor
timestamp: September 15, 2022, 06:53:03 am
content: I'd try a car wiper motor. It already has a reduction gearbox and an arm on the output shaft that could be used to make a back and forth rotation like the wipers. Granted you won't get 360 deg but it might be enough for the purpose at hand.

author: mikerj
author_rank: Super Contributor
timestamp: September 15, 2022, 07:15:37 am
content: Quote from: Circlotron on September 15, 2022, 06:53:03 amYou could use the crank to oscillate a larger gear and couple that to a small gear to get whatever angle you need within reason.

author: Circlotron
author_rank: Super Contributor
timestamp: September 15, 2022, 12:51:31 pm
content: Quote from: mikerj on September 15, 2022, 07:15:37 amOr perhaps a large and a small pulley with a toothed timing belt. That way you can have the two pulleys separated by whatever distance necessary. Gears would work well of course, but spacing would be fixed for a given size pair of gears.

author: Richb77
author_rank: Contributor
timestamp: September 23, 2022, 02:50:49 pm
content: I thought I would share the mechanics of this project. It may help clarify my wordsIt should be self explanatory. Scale can be taken from the 130 size motor (its small) diameter is 70mm/2.7 inches

author: james_s
author_rank: Super Contributor
timestamp: September 23, 2022, 04:36:39 pm
content: Oh that's a tiny thing. My suggestion would be either a rotating brush that passes over contacts on the PCB to trigger the coils of a latching relay, a moving magnet passing by surface mount Hall sensors. You might be able to squeeze some small microswitches under there too.

author: Whales
author_rank: Super Contributor
timestamp: September 24, 2022, 04:09:16 am
content: Is there any gearing? If that impeller is going in a fluid then that 130 series motor will not be able to drive it without some gearing down.Unfortunately Mabuchi doesn't make their datasheets public, but if you search the web for "Mabuchi_Motors_Complete.pdf" you might find a document with a reasonable selection on them. Search this doc for "-130" for some examples of what sorts of specs to expect.Fun fact: most 130 motors are less than 50% efficient at peak efficiencyAlso they tend to be designed to run around the 1W output level for continuous operation (ie only a few watts input). You can get better ones, but if you're working with unbranded or unspecced then you can't assume much.

author: Whales
author_rank: Super Contributor
timestamp: September 24, 2022, 04:10:29 am
content: Whilst I'm here: 18650 cells might be an easier option to consider instead of lipo pouches. They're standardised, field replaceable and most of all can be bought with "protection circuits" hidden on the end to prevent accidental shorts & overdischarge.Hope your project goes wellAlways expect the first prototype/design to be a disasterbut a useful one that tells you what you need to change.

author: Richb77
author_rank: Contributor
timestamp: September 26, 2022, 09:19:56 am
content: Good call on the 130 motor. I may have to rethink that one...or certainly look at a gearbox. I did some rough testing with an old Mabuchi 130 (From a Tamiya mini 4x4 model) and it did move my basket in water...But the strain could be telling on the motor in short time and may put unnecessary current draw on the battery. I will investigate further.As for the 18650. That was my first thought. But compared to the rest of the build its massive. I like the idea of standardised size so am exploring possibly a smaller standard cell...14500 for example. But size could still be an issue...although twice the capacity of my initial LiPo.Can anyone help me with a schematic for this circuit???A friend found it and it will do what i want but again...Its not fitting in my design (bear in mind i want compact and want to share a nice finished product with the world so other can build their own at some point). Any help would be great as my schematic design skills are not enough for reverse engineering like this.Thanks for all the comments and help so far chaps. Your a great forum of people!

author: Richb77
author_rank: Contributor
timestamp: September 26, 2022, 09:21:29 am
content: I should add...If we/someone can reverse engineer this schematic, i plan to buy at least one board and remove the components and position them onto my custom PCB.

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 26, 2022, 10:18:47 am
content: the schematics is already there shown in the drawing, thats the "me manually switching polarity every femtosecond" circuit.

author: Richb77
author_rank: Contributor
timestamp: September 26, 2022, 11:23:18 am
content: The schematics not complete as the control centre is a bit vagueHad a feeling it wasnt auto switching but wasnt 100% sure.

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 26, 2022, 01:00:29 pm
content: its probably mcu with some intelligence (programming) in it, my guestimate is just turning on LED and change relay direction when the push button is pressed. another possibility is analog timer/comparator/logic circuit, but looking at the simplicity of the circuit, its very unlikely. so.. learning either programming/mcu or electronic circuit is inevitable..

author: Richb77
author_rank: Contributor
timestamp: September 26, 2022, 03:04:49 pm
content: Sorry for my misunderstanding and confusing matters.I understand the MCU and its programming e.t.c. and if i where to buy in a circuit and plunder its components i shouldnt have to worry about programming...But i have dabbled in that and not terrified of it...yet.What i meant was the diodes, resistor and capacitors i can see. They are in a scheme for a reason and i am not skilled enough to work out where they are linked too.I know this is a manual switch circuit and was thinking i could use a 555 to trigger a virtual switch surely???Sorry if i am being a pain in the butt. Tell me to sod off if so.

author: james_s
author_rank: Super Contributor
timestamp: September 26, 2022, 05:29:38 pm
content: That part is just basic engineering, the schematic there shows you how to wire the relay, then you'll need a transistor to control it, driven by whatever IC you choose to use and that will need power, a 3 terminal regulator of your choice will do there, and follow the datasheet.for the motor you really will want to use a gearhead motor. I had assumed there was a gear reduction box below the motor in your drawing, those small DC motors are designed to spin at thousands of RPM and will not work well essentially stalled. You can buy small motors like that with a gearbox already integrated that you can use to directly drive your circuit.Something has occurred to me, you said you wanted it to oscillate 360 degrees, but does it actually need to be 360 degrees? Or could it be approximate, ie just reverse the motor every x number of seconds and run open loop, not bothering to sense the position at all? If that will work then you can just use a 555 or a multivibrator to toggle the relay.

author: Zero999
author_rank: Super Contributor
timestamp: September 26, 2022, 09:48:12 pm
content: How about combining an H-bridge and latch into the same circuit? C1 just ensures the motor always going forward. Omit it and it will still probably always start in the same direction, depending on the hFEand speed of the transistors, which is unpredictable.

author: james_s
author_rank: Super Contributor
timestamp: September 26, 2022, 09:50:46 pm
content: You could go a little bit further and build a multivibrator into that to hand the toggling.

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 26, 2022, 11:14:11 pm
content: Quote from: Richb77 on September 26, 2022, 03:04:49 pmdiode is used to supress relay's coil kickback...https://en.wikipedia.org/wiki/Flyback_diodetransistor is used to amplify current, since mcu pin cant provide much currenthttps://www.electronics-tutorials.ws/transistor/tran_4.htmlresistor to limit current, capacitor to store some energy and smooth voltage profile. they are needed as "accesories" in voltage regulation IC (that black 3 or 4 pins IC)http://www.advanced-monolithic.com/pdf/ds1117.pdf

author: Richb77
author_rank: Contributor
timestamp: September 27, 2022, 07:54:34 am
content: Thats where i am stuck...The "basic (Electrical) engineering". I have some very specialised knowledge of electronics and the rest...Well i design mechanical parts from cell phones, servers to medical equipment.And absolutely. The rotation does not have to be 360 degrees. Anything over 180 degrees is acceptable.

author: james_s
author_rank: Super Contributor
timestamp: September 27, 2022, 05:23:03 pm
content: Well, if you want really, really simple, take that relay circuit you already found, and then add a 555 wired as an astable multivibrator, copy the circuit right off the datasheet. Add a small NPN transistor to switch the low side of the relay coil and put a diode across the coil to absorb transients and you are pretty much done.

author: Zero999
author_rank: Super Contributor
timestamp: September 27, 2022, 06:37:37 pm
content: Quote from: james_s on September 26, 2022, 09:50:46 pmIt's possible to create a self-oscillating bridge with four transistors, but they don't have enough current gain to drive such a large load, without low value timing resistors and huge capacitors. Here's an H-bridge driven from a classic two BJT astable.