CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

How to correct relay noise
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
sorasit46



Joined: 07 May 2007
Posts: 69

View user's profile Send private message

How to correct relay noise
PostPosted: Thu Mar 20, 2008 4:32 pm     Reply with quote

16F876A
I'm use output_pin to drive relay for supply dc motor. Some time (not any time) relay work on-off-on-off it has noise to cause program hang/error. I try correct by
1. use cer103-104 connect motor pole, not work
2. use cer103-104 connect relay contact, not work
How I can solve this noise?

regard
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Mar 20, 2008 4:57 pm     Reply with quote

See these posts about using relays with PICs:
http://www.ccsinfo.com/forum/viewtopic.php?t=30336
http://www.ccsinfo.com/forum/viewtopic.php?t=30001
http://www.ccsinfo.com/forum/viewtopic.php?t=23634
sorasit46



Joined: 07 May 2007
Posts: 69

View user's profile Send private message

PostPosted: Thu Mar 20, 2008 5:50 pm     Reply with quote

PCM programmer wrote:
See these posts about using relays with PICs:
http://www.ccsinfo.com/forum/viewtopic.php?t=30336
http://www.ccsinfo.com/forum/viewtopic.php?t=30001
http://www.ccsinfo.com/forum/viewtopic.php?t=23634



Thanks.
I will try.
Matro
Guest







PostPosted: Fri Mar 21, 2008 6:20 am     Reply with quote

Just use MOSFET transistors instead of relays.

Matro.
sorasit46



Joined: 07 May 2007
Posts: 69

View user's profile Send private message

PostPosted: Fri Mar 21, 2008 5:36 pm     Reply with quote

Matro wrote:
Just use MOSFET transistors instead of relays.

Matro.


Good idea.
For drive direct current motor 24V8A .Please to suggest number of mosfet.
Can use PWM with MOSFET to control direction and speed motor ?
If can please to suggest schematic too.
Regard
Ttelmah
Guest







PostPosted: Sat Mar 22, 2008 3:31 am     Reply with quote

While MOSFETs are a good way to go, You need similar protection from induced currents for these, to a relay. The relay adds the problems of possible contact bounce when switching on, and arcing when switching off, but in both cases, when driving an inductive load like a motor (and worse, a motor, presumably with mechanical inertia, so there will be a generator effect when power is removed), you _must_ design the power circuit to handle these properly. The MOSFET, will make certain things worse (the sheer switching speed generates more RF problems, unless the gate current is very carefully controlled), and also thre is a tendency for people to 'rely' on the internal diode created by the structure, which in general has much _lower_ power ratings than the device itself, resulting in a common failure mode (some special devices like Hitachi power MOSFETs, are explicitly manufactured with internal diodes that match the switching elements, but unless this is known and verified on the data sheet, external diodes must be used).
Remember that there is energy contained in an inductor, when you switch 'off', this must go _somewhere_, and it is down to you to ensure that the route it takes can handle this without creating problems.
Look at Microchip's AN898.

Best Wishes
Guest








PostPosted: Sat Mar 22, 2008 4:36 am     Reply with quote

sorasit46 wrote:
Matro wrote:
Just use MOSFET transistors instead of relays.

Matro.


Good idea.
For drive direct current motor 24V8A .Please to suggest number of mosfet.
Can use PWM with MOSFET to control direction and speed motor ?
If can please to suggest schematic too.
Regard

If board cost is not something very very important, I suggest that you use an integrated MOSFET motor driver, full bridge if possible.
Because of the current you use, I advise that you take a IC with not integrated MOSFET but with external ones.
You can find references, datasheets and so on in every manufacturer website like Maxim, Linear tech., National semi., ...

Matro
Got PIC



Joined: 21 Mar 2008
Posts: 10

View user's profile Send private message

PostPosted: Sat Mar 22, 2008 8:08 pm     Reply with quote

Is the relay connected directly to the OUTPUT Pin on the CPU?
You may be drawing way too much current from the CPU pin. You should alway isolate the CPU Pin from what ever you are driving, especially if you are driving an inductive load like a relay. The inductive kick back alone could cause you lots of damage/problems…
baltazar_aquino



Joined: 16 Mar 2008
Posts: 27

View user's profile Send private message

PostPosted: Sun Mar 23, 2008 12:49 am     Reply with quote

Quote:
Is the relay connected directly to the OUTPUT Pin on the CPU?
You may be drawing way too much current from the CPU pin.

This is really common to forums. We try to solve the problem without getting much information from the person who posted. GotPIC's question is also my question in mind. Relay is a cheap and for just switching (not PWM apps) , its a good choice. but if you are using it improperly, you may even burn your PIC port internally ( which happened to me already). sorasit46, why not give us a little more detail of your hardware as in, how did you connect you relay. Thru a swtiching transistor? or directly (this is not recommended) and post your code fragment that drives the relay port particularly.
sorasit46



Joined: 07 May 2007
Posts: 69

