Art/Noise Project. - Page 1
Forum section: electronics / beginners

author: tatagatha
author_rank: Newbie
timestamp: February 09, 2016, 02:49:28 pm
content: Hello all!I have a strange little art project I'm working on and I need some help developing a solution to my problem. Unfortunately I know just enough to hurt and confuse myself. I've built this large noisy music box:You can see it has 11 little music boxes that have 1.5 v motors with gearing. I'd like be able to use pots to smoothly speed up and slow down sets of them. I had been just putting them in sets in parallel with a pot each set was parallel to the power supply. This worked in that they would turn, but I could never get them to turn slowly. They would suddenly lurch once they got over the inertia and friction of the gear box. Also as I turned one set up, another set would slow down or even stop.My original thought was that I needed a power source where I specify the current rather than the voltage. My thought was this might solve the lurching problem. My friend told me this was not really the way to go about it. He suggested these simple drivers as part of the solution:https://www.pololu.com/product/2990.Then he went on vacation.So I'm into the idea of the drivers. So, here are the questions I'm struggling with end goal of being able to smoothly speed up from a stand still all the sets of music boxes.In general, thumbs up or thumbs down on the simple drivers being the solution.Assuming thumbs up, what's the best way to get a pwm signal from a pot? I found some suggestions of using a 555 timer.How do I separate out the power for the logic side from the power for the motors.was my idea about controlling the current crazy?Any input would be much appreciated.Marc

author: Paul Price
author_rank: Super Contributor
timestamp: February 11, 2016, 02:32:35 pm
content: Depends:(1) The controllers will definitely do what you want, but only if you can figure out how to tell them what to do, so the answer is determined by your skill and experience with motors and your knowledge about programming a MCU and certainly about working with electronics in general. You will have to gain the knowledge to generate and control the driver signals needed to achieve starting and running conditions, setting speed and detecting motor stalling.You could probably get by with a very cheap single darlington transistor circuit driving the motors, since you can only run the music-maker motors in one direction. You can control the darlington transistor with a PWM signal from a MCU or else with a 555 timer.(2) With all plans of mice and men, the best way is not always the smallest, least complicated, easiest to figure out, or the cheapest, or even using the easiest parts to find, but a MCU or a 555 timer each would do the job in descending order of circuit complexity and overall control capability. See my posting below for a 555 driving a Power MOSFET solution that is more efficient.(3)By using separate wires.(4)No, it would work, but your approach to controlling average current would be best achieved by limiting the time of duration of a fixed voltage applied to a motor. Make pulses(PWM) and pulses will average the voltage which will determine the amount of current and the power pushed into the motor.

author: TimFox
author_rank: Super Contributor
timestamp: February 11, 2016, 02:39:57 pm
content: Hint: in general, DC motors are controlled with voltage to vary speed directly. With servo drive, they are often driven with current taking feedback from a speed sensor, but simple speed control (like in traditional subway or trolley DC motors) is done by changing the voltage.

author: Paul Price
author_rank: Super Contributor
timestamp: February 11, 2016, 03:01:28 pm
content: Brush Motor Control Circuit

author: alsetalokin4017
author_rank: Super Contributor
timestamp: February 11, 2016, 04:19:18 pm
content: This ^ .(By a curious coincidence I have that exact circuit on a breadboard right now...)(And I love the IRF3205 mosfet for low-power applications. It has amazingly low Rds and actually works well with only 5 v on the gate at low frequencies, so it's almost a logic-level device. Let's hope the ones from the Chinese seller are genuine! )

author: Audioguru
author_rank: Super Contributor
timestamp: February 11, 2016, 04:50:11 pm
content: Why buy fake Chinese parts?

author: Paul Price
author_rank: Super Contributor
timestamp: February 11, 2016, 04:57:49 pm
content: There is no reason to think that the parts offered by this vendor (with a very high positive Ebay rating with >3200 sales and 99.5% satisfied customers) are fake, and in the case of any problems, your purchases would be refunded by Ebay. Apparently 28 of these packs of MOSFETs have been sold.There are several other Ebay vendors selling the same part at even better prices, another vendor has sold 597 lots of 10 of these parts with 99.7% satisfied customers. Seems no one is complaining.In any case the parts for this project are to be used to make music maker motors run, not used to run motors on a medical monitor.

