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 support@ccsinfo.com

Encoder signal noise problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
davidbue



Joined: 05 Nov 2007
Posts: 28
Location: Denmark

View user's profile Send private message Visit poster's website

Encoder signal noise problem
PostPosted: Tue Nov 11, 2008 5:14 pm     Reply with quote

Good evening.

I'm working on a little project involving an engine and a 2-channel encoder.

I supply the encoder with a 5-volt regulated supply, as well as a common ground with my pic18f2220.

The encoder outputs a 2-channel square signal, one Z-pulse pr. revolution and a pulse-train for each 1/2 degree of rotation.

When I study the encoder signal with a scope, it looks nice and crisp. -My 18f2220 seems to trigger on the signal easily.

When I then use a timing-gun (strobe light gun that is timed from the fuel injector of the engine) I get a lot of false triggers on the Z-pulse signal on my microcontroller.

I can see some added background noise on the scope on the Z-pulse signal when I turn on the timing gun. It's high frequency, below 1 volt, and in very sharp peaks.

Could this voltage (roughly 1 volt) be enough for the microcontroller to see the input pin as being high?

If yes, any idea how to clean/shape the signal before I input it to the microcontroller?

Best regards
David
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Nov 11, 2008 6:26 pm     Reply with quote

This appnote recommends an RC filter on each output pin of the encoder:
http://www.piher-nacesa.com/pdf/ci12v01.pdf
See the bottom right corner of page 2.
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Tue Nov 11, 2008 6:30 pm     Reply with quote

The strobe light has a flyback type high voltage power supply to power the flash tube. This is generating the noise you see.
I would guess the Z signal is pulled to ground when active and left floating the rest of the time. When it is floating it is especially susceptable to the EMI from the flyback strobe supply. Your other signals are probably driver both high and low and never float, so they are less susceptible to EMI.

The EMI signal looks like it has only 1 volt peaks, but being very sharp they may be higher than the scope shows. If it is a 100MHz spike and you look at it with a 60MHz scope with a 25MHz probe you will see a lot less amplitude than is really there.

First try wrapping the strobe with grounded tin foil. Then if the Z line has a pull-up resistor try to use as low value a resistor as allowed, maybe 50 or 100 Ohms. If that doesn't help, add a series resistor close to the PIC (maybe 100 Ohms) and a small cap from the PIC input pin to the PIC ground pin. These components make an RC network. If the RC constant is too long they will slow your Z signal. See how fast you need the Z signal to be and select the cap to make the RC network about 10X as fast.

Filtering is a science, but those techniques should solve most problems.
_________________
The search for better is endless. Instead simply find very good and get the job done.
davidbue



Joined: 05 Nov 2007
Posts: 28
Location: Denmark

View user's profile Send private message Visit poster's website

PostPosted: Thu Nov 13, 2008 1:51 pm     Reply with quote

Thank you very much you guys! Adding a lowpass filter solved my problem!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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