View user's profile Send private message

PostPosted: Tue Mar 25, 2008 3:10 am     Reply with quote

baltazar_aquino wrote:
Quote:
Is the relay connected directly to the OUTPUT Pin on the CPU?
You may be drawing way too much current from the CPU pin.

This is really common to forums. We try to solve the problem without getting much information from the person who posted. GotPIC's question is also my question in mind. Relay is a cheap and for just switching (not PWM apps) , its a good choice. but if you are using it improperly, you may even burn your PIC port internally ( which happened to me already). sorasit46, why not give us a little more detail of your hardware as in, how did you connect you relay. Thru a swtiching transistor? or directly (this is not recommended) and post your code fragment that drives the relay port particularly.


Sorry for my late.
I'm switch relay by transistor. I use 2 relays for control spin direction of dc motor 8A 24V & use PWM to control speed. But now I will change drive motor by 4 MOSFET. I think I can use PIC direct trig MOSFET.Because data sheet of MOSFET number STP80NF55-08 use Vgs(th) 2-4 Volts. But many people say can not use PIC for direct drive MOSFET. How yours idea?

Regard
Matro
Guest







PostPosted: Tue Mar 25, 2008 3:43 am     Reply with quote

I often control MOSFET directly with a PIC. But never for DC motor driving.
But here if your MOSFETs just control the spin direction and not the speed, I don't really see a problem. But the motor control will be not easy during inertia phases.
Matro.
Ttelmah
Guest







PostPosted: Tue Mar 25, 2008 5:30 am     Reply with quote

There are 'logic level' MOSFETs, which have lower gate drive voltages than nrmal types, which can be directly driven by a PIC. However, even with these, when driving at high speed, the actual output drive ability of the PIC, will result in very slow switching, and may give problems. The typical 'power' MOSFET, has a very significant capacitance present (often over 1000pF). To drive the gate through the transition region quickly, requires a suprisingly high current capability in the driver involved.
On the existing circuit, do you have a diode to trap the energy in the relay coil, when the transistor switches off?. If you look at the 'equivalent circuit', of generic 'logic driver' IC's (like the standard ULN200x family), you will see that in every case, they have a set of diodes from the outputs, to one pin of the IC, which is meant to connect to the +ve rail, to trap the switch off energy in coils. This is _essential_. Without it, if you drive a transistor, with a logic pin, the 'odds' are that when you switch off, the voltage on the junction between the transistor and the coil, will rise to a massive level, and often breakdown through the transistor to the driving logic pin, and destroy the chip driving the pin...

Best Wishes
baltazar_aquino



Joined: 16 Mar 2008
Posts: 27

View user's profile Send private message

PostPosted: Tue Mar 25, 2008 6:20 am     Reply with quote

Power MOSFETS are inherently more expensive than bipolar transistors. However, you get less quiescent power consumption with MOSFETS , if cost is a concern, you can also use power transistors in double push-pull fashion to create a full bridge. This will give you direction control also of the dc motor(inject complementary signals at the bases and you can have current direction change) - and you get rid of the relay problem. Do you have inductive line filters in your supply rail? In some cases, capacitor alone cannot damp the low frequency noise -in such a case you have to use a filter coil. But still you have to use clipping diodes at the motor terminals the opposite leads are tied to the rail to protect your transistors. With proper filtering , maybe relay is just sufficient for your application.
sorasit46



Joined: 07 May 2007
Posts: 69

View user's profile Send private message

PostPosted: Tue Mar 25, 2008 11:09 am     Reply with quote

baltazar_aquino wrote:
Power MOSFETS are inherently more expensive than bipolar transistors. However, you get less quiescent power consumption with MOSFETS , if cost is a concern, you can also use power transistors in double push-pull fashion to create a full bridge. This will give you direction control also of the dc motor(inject complementary signals at the bases and you can have current direction change) - and you get rid of the relay problem. Do you have inductive line filters in your supply rail? In some cases, capacitor alone cannot damp the low frequency noise -in such a case you have to use a filter coil. But still you have to use clipping diodes at the motor terminals the opposite leads are tied to the rail to protect your transistors. With proper filtering , maybe relay is just sufficient for your application.


For DC motor 24V8A .Please tell me about number of power transistors with TO-220 package. Which I can use PWM to control Speed too.
Thank you
baltazar_aquino



Joined: 16 Mar 2008
Posts: 27

View user's profile Send private message

PostPosted: Tue Mar 25, 2008 12:06 pm     Reply with quote

you can use the complementary pair NA51W/NA52W . Or the equivalent 2N6121/2N6124 pair. But I dont' know exactly your load current. You just mentioned the relay rating (8A/24V). With these transistors, you can safely switch 3A (4Amax) up to 40V(max) VCE. If the rating is not enough for you, you can use the whooping 2N3055/MJ2955 pair (TO-3 package). In both cases you have to buffer first your PIC pins with smaller signal general purpose transistors (complementary pair also).
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group