author: tatagatha
author_rank: Newbie
timestamp: February 12, 2016, 05:50:28 pm
content: Thanks for all the great feedback.1&2) The simple switching mosfet based driver looks to be a good cheap alternative to the h-bridge based drivers I found on polulu since I don't need to go in two directions(although the music box can actually work in both and since this is a noise project, maybe the cacophony of backwards would be a nice addition) . That diode across the motor is for flyback voltage protection? I'll definitely consider this option.I'm interested in not using a MCU for this project. Seems overkill. I've looked at a couple different 555 PWM circuits and I like this one. I don't remember seeing the pair of diodes on the pot and don't quite understand what they are doing (D1&D2). Regardless of using the darlington, or the hbridge break outs from polulu, I'll probably use this PWM generator.3) separating power. My question was based on using the driver found on polulu. The logic side of the chip takes 0-7v the power side is separate and takes 0-11. I've never had two different voltages in a project. I was trying to figure out the best way to limit the voltage to the logic side to something under 7 volts.4) Gotcha.

author: Audioguru
author_rank: Super Contributor
timestamp: February 12, 2016, 06:02:27 pm
content: The high voltage pulses from the circuits might destroy the low voltage motors. You need a circuit that supplies low voltage pulses to the motors.

author: Paul Price
author_rank: Super Contributor
timestamp: February 12, 2016, 07:25:12 pm
content: A single MOSFET - 555 timer circuit could easily drive all 11 music box motors at once.Depending on the current capability of your 12V power supply, the max PWM duty cycle (almost 100% full power) applied to a single motor will cause it to run at a speed that will amaze you until you see smoke arising from the motors.Contrary to the previous poster's warning, the 12V power supply of the MOSFET -555 circuit is not in itself a problem for PWM operation, the motors will likely have no problems at low duty cycles. If you like, the circuit as shown will almost work just as well down to about 6-Volts, and still at a high efficiency.The purpose of the two diodes is to alternatively allow the pot to control the ontime and offtime of the duty cycle. The pot effectively becomes two changeable in value resistors with a common connection(the center pin of the pot). It might be prudent to insert a rheostat/resistor in series with the pot pin(connects to D2) that determines ontime(the time when power is applied) of the duty cycle to limit the motor power to prevent over-driving the motors under any pot shaft setting. Otherwise, it is only necessary to be aware and not set the speed to high. A short overdrive condition will not likely damage your little motors.The advantage of using a MCU for the project is manifold. You will face the problem of starting the motors and find that this requires a duty cycle setting(a higher power) to be applied to the motor than what is desired after the motor starts turning(After start, the motor may be running too fast), and so a MCU has easily could orchestrate this motorized musical circus into starting, running and speed-up phases. Since some most MCU's provide at least two separate PWM circuits, and some even allow even up to 8 PWM's, it would allow a lot of different musical variety and competition between music box elements with possibilities that would only be limited by your programming creativity and the number of hours you could afford to spend playing with your music control code.In the case of the modular approach for control, A 3-pin voltage regulator like the LM78L05 allow the use of a 11V power supply for the motors and the regulator would use the 11V to supply 5V for the logic circuits.Because of the way the motors turn a cam that has an angled leading edge to actuate the tuning fork strips making tones, any attempt of running in reverse would likely cause the cam to jam, but you must check this out for yourself. The way the tuning fork strips are suddenly released by the slipping of the cam off a strip with reversed motor direction will change the volume and character of the tone or cause a tuning fork strip to bounce off the edge of the cam and quench the sound.

author: tatagatha
author_rank: Newbie
timestamp: February 13, 2016, 07:47:28 pm
content: Lower voltage full duty cycle vs high voltage safe-gaurded duty cycle: I'm not sure how to evaluate these two options. My gut goes with Paul that as long as I don't full high cycle the motors, using a higher voltage will be fine. I do not want to release the magic smoke from any of my motors or any other circuits for that matter. Once the smoke gets out, they no longer work well.MCU: I had eventually thought an MCU would be nice, with individually controllable motors but for the first iteration I was thinking that 3 sets of boxes at different speeds might be enough to make the interaction interesting. You call out the problem I already have, which is the sudden lurching to high speeds of the motors as the motor overcame the resistance in the gearing. I have an Arduino sitting doing nothing. maybe I should just use it. If I was going to use the MCU to deliver PWM, and have that PWM be aware of starting, vs running, vs speeding up. what approaches should I look into getting that state information back to the MCU? can this be detected by the current being drawn by the motor? Would I look to actually watch the spinning of the motor.. optocoupler?Parallel vs series : I have the motors in groups. Currently they are all in parallel. I had rationalized that decision, but I made it a while ago and now feels sort of arbitrary. Is this something worth re-evaluating? Its very possible that a lot of my woes are related to just how i wired this up the first time and maybe the quality of power supply.Running them backwards: They do make an interesting plinking sound as the tines hit the cams, just as you expected. But it seems quite stressful on the mechanism, which are old. I don't think it is worth it for me.I really appreciate all your feedback. It has been very illuminating. Thank you.

author: Paul Price
author_rank: Super Contributor
timestamp: February 14, 2016, 02:41:37 am
content: Running motors in series would likely unleash demons you've wouldn't want ever to invoke. Running these motors in series might be as practical as stacking multiple musicians vertically upon their laps in your orchestra.No motor feedback is needed, except from you to your MCU code after direct observation of your orchestra of individual musical motor members.Within a few seconds of operation, you will know the various how muches of power you will need to motivate your music works.By empirical observation, you could quickly determine a min. duty cycle that a MCU must apply to get the music box motors to begin to rotate. Once you know that DCyc, you can make that value fixed, so no feedback is necessary.After motor starting, you could also empirically determine the minimum fallback DCyc that would enable a max. num of cams to successfully strike a chord without stalling. This would be your second constant.You must also find a DCyc limit that would allow cacophony to increase safely in tempo without motor overheating, this is your third constant, the speed limit. To determine this you would only need your digital thermometer(your finger.)Then, with a MCU, this leaves you a lot of play between the stop, start and speed limit to Mozart each of your motors and allows you to be the magnificent Maestro of this magically motorized orchestra.

author: tatagatha
author_rank: Newbie
timestamp: August 28, 2016, 03:54:26 pm
content: I know everyone is dying to know what happened to the project. Like many things. It stalled and started for a bit, but i finally got around to working on it again.I've taken Paul's advice to heart and decided that why not just use this arduino that I have doing nothing right now. So I ordered some mosfets and started writing some code again for handling the translation between some analog pot read and a pwm out. This code encapsulates the minimum pwm out and some other ramping features including a little pumping action when the speed is slow and then suddenly the there is a large chord to play an the motor stalls. This pump increases the signal every 5/n times. I haven't figured our the right n. First I tested this with just an LED to represent the pwm. Cool, it fades and lights.Mosfet: I purchased a set of IRF3205 (as listed in paul's 555 pwm controller) from ebay and we excited to hear some noise. While setting up my first single motor trial, I put the PWM to the gate. hooked up the drain and source through my motor, added the diode and cap.... then nothing. Check all the wires. Still nothing. Maybe they are junk chips, try another one. No. Maybe you've forgotten how to use gate, source and drain, look it up again. Nothing. So what's wrong? As alsetalokin4017 pointed out, the IRF3205 is almost like a logic level transistor, but but apparently not for me. My Arduino's PWM couldn't drive it. So that showed me that I don't know how to look at the pertinent information on the spec sheet for transistors/MOSFET. Good lesson to learn. If I had been paying attention better I would have noticed that in Paul's little 555pwm controller everything is 12v.So, hobbled along with this P2N2222A transistor I had. I was able to do some basic tests of my code. Now I'm trying to figure out what is the appropriate transistor for this. I need something who's gate can be controlled by the Arduino's pwm and can pass ~9 maybe 12 volts through source to drain. I have not figured out how to decipher this from the spec sheets. Are these P2N2222A a good fit? I just can't tell from the sheet. Also, it is possible there is slightly different terminology used between the MOSFET and the transistor? Things like Gate vs Base. Source& Drain vs Collector & Emitter. Trying to compare the the two I was looking at left me a little disoriented.Any help picking an appropriate transistor, or help identifying a pertinent specs in the sheet to let me pick one would be much appreciated.

