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: 

Spikes while Simulating Resistance

Hi all,

I'm facing a problem while simulating resistance. The device which measures the resistance is sending a pulse signal with 80Hz frequency and 60% Duty cycle, so typically the on time is 7.5 ms and the off time is 5 ms. The signal amplitude is dependent on the resistance and the maximum value is 10V. While changing the resistance we must take care that the switching is happening in the off time of 5ms. As It is giving spikes whenever we are switching during high time. Our resistor simulator also takes 3ms time to change the resistance.

Presently I'm monitoring the pulse signal with a PXI 6259 card. The analog acquisition is in separate loop from the resistance simulator loop running in RT. Both loop are timed loop and running at 2kHz. Increasing the loop rate is not working, that I have already checked.

I'm sending the Boolean data of high or low state using a CVT tag. As expected it has reduced the spikes during switching but can’t omit.

Can anyone suggest any other way to do the same and get a better performance?

0 Kudos
Message 1 of 7
(3,383 Views)

The boolean tag "High or Low state" isn't enough information since your switching time is 6 cycles.  Your boolean tag needs to be "Transitioned Low Within the last 4 cycles" (or 2-3 to give you some room for actual time of transition vice detected time of transition + latency).

 

In other words, You need a 2-3 cycle one-shot on the negative transition to gate the switching.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 7
(3,365 Views)

Yes, You are bang on Smiley Happy . I'm also thinking the same... but running the loop faster is not enough, I think the CVT also kills some time. And My application is also very big, It uses 70 % of all 4 core of my RT processor.

 

Also.... the CVT doesn't provide any information about how much time is left for the next transition from low to high/ how much time elapsed from the previous transition from high to low. As the resistor simulator loop is independent, that information is necessary, So some kind of Synchronization is required.

 

I was thinking to use some software clock in sync with the input signal.... Or any alternative Idea?

0 Kudos
Message 3 of 7
(3,352 Views)

Put the one-shot inside the routine that does the switching -No need for an extra tag


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 7
(3,346 Views)

You meant to say putting in a single loop? well I want to keep that as the last option as it will lead us to change few more things in the architecture and It will be time taking. The AI card is acquiring other signals also, and those should not be disturbed, that also I need to keep in mind. Smiley Sad

0 Kudos
Message 5 of 7
(3,337 Views)

@meBaga wrote:

You meant to say putting in a single loop? well I want to keep that as the last option as it will lead us to change few more things in the architecture and It will be time taking. The AI card is acquiring other signals also, and those should not be disturbed, that also I need to keep in mind. Smiley Sad


Maybe I'm not quite tracking you here.   I assumed that you had a Boolean that knew the state of the resistance measurement's pulse output.

 

If you must garuantee that the resistance switching time (3mS) is entirely within the negative duty cycle of the pulse (5mS) you absolutely have to have; a request to change resistance and, a gating time where the change is allowed to be applied based on the negative going transition of the measurement pulse.  

 

Otherwise your in the classic quandry.  

Whey?

Way?

Weigh?

Wai?

There is just no "F" in way


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 7
(3,315 Views)

For my application, I can have a wait time between a change request from the user and the real change in my hardware, missing 1 or 2 cycle of the 80 Hz monitoring wont really affect in my case.

 

So my only aim is to update the resistance within that 5 ms.... To say exactly.... I am tying to keep that 3 ms time within that 5 ms low time.... Every time. That's the Only Aim. 

0 Kudos
Message 7 of 7
(3,286 Views)