Glitch Problem

Discussion in 'VHDL' started by Steve.Minshull@gmail.com, Sep 13, 2007.

  1. Guest

    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
     
    , Sep 13, 2007
    #1
    1. Advertising

  2. ast Guest

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


    > 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, Sep 13, 2007
    #2
    1. Advertising

  3. Andy Guest

    On Sep 13, 4:04 am, 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, Sep 13, 2007
    #3
  4. Guest

    On Sep 13, 12:29 pm, "ast" <> wrote:
    > <> a écrit dans le message de news: ...
    >
    > > 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
     
    , Sep 13, 2007
    #4
  5. wrote:

    > On Sep 13, 12:29 pm, "ast" <> wrote:
    >> <> a écrit dans le message de news:
    >> ...
    >>
    >> > 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, Sep 14, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jluis
    Replies:
    5
    Views:
    1,037
    Ray Andraka
    May 12, 2004
  2. rajan

    making a glitch filter

    rajan, Mar 8, 2005, in forum: VHDL
    Replies:
    2
    Views:
    8,166
    Ulf Samuelsson
    Mar 13, 2005
  3. Replies:
    4
    Views:
    940
    radarman
    Apr 22, 2006
  4. Blade

    A glitch?

    Blade, May 20, 2005, in forum: HTML
    Replies:
    3
    Views:
    652
    Blade
    May 21, 2005
  5. David O'Farrell

    floating point glitch

    David O'Farrell, Sep 23, 2004, in forum: Python
    Replies:
    15
    Views:
    513
    Michael Hoffman
    Sep 28, 2004
Loading...

Share This Page