Except for CSV Voltage Source, Is There Any CSV Current Source Block? I need it to model a piezoelectric sensor as an current input (arbitrary waveform) for other readout circuit design. Thanks in advance if someone can help. James |
by JamesWang
July 03, 2020 |
What a really great question - I found out a lot about CIRCUITLAB! (I was unable to find an element like CSV current source). Try this procedure (it works on my system): 1] Run simulation "CSV Voltage source Example" https://www.circuitlab.com/editor/#?id=7mzk9j BUT with only one output V(PWS_CSV_OUT). 2] Export the results as a CSV file (at the top right of the Transient Analysis graph "Export Plot CSV"). 3] Open the CSV file in a text editor. Copy the data points WITHOUT the final comma. 4] Paste the data inside the brackets of PWS() in the current source. (Magically, the LF characters disappear). 5] Check this example I_source_control https://www.circuitlab.com/editor/#?id=49ytmx28mg38 Note: I don't know the size limit for expressions such as PWL() and PWS(). In the example there are 250 data points in a file of 5k5bytes. Happy experiments! |
by EF82
July 03, 2020 |
Another approach is to use the CSV Voltage Source to generate a voltage, and then use a current source controlled by that voltage. This effectively creates a CSV-backed current source! Here's a simulation with a working example: Importantly, this uses the Behavioral Voltage and Current Sources support inside the simulation engine to define the current of I1 algebraically. |
ACCEPTED
+1 vote by mrobbins July 06, 2020 |
That's cool! I never think about assigning a t-dependent variable by an output and then further use this variable as an t-dependent input for Current Source block. Thx, dude. |
by JamesWang
July 06, 2020 |
Just wanted to add that we've now added a CSV Current Source component to the toolbox, so this trick is no longer needed. |
by mrobbins
August 13, 2020 |
HI, EF82 Thx for your instruction. Following your idea, I've made a similar example like this ( https://www.circuitlab.com/circuit/959uj4y7de5z/arbitrary-current-waveform-by-pws ) |
+1 vote by JamesWang July 05, 2020 |
You must log in or create an account (free!) to answer a question.
Anyone can ask a question.
Did you already search (see above) to see if a similar question has already been answered? If you can't find the answer, you may ask a question.
CircuitLab's Q&A site is a FREE questions and answers forum for electronics and electrical engineering students, hobbyists, and professionals.
We encourage you to use our built-in schematic & simulation software to add more detail to your questions and answers.
Acceptable Questions:
Unacceptable Questions:
Please respect that there are both seasoned experts and total newbies here: please be nice, be constructive, and be specific!
CircuitLab is an in-browser schematic capture and circuit simulation software tool to help you rapidly design and analyze analog and digital electronics systems.