From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Swipe along I-V curve

Hello, my code consists of changing the gate-source voltage of a mosfet from 0 to 10 V and this should swipe along the I-V curve of PV module. Whatever be my sampling time, i should have an I-V curve at the end. My Vgs should increase in steps of 0.001V every 0.01s. The problem i am facing is that I am not able to swipe along the curve. My current and voltage sensors are callibrated correctly. I am using the NI 9184 chassis with submodules NI 9205 and 9923 to acquire and generate the voltages respectively. I am attaching my code. Please help me out if someone got a solution.

0 Kudos
Message 1 of 3
(2,201 Views)

Your diagram is way too big and disorganized for me to do much, but here are some pointers.

 

  • Do you want to see the sweep output only at the end or interactively during the scan? If you want to update the graph in real time, the terminal would need to be inside that inner loop.
  • You have a bewildering combinations of array operations in that inner loop (and elsewhere, e.g. the "build array" before the graph terminals is completely pointless) I am sure things could be cleaned up significantly by acquiring a better datatype and potentially doing a better conversion from the dynamic data.
  • XY graphs understand complex arrays, so all you need is built the xy data in a single shift register as a 1D complex (CDB) array.
  • Since you know the exact final size, it would be better to initialize the arrays at a fixed size and use "replace array subset" to build the graph. If you initialize with NaN, invalid data won't show.
  • You probably don't really need a formula express VI for a simple multiplication or scaling.
  • The wait primitive requires an U32 value in milliseconds. Wiring a 0.01 gives you a zero. Wire a 10 for 10ms.
  • If you set the voltage and read the response at the same time, you probably get a stale result corresponding to the earlier voltage. You probably need a settling delay.
  • Why would you maximize the panel to the screen?
  • Most of the rest of your code smells bad. It would really help to do a few tutorials and then design the code from scratch.
Message 2 of 3
(2,187 Views)

*facepalm*

 

Everything altenbach said x10.

 

The first thing you need to do is scrap this and use a proper program architecture like a state machine.

 

One big loop (OBL) IS NOT A PROPER PROGRAMMING ARCHITECTURE. 

 

Also don't be afraid of making a sub-vi and bundling wires into clusters.

 

Unrelated to your code... You are depending on the linear region of your MOSFET to be very wide and well, linear. Most MOSFETS do not have a very large linear region and tend to be on or off. That is why they make such good high speed switching transistors.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 3
(2,165 Views)