ltspice, componant variations in a sub-circuit

Discussion in 'The Projects Forum' started by lord yorkshire pudding, Apr 20, 2013.

  1. lord yorkshire pudding

    Thread Starter New Member

    Apr 10, 2013
    4
    0
    Hi,

    I'm trying to model a marx generator in ltspice. to do this i've had to make a spark gap sub-circuit with a voltage triggered switch in it. i want to be able to call this 10 times with a slight increase in triggering voltage at each spark gap.

    I'm currently using

    .SUBCKT
    spark_gap spark_gap
    .end

    to call the model which seems to work but the voltages just spike hugely when they all fire, but don't seem to multiply properly. i think this might be because the gaps are firing at exactly the same time

    Thanks for any help
     
  2. crutschow

    Expert

    Mar 14, 2008
    12,988
    3,226
    Post a schematic of the circuit and subcircuit as well as the .asc files.
     
  3. lord yorkshire pudding

    Thread Starter New Member

    Apr 10, 2013
    4
    0
  4. crutschow

    Expert

    Mar 14, 2008
    12,988
    3,226
    Don't really understand how the sub-circuit is connected to the main circuit. :confused:
     
  5. lord yorkshire pudding

    Thread Starter New Member

    Apr 10, 2013
    4
    0
    The pairs of circles are the spark gaps. with SPARK[T] at the top and SPARK. i want to be able to change the trigger voltage in each spark (value underlined with red).

    I've tried putting a name (Vtrig) instead of a value there then setting it through the sub circuit call i.e.

    .SUBCKT
    spark_gap spark_gap_1
    Vtrig=20K
    .end

    .SUBCKT
    spark_gap spark_gap_2
    Vtrig=20.1K
    .end

    and a few variations but have had no joy
     
  6. lord yorkshire pudding

    Thread Starter New Member

    Apr 10, 2013
    4
    0
    I've found a way around it now thanks,

    Instead of changing the component form outside with a function i've brought the voltage triggered supply out of the sub circuit
     
Loading...