Electronics > Beginners
Make single component in LTspice
ocset:
Hi
Do you know how i can make a single component out of the attached LED string?...we are using loads of them in the sim and its taking ages to run.
pwlps:
--- Quote from: treez on June 14, 2019, 05:22:17 am ---Hi
Do you know how i can make a single component out of the attached LED string?...we are using loads of them in the sim and its taking ages to run.
--- End quote ---
Google for "Hierarchical Blocks in LTSPICE". There are many tutorials, for example:
http://www.sgh1.net/posts/ltspice-custom-block.md
Zero999:
Why bother? Simply model it as a single diode with a forward voltage vs current curve mimicking the array of LEDs in series. That will be much faster to simulate, than a huge array of diodes.
https://electronics.stackexchange.com/questions/9510/how-do-i-model-an-led-with-spice
https://forum.allaboutcircuits.com/threads/ltspice-led.104269/
https://electronics.stackexchange.com/questions/379103/how-can-i-use-model-a-custom-diode-in-ltspice
Jay_Diddy_B:
Treez and the group,
You can use N=x to put parts in series in LTspice.
M=x will put parts in parallel.
Here is your example simplified:
I have attached the LTspice model.
I have done a dc sweep to show how the forward voltage changes with current.
Regards,
Jay_Diddy_B
Ian.M:
Edit: Jay_Diddy_b posted better instructions while I was typing this.
Hierarchical Blocks helps creating schematics but wont do anything whatsoever for runtime, as they are fully expanded when the netlist is generated before the SPICE run. However the LTspice SPICE engine's D (diode) circuit element supports instance parameters N to set the number of series diodes and M to set number of parallel diodes (see 'D' in help file), which netlist as a single diode, with the modelled voltage across it multiplied by N or the current through it internally divided by M.
You need to set N to the number of identical diodes in the string.
<snip my instructions - use Jay's>
You can then choose the diode model as normal and LTspice will treat it as a series string of 14 of them. To avoid confusion, its probably a good idea to edit its designator (InstName) to reflect the fact its multiple parts e.g D1-14. Do *NOT* use brackets in the designator as you don't want to create a bussed multiple component! (see: http://ltwiki.org/?title=Undocumented_LTspice#Bussing_of_Connections_and_Components_.28BUS_shorthand_notation.29 )
N.B. N and M instance parameters only work for diodes defined as a D model, not ones defined as a subcircuit or behavioural model. You cant probe voltages inside the string or currents inside strings paralleled with the M instance parameter. If you want to specify both N and N separate them with a comma and a space.
Navigation
[0] Message Index
[#] Next page
Go to full version