Jump to content
  • 0

programming using C of the V+ V- programmable power source in AD2


ssm
 Share

Question

Dear Help,

I am trying to use the programmable power supply as an offset for a signal. Using the offset with the WaveGen is not working because it is taking a long time to reach the target offset I need, so I am just using a dc power source instead.

Can I use the V+ and ground to use as a power source in the circuit? I only need the positive voltage, up to 3.7V, is that possible?

I can see this example in the SDK set (if you can point me to more examples I will be grateful):

// set up analog IO channel nodes

    // enable positive supply

    FDwfAnalogIOChannelNodeSet(hdwf, 0, 0, 1);

    // enable negative supply

    FDwfAnalogIOChannelNodeSet(hdwf, 1, 0, 1);

    // master enable

    FDwfAnalogIOEnableSet(hdwf, true);

    printf("Total supply power and load percentage:\n");

    for(int i = 0; i < 60; i++){

        // wait 1 second between readings

        Wait(1);

        // fetch analogIO status from device

        FDwfAnalogIOStatus(hdwf);

        // supply monitor

        FDwfAnalogIOChannelNodeStatus(hdwf, 3, 0, &vSupply);

        FDwfAnalogIOChannelNodeStatus(hdwf, 3, 1, &aSupply);

        wSupply = vSupply * aSupply;

        prcSupply = 100 * (aSupply / 0.2);

        printf("%.3lf W \t%i%%\n", wSupply, prcSupply);

            // in case of over-current condition the supplies are disabled

        FDwfAnalogIOEnableStatus(hdwf, &fOn);

        if(!fOn){

            // re-enable supplies

            FDwfAnalogIOEnableSet(hdwf, false);

            FDwfAnalogIOEnableSet(hdwf, true);

        }

    }

Edited by ssm
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Hi @ssm

I don't know exactly your experiment details but you can configure the AWG offset, wait 100ms then generate signals... or you could use custom waveforms which does not need analog offset.

The supplies have about 10ms, the AWG offsets 15ms and the Scope offset 0.5sec settle time. Due to this, after (the first) connection to the device or adjusting Scope offset or range you should wait at least 0.5-2sec.

image.png

image.png

 

image.png

Edited by attila
Link to comment
Share on other sites

  • 0

thank you @attila

well my experiment is that I am using a constructed custom signal, this signal is run once and the result is collected during this run,

the duration of this signal is short (I have different cases, some cases is in the us) I need to offset this signal, i tried to embed the offset in that signal it did not work, I tried to use the offset from the board, it did not work, so that is why I am using the PPS V+, I can switch it ON and wait before I start my experiment

ssm

Link to comment
Share on other sites

  • 0

I have question regarding the connections, can I connect the WaveGen and V+/V- in series? in other words, if the ground black wire of the WaveGen global ground or ground used for the WaveGen only? if I connected V+ to GND black wire will it short the V+?

please see attached image,

 

Untitled Notebook (2)-3 2.jpg

Link to comment
Share on other sites

  • 0

Hi @ssm

The device has one, common GND which is connected to the computer through the USB cable.
Connecting V+ to GND will short it and the supplies (V+/-) will shut down.

You could for instance use V- as virtual ground for the circuit under test, so with V+/- +/-5V you could supply your circuit with 10Vpk2pk. In this case the W1 0V will be +5V for the circuit, -5V will be 0V, +5 will be +10V ...

Link to comment
Share on other sites

  • 0

Hi @attila

I have a question regarding this command line:

FDwfAnalogInChannelRangeSet(hdwf, -1, 8);

if I have my range to be between 3.5 V and 4 V, what value should I put here, 8V? will the bigger value, i.e. 8V instead of 4 V, reduce the precision of the value read by the scope?

thank you for the help

ssm

Link to comment
Share on other sites

  • 0

Hi @ssm

The AD2 has two range steps 5/50Vpk2pk so with 8V it would use 50V range with lower resolution.

FDwfAnalogInChannelRangeSet(hdwf, -1, 0.5);
FDwfAnalogInChannelOffsetSet(hdwf, -1, 3.75); 3.75V +/- 0.5V/2 = 3.5V...4V

To be in low range with AD2 the range should be set up to 5V and the offset +/- range/2 should be between +/-8V and trigger if specified for the channel also in this range,
so for 5.5V...0.5V (3V+/- 5V/2) you could use:
FDwfAnalogInChannelRangeSet(hdwf, -1, 5.0);
FDwfAnalogInChannelOffsetSet(hdwf, -1, 3.0); -5.5...5.5

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...