Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Glitch Problem

 
Thread Tools Search this Thread
Old 09-13-2007, 10:04 AM   #1
Default Glitch Problem


Hi

I'm developing a Pulse-Width-Modulation (PWM) scheme on a Xilinx
spartan 3 digilent demo board to perform sinusoidal current control in
a 3 phase motor. I've managed to just about get it working apart from
some strange behaviour where something unknown causes a glitch and
this results in a spike in the current in the motor. The interesting
thing is that during the course of trying to find the problem I have
wired various signals internal to the FPGA to output pins to view on a
scope. In doing this (purely connecting internal signals to the IO
pins) the problem has been cured. I'm guessing therefore that this is
a timing issue or could anyone suggest an alternative cause? Is there
a method of setting timing constraints for internal signals in ISE?
(I can set timing constraints for inputs and outputs but can't find
anything to set timing constraints on internal signals)

The block proceeding the signal which is routed to the IO (to cure the
problem) is a lookup table that compares a timer count signal with
duty times and produces a control signal. The VHDL code for this
block is:

begin
process (count, d1, d1_d2)
begin
if (count <= d1) then
vector_control <= "00";
elsif ((count > d1) AND (count <= d1_d2)) then
vector_control <= "01";
else vector_control <= "10";
end if;

end process;

ISE has implemented this as some magnitude comparators and a ROM
(implemented in a LUT rather than blockram)

This part of the system is combinatorial and not clocked but inserting
a clocked register on the output of this block does not help.

Any suggestions or comments greatly appreciated.

Steve Minshull



Steve.Minshull@gmail.com
  Reply With Quote
Old 09-13-2007, 12:29 PM   #2
ast
 
Posts: n/a
Default Re: Glitch Problem

<> a écrit dans le message de news: om...


> This part of the system is combinatorial and not clocked but inserting
> a clocked register on the output of this block does not help.



Inserting a register on outputs removes glitches for sure.

Or what do you call a glitch ? A pulse shorter than a clock
period or something else ?



ast
  Reply With Quote
Old 09-13-2007, 02:43 PM   #3
Andy
 
Posts: n/a
Default Re: Glitch Problem
On Sep 13, 4:04 am, Steve.Minsh...@gmail.com wrote:
> Hi
>
> I'm developing a Pulse-Width-Modulation (PWM) scheme on a Xilinx
> spartan 3 digilent demo board to perform sinusoidal current control in
> a 3 phase motor. I've managed to just about get it working apart from
> some strange behaviour where something unknown causes a glitch and
> this results in a spike in the current in the motor. The interesting
> thing is that during the course of trying to find the problem I have
> wired various signals internal to the FPGA to output pins to view on a
> scope. In doing this (purely connecting internal signals to the IO
> pins) the problem has been cured. I'm guessing therefore that this is
> a timing issue or could anyone suggest an alternative cause? Is there
> a method of setting timing constraints for internal signals in ISE?
> (I can set timing constraints for inputs and outputs but can't find
> anything to set timing constraints on internal signals)
>
> The block proceeding the signal which is routed to the IO (to cure the
> problem) is a lookup table that compares a timer count signal with
> duty times and produces a control signal. The VHDL code for this
> block is:
>
> begin
> process (count, d1, d1_d2)
> begin
> if (count <= d1) then
> vector_control <= "00";
> elsif ((count > d1) AND (count <= d1_d2)) then
> vector_control <= "01";
> else vector_control <= "10";
> end if;
>
> end process;
>
> ISE has implemented this as some magnitude comparators and a ROM
> (implemented in a LUT rather than blockram)
>
> This part of the system is combinatorial and not clocked but inserting
> a clocked register on the output of this block does not help.
>
> Any suggestions or comments greatly appreciated.
>
> Steve Minshull


About the only thing your problem and solution would indicate is a
timing problem. I suspect the above code is not your problem if
putting a register on the output is not fixing it. You do have timing
constraints, and are running static timing analysis, right?

How long (relative to a clock period) are your glitches lasting?

Also, the (count > d1) is superfluous in the elsif condition. It is
implied by the elsif and the previous condition. It should get
optimized out anyway by the tool, but...

Andy



Andy
  Reply With Quote
Old 09-13-2007, 04:26 PM   #4
Steve.Minshull@gmail.com
 
Posts: n/a
Default Re: Glitch Problem
On Sep 13, 12:29 pm, "ast" <a...@ast.com> wrote:
> <Steve.Minsh...@gmail.com> a écrit dans le message de news: 1189674255.744020.240...@g4g2000hsf.googlegroups.c om...
>
> > This part of the system is combinatorial and not clocked but inserting
> > a clocked register on the output of this block does not help.

>
> Inserting a register on outputs removes glitches for sure.
>
> Or what do you call a glitch ? A pulse shorter than a clock
> period or something else ?


Good news.

I think I've sorted the problem.

I was latching data into my FPGA using an async signal from a DSP by
performing an edge detect on the async signal and then wired this to
the enable of my latch. Discovered data was not always being latched
in properly. The wrong thing to do obviously. Temporarily solved the
problem by removing the edge detect but I'm thinking a double
buffering scheme would be best.

Cheers for your help.


Steve Minshull



Steve.Minshull@gmail.com
  Reply With Quote
Old 09-14-2007, 10:10 AM   #5
Laurent Pinchart
 
Posts: n/a
Default Re: Glitch Problem
wrote:

> On Sep 13, 12:29 pm, "ast" <a...@ast.com> wrote:
>> <Steve.Minsh...@gmail.com> a écrit dans le message de news:
>> 1189674255.744020.240...@g4g2000hsf.googlegroups.c om...
>>
>> > This part of the system is combinatorial and not clocked but inserting
>> > a clocked register on the output of this block does not help.

>>
>> Inserting a register on outputs removes glitches for sure.
>>
>> Or what do you call a glitch ? A pulse shorter than a clock
>> period or something else ?

>
> Good news.
>
> I think I've sorted the problem.
>
> I was latching data into my FPGA using an async signal from a DSP by
> performing an edge detect on the async signal and then wired this to
> the enable of my latch. Discovered data was not always being latched
> in properly. The wrong thing to do obviously. Temporarily solved the
> problem by removing the edge detect but I'm thinking a double
> buffering scheme would be best.


You *must* never drive two or more related flip-flops with an asynchronous
signal. Fix your problem by inserting a synchronization flip-flop on the
input path before the edge detector.

Regards,

Laurent Pinchart



Laurent Pinchart
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Comcast + Wireless Internet Problem shadoweloc General Help Related Topics 1 07-01-2008 06:19 PM
Dial Up Problem smackedass A+ Certification 3 02-02-2007 11:59 PM
Re: Virus Problem ** Help!** David BlandIII A+ Certification 1 03-02-2004 06:00 PM
Re: Serious Computer Problem hootnholler A+ Certification 1 11-24-2003 12:18 PM
Re: Serious Computer Problem Bret A+ Certification 0 11-19-2003 12:51 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46