¿ªÔÆÌåÓý

Use a TABLE function in a BV to make a custom defined function.


 

Hello? ... I need a BV source to use a TABLE to look up a response.? This works if the controlling variable is a .param ( Static for the full sim)? but I need the BV to be dynamic ( Use the TABLE lookup in response to a changing voltage and respond with the voltage result )? I have tried to do this, but no success yet.? I uploaded? LTspice_TableTest.zip to the temp folder.? Thank you so very much for any help you can provide!!? JD


 
Edited

On Thu, Mar 13, 2025 at 09:50 PM, <jad700@...> wrote:
Hello? ... I need a BV source to use a TABLE to look up a response.? This works if the controlling variable is a .param ( Static for the full sim)? but I need the BV to be dynamic ( Use the TABLE lookup in response to a changing voltage and respond with the voltage result )? I have tried to do this, but no success yet.? I uploaded? LTspice_TableTest.zip to the temp folder.? Thank you so very much for any help you can provide!!? JD
The example in the schematic you uploaded does not make sense.? The syntax is wrong, and that is true even with the Table() function depending on a parameter KK.
?
The answer to your question is: what you want to do works!? Yes, the Table() function can depend on a voltage too.? The reason you had no success is that you did not use the Table() function correctly.
?
Do the following:
  1. Fix the Table() function.
    1. In your example, it is short enough so you could paste all the values into the Table() function itself.
  2. Verify that it works using parameter {KK}.
  3. Change the index parameter from "{KK}" to "V(SET)".
  4. Verify that it still works.
?
If you need to have the list of Table() values in an external file, you'll have to do it differently than what you tried to do.? One way to do that (prior to? LTspice V24.1.x, that is), is to write the B1 element and the .INC command as two consecutive SPICE Directive lines.? In other words, you can't use the schematic symbol for this B-source; it must be in a SPICE Directive - immediately followed by the .INC command.? Something like this:
B1 OUT 0 V=Table(V(set),
.inc table_R1.txt
which must be both in the same SPICE Directive on the schematic.? (I did not verify that this works, but I've seen others doing that.)? Also, your file table_R1.txt needs some fixing up.? Get rid of the line with the "+ n".
?
Andy
?


 

Oops, I had an extra "V=" in my reply.? Should be "V=Table" not "V=V=Table".


 

jad700,
?
I just uploaded "LTspice_TableTest_AI.zip" to the Temp folder.? It corrects your Bv source with the Table() function, and it shows that it works to refer to the voltage V(SET) instead of a fixed parameter, as the index to the table's values.
?
Andy
?


 

¿ªÔÆÌåÓý

On 14/03/2025 03:38, Andy I via groups.io wrote:
I just uploaded "LTspice_TableTest_AI.zip" to the Temp folder.? It corrects your Bv source with the Table() function, and it shows that it works to refer to the voltage V(SET) instead of a fixed parameter, as the index to the table's values.
Be aware that this BV table syntax is broken in LTspice 24.1.x at the moment. We have been assured that it will be fixed in 24.1.6, but we don't know when that will happen.

--
Regards,
Tony


 

Andy
AWESOME !!! ?It works !!
Thank you so very much!
?
So weird that the text function creates a net, so I just mats a net with the OUT4 name and can probe that.
?
This will be useful!
?
Thank you!
JD