Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Knowing time a breakpoint occurs to synchronize external instruments

Hi,

 

I'm using a PXI system with a PXI8196 controller, a PXI7350 Motion Controller, a UMI-7774 and my application is written in VB6.

I need to move a stepper motor and its position is measured by an encoder.

I've configured a periodical breakpoint which, during the movement of the axis, sends a trigger to a multimeter which, as soon as it "feels" the trigger, runs a scan of its channels to measures some voltages.

My problem is to know exactly when the breakpoint occurs in order to know the position where the multimeter measures each channel.

In order to do this, my application starts the movement and then runs a while cycle during which it asks the axis status (flex_read_axis_status_rtn) and when it finds the breakpoint bit active, it records the system time.

The problem is that the duration of the while cycle is not always the same. Usually it lasts 16 ms, which generates an error in the position knowledge of about 0.03° which is acceptable. However sometimes the cycle lasts 60-70 ms and the error in the position (more than 0.1°) becomes unacceptable.

Have you some tips to help me?

 

Thank you in advance for your help.

 

0 Kudos
Message 1 of 3
(3,086 Views)

Hi Elisa,

is the loop performing any other processing or operation in addition to reading the axis status?

Bye

 

Licia

0 Kudos
Message 2 of 3
(3,050 Views)

Hi Licia,

 

yes, the loop performs the following operations:

- reads the axis status (flex_read_axis_status_rtn)

- reads the high speed position (flex_read_hs_cap_status_rtn)

- if a breakpoint has occurred, it records the time, reads the encoder position (flex_read_pos_rtn and flex_read_cap_pos_rtn), increments the breakpoint counter and updates the relative controls on the user inteface.

Obviously, the first instruction inside the loop is a "Do Events" to allow the user to make operations like for example, to stop the motor. However the time intervals I wrote in my post has been measured when the user did nothing.

There is also a VB Timer which starts when starting the software and so runs at the same time of my loop. This timer periodically (twice per seconds)  reads the axis status and updates the relative controls on the user inteface.

I check that when the timer occurs the duration of the loop increases, but it increases also when the timer is inactive, and so for no apparent reason.

 

I hope I have clarified your doubts.

 

Thank you,

 

Elisa

0 Kudos
Message 3 of 3
(3,030 Views)