author: Ian.M
author_rank: Super Contributor
timestamp: August 28, 2016, 05:55:00 pm
content: First determine the stall current of your motors - if its under 500mA, the P2N2222A transistors will be good enough, otherwise you need a better solution.(To determine the stall current without burning or breaking anything, measure the DC resistance of the motor and divide the motor supply voltage by the measured resistance)Small signal bipolar transistors like the 2n2222A are usually unsuitable for this sort of application, because when starting a stalled motor, there is a high probability that the current will exceed the maximum 600mA Ic and damage the transistor. Also they tend to drop a lot of voltage when on, (up to 1V Vce_sat, depending on load current) which makes driving very low voltage motors predictably more difficult. You can get higher current transistors, typically in TO220 packages, intended to be bolted to a heatsink, (though that's not needed if you keep the power dissipation under 1W), but they tend to be significantly lower gain and an Arduino wont be able to provide enough base current. The usual answer to that is to use a Darlington pair, but the Vce_sat is a lot higher, compounding your problems controlling low voltage motors.Normally, I would say, 'Use a MOSFET driver', which would take the 5V logic level signals from your Arduino, and boost then up to the 12V levels needed to reliably drive a typical MOSFET, but then you'd need three separate supply rails, 12V for the MOSFET drivers, 5V for the ATmega328P on the Arduino (but its on-board regulator can run from 12V if you don't draw too much current from the 5V rail) and about 2V at a high current for the motors. You could get there using switching regulators (A.K.A 'Buck Converter') and nominally 3A buck converters are pretty cheap on EBAY, so you could use one for each group of two or three motors, but its a lot of complexity, and although through-hole MOSFET drivers in DIP packages are available, they pull fairly high transient currents when switching so you have to be careful about board layout and decoupling, so that approach may be a little too adventurous for a novice.Instead I suggest going 'old skool' and using the P2N2222A transistors as emitter followers, with their base driven directly by the Arduino output to boost its output current enough to drive just about any TO220 package NPN power transistors with Ic>=5A. You'd run the power transistor with its emitter grounded and stick a suitable base resistor (e.g 33R for about 100mA of base drive) between the P2N2222A emitter and the base of the power transistor. That would let the power transistor Vce_sat be as low as half a volt, maybe even 0.3V if your motors don't draw a lot of current. The fly in the ointment is the load on the 5V rail powering all the P2N222A collectors - its going to be more than is safe for the Aduino on-board regulator, so either you will need a 5V supply capable of a few amps to power both the Arduino and all the emitter followers, or you'll need to feed the emitter followers off the unregulated supply to the Arduino, with a carefully calculated dropper resistor to each to keep its power dissipation within its permitted limits at max current, while never letting the collector voltage drop below 5V.If you are feeling adventurous, go for the MOSFET drivers, otherwise go for the NPN power transistors. In either case, I strongly recommend asking here for advice on parts and showing us the proposed schematic before buying or building anything.

author: Zero999
author_rank: Super Contributor
timestamp: August 29, 2016, 09:02:16 pm
content: How much current do the motors need? Many MOSFETs will turn on at just 5V.For example the RFP30N06LEhttps://www.sparkfun.com/datasheets/Components/General/RFP30N06LE.pdfFailing that, what about using a high side PNP BJT with an NPN level shifter?

author: tatagatha
author_rank: Newbie
timestamp: September 03, 2016, 04:00:46 pm
content: Quote from: Ian.M on August 28, 2016, 05:55:00 pmWhen I measure the motor it is ~2.4 ohms so it could theoretically blow the transistor. But the stall current is if you totally prevent the motor from turning? I'm ok not designing for this mode of failure. If the motors are not turning, I have bigger problems than the transistors.Quote from: Ian.M on August 28, 2016, 05:55:00 pmI appreciate the advice although I'm not sure I totally understand it. Basically suggesting that I chain the P2N2222A to the TO220?I'm attaching a picture which may help expose the errors in my thinking. The first is a picture of the set of motors to give you an idea of the kind of motors they are. Small hobby motors. The second is schematic I sketched for a single unit within the system. It has a control side using a microcontroller to translate between a pot and the pwm I'll send to the power side. There are three of these units that run 4 motors, 4 motors, and 3 motors.So, I need help deciding on the right transistor, capacitor to use for the set(also a little unclear of it's use? smoothing? Making sure a little juice is available when needed?)I'm still unclear how much I'll want to over drive these motors. From what I could find on the internets, these are 1.5v 100mA motors on Sanyko music boxes. Closes thing I could find to specs:http://www.ebay.com/itm/Sankyo-Auto-Motor-Music-Box-DIY-Movement-Mechanism-Set-Play-Pandora-Hearts-/281658719192I'd like to experiement once I get it working so I'm hoping for a 9v power supply on the motors.Alternatively, I could give each motor their own transistor and provide the same PWM signal from the microcontroller to each. This might make more sense as it lowers the amount of current passing through the transistor.

author: Ian.M
author_rank: Super Contributor
timestamp: September 03, 2016, 04:49:13 pm
content: Quote from: tatagatha on September 03, 2016, 04:00:46 pm*Every* time you start the motor from stopped, it draws its stall current, decreasing approximately linearly to its running current as it comes up to speed.

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 03, 2016, 05:47:58 pm
content: Quote from: Paul Price on February 11, 2016, 04:57:49 pmhttps://www.google.com/search?q=ebay+transistor+counterfeit&ie=utf-8&oe=utf-8&client=firefox-bi bought counterfeit L7805 regulators, OPA2604, NE5532 opamp that i tested to be very badly under speced. i also bought from the same and few others china sellers some bjt, mosfet etc but i havent tested them to the limit. i gave +Ve feedback just the fact the items arrived. i have no way to snap together test rig to test everything to the limit in that short time. so... +ve feedback doesnt mean much... what means something is when you think you scored some good deal of price... thats why you usually hear "too good to be true" idiom... you understand it very well only when you get hit by it.edit: having said that, whenever you wonder why a china seller sells things at extraordinarily more expensive compared to others, then by that time you should know you have a little clue that the seller is somehow legitand a little clue will be to check the price from legit suppliers like digikey or element14, then you'll have a ballpark figure on what the price should be in ebay china as well...

author: tatagatha
author_rank: Newbie
timestamp: September 04, 2016, 04:02:58 pm
content: Quote from: Ian.M on September 03, 2016, 04:49:13 pmSo this small hobby motor would have a stall current of 3.75A when given a 9 v power supply?Any thoughts on the rough design/schematic?

author: Ian.M
author_rank: Super Contributor
timestamp: September 04, 2016, 04:34:37 pm
content: Attempting to run a motor at 6x overvoltage is just crazy. Although it will probably run for a short time, pretty soon it will either burn up, burst its rotor or destroy the gears.If you do try it, then yes, the stall current will be about 4A, which will destroy anything except a power transistor.If you want to run them at a higher voltage you need to take one, power it direct from your bench supply and test it to destruction first. See how long it runs at 2x overvoltage. If it runs 24H without any damage or signs of excessive wear, try 3x etc. When you find the limit, cut back from the last safe level by a third.Lowering the PWM duty cycle to maintain the nominal average voltage helps but it doesn't save you from the I2R losses or parts of the mechanism getting hammered by the torque ripple unless the PWM frequency is high enough that the motor inductance can smooth the current effectively. Due to the resistance variation with temperature and commutator wear, you'll probably need current sensing feedback if you go down this route.Without high frequency closed loop PWM, you *NEED* a high current low voltage rail for the motors. They are rated for 1.5V operation, and you are going to loose some voltage in the transistor switching circuit so it needs to be a bit more than the nominal motor voltage. You need a supply with N times the running current and S times (stall - running) current where N is the maximum number of running motors and S is the maximum number of motors that will ever start simultaneously.Personally, I'd be using bipolar power NPN power transistor as a low side driver for each motor or group of motors, with either a Darlington driver if I don't care about losses (i.e if I've got them all bolted down on mica washers on a massive extruded aluminium heatsink) or the emitter follower driver circuit I described earlier. The only reason I'd do it that way rather than MOSFETs and 12V gate drivers, is a shortage of gate driver chips in my junk box!

author: tatagatha
author_rank: Newbie
timestamp: September 06, 2016, 02:58:08 am
content: Quote from: Ian.M on September 04, 2016, 04:34:37 pmCool!Quote from: Ian.M on September 04, 2016, 04:34:37 pmThis sounds a little excessive for my personal art noise project. it's not a dialysis machine so if it blows, no one dies. I'm actually fine with this thing degrading. I know this is counter to most design goals. Also, I don't need continuous operation. I need short times of operation. Having run all of the boxes for a few minutes it produces a maddening sound that you wouldn't want running all the time. I ran one at 12 and couldn't stand it for very long.Quote from: Ian.M on September 04, 2016, 04:34:37 pmI appreciate this feedback, but I'm not sure I understand it.I think I need to get a better hold on the parameters for the transistors. I tried again to use the IRF3205s with a 12v source. I was able to get the arduino to open the gate, butit wouldn't switch with the PWM, but just stay open.

author: tatagatha
author_rank: Newbie
timestamp: September 06, 2016, 03:00:00 am
content: Quote from: Hero999 on August 29, 2016, 09:02:16 pmWould this invert the pwm?

author: Zero999
author_rank: Super Contributor
timestamp: October 04, 2016, 08:33:37 pm
content: Quote from: tatagatha on September 06, 2016, 03:00:00 amNo.