Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Noise in signal

Status
Not open for further replies.

no1010

New Member
Hi,

I'm building a stepper motor controller using a microcontroller and 4 transistors.

I have it wired up and I get the signal I want, but I suspect it is not turning off all the way... I get this weird noise at the bottom of the square wave.

Any ideas?

**broken link removed**
**broken link removed**
 
Are those measurements taken with the motor attached and running? Schematics and more details about the measurement setup would be helpful. The "noise" could come from the running motor. Does the frequency of the noise change with the motor speed? Anyway it must have one specific source because it is such a nice sine wave.
 
Last edited:
Sorry, I didn't think about adding it.
Sorry it is so big, had to do it on my iPhone.
R1 is 18K ohm and R2 is 180K ohm.
24V is from a bench power supply.
The motor is supposed to be connected between the collector and 24V, but when I connect it, it just freezes. I thought it was because the transistor doesn't fully turn off.
I'm measuring across the gap, positive at 24V and negative at the collector.
The motor is disconnected because when I plug it in, I get a very weird signal. (no pic unfortunately).
The four outputs have 4square waves that peak one after the other in sequence. When I connect the motor manually in this sequence it turns, but when the transistors do it, it just stalls and squeals.
I'm not exactly sure where the problem is... Been struggling with this for a week.
**broken link removed**
 
Put a resistor (~1kohm or anything not too small) in place of the motor (the gap in your picture) and see if it does any differense. And measure the signal relative to ground.

I noticed that your "noise" frequency is 50 Hz. I guess you are located somewhere in the world where the mains voltage frequency is 50 Hz and your oscilloscope probes or circuit act like antenna picking up that frequency. Or the noise comes from your 24V power source.

I think you have plenty of problems with your circuit. More complete schematics would be helpful (don't send any phone drawings of the complete schematics :)). At least something that shows how you are connecting the motor coils to the driving circuit (the four outputs).
 
Last edited:
Sorry, I didn't think about adding it.
Sorry it is so big, had to do it on my iPhone.
R1 is 18K ohm and R2 is 180K ohm.
24V is from a bench power supply.
The motor is supposed to be connected between the collector and 24V, but when I connect it, it just freezes. I thought it was because the transistor doesn't fully turn off.
I'm measuring across the gap, positive at 24V and negative at the collector.
The motor is disconnected because when I plug it in, I get a very weird signal. (no pic unfortunately).
The four outputs have 4square waves that peak one after the other in sequence. When I connect the motor manually in this sequence it turns, but when the transistors do it, it just stalls and squeals.
I'm not exactly sure where the problem is... Been struggling with this for a week.

hi,
A 18K base resistor driven from a PIC pin at say +5V, is far too high a value.
Allowing for a Vbe drop of 0.7V, the Base current is only 4.3V/18K = 240uA.

Assuming a saturation gain of 20 for the 2N2222, the collector current will approx 5mA.

When you use a transistor as a switch, you should assume a transistor gain of between 10 and 20. So if your motor required 100mA, this would mean a Base current of say 5mA to 10mA, say 5mA, this would make the base resistor 4.3/0.005 = 820R I would use a 680R.
Also Make the 180K around 22k thru 47K.

Regarding the electrical noise, you need some noise suppression across the motor, say 10nF and a 120R in series or a suppression diode.
 
Last edited:
hi,
A 18K base resistor driven from a PIC pin at say +5V, is far too high a value.
Allowing for a Vbe drop of 0.7V, the Base current is only 4.3V/18K = 240uA.

Assuming a saturation gain of 20 for the 2N2222, the collector current will approx 5mA.

When you use a transistor as a switch, you should assume a transistor gain of between 10 and 20. So if your motor required 100mA, this would mean a Base current of say 5mA to 10mA, say 5mA, this would make the base resistor 4.3/0.005 = 820R I would use a 680R.
Also Make the 180K around 22k thru 47K.

Regarding the electrical noise, you need some noise suppression across the motor, say 10nF and a 120R in series or a suppression diode.

Thank you very much for the advice! I followed your advice and changed the resistors.
It's working now!

The ones I was using, were from a website explaining how to use a transistor as a switch, and I followed the calculations shown there and the results were the 18K and 180K.

I tried measuring in the same way I did previously, the noise was still present and when I added the 120R and 10nF the signal was a compressed 50Hz sine wave. Out of frustration I plugged out the 20R resistor I was using to sub for the motor and plugged everything in, and it just started turning!

Not sure if anything happened to the noise, but the motor is turning and thus the transistors are switching off fully, which was my original worry.

Thanks again for the help!
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top