LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Zaber return position function

I have been struggling with return position function using two Zaber devices in daisy chain, a linear stage and a rotary device. My code contains two portions: Request moving, while return position not equal to target position, keep requesting return position (command 60). Only one device is moving at a time, the other one is stationary.

 

I have two problems. First one is device number mixture. Assume the moving device number is 1. During the while loop of return position command, device number altered on its own back and forth between 1 and 2 randomly. When it doesn't change back to 1, the loop won't stop.

 

Second problem is return position response not being consistent. Even when a device is not moving, polling return function returns various answers in a wide range.

 

I replaced Write command to Request for clearing output buffer. It didn't help.

 

The original program is in TestStand. For simple debug, I merged lines into one LabView vi. It is attached. 

 

I appreciate your advise. 

Message 1 of 13
(5,261 Views)

I work at Zaber, Anne, and I wrote our LabVIEW instrument driver. I haven't looked at your VI, because I only have LabVIEW 2011, but it sounds like you might be sending the Return Position command to device number zero. That makes both devices respond, and you will get a random mixture of responses from devices one and two. If device number 1 is moving, then send the Return Position command to device number 1.

On Stack Overflow, I documented a few different ways to track the position of a moving device, and I also wrote up some techniques for diagnosing communication problems like the one you're seeing.

If you have any more questions, you can post them here, or contact me through Zaber's web site.

 

yours,

Don Kirkby

Message 2 of 13
(5,241 Views)

Thank you, Don

 

I worked more on my issues and made progress. The attached is a modified vi. It works pretty good with the linear stage. However, the same vi could not work well with the rotary device (TS-RS60C). The first response shows that during the while loop "constant speed tracking"  is the main activity. This doesn't happen when linear stage operates. The rotary device would turn to the destination following write command, but polling of the current position is interrupted for a long time by the constant speed tracking activity. So it takes long time (time varies, could be over 1 minute) to get valid response from a rotation.

 

I need your help.

 

 

0 Kudos
Message 3 of 13
(5,235 Views)

Don, I copied the program's front and block diagram for viewing.

Download All
0 Kudos
Message 4 of 13
(5,231 Views)

It sounds like your rotary stage has enabled move tracking in the Device Mode setting. If you turn that off, then you will stop seeing all those extra responses. A good device mode for most of our rotation stages is 2304 to enable circular phase microstepping (2048) and disable auto-home (256). If you're trying to understand how the bit flags work to make a device mode value, you might find a scientific calculator handy, or even Google calculator.

 

yours,

Don Kirkby

0 Kudos
Message 5 of 13
(5,226 Views)

Don,

 

Thanks for your inputs. The program is finally working as expected.

 

I found that Moving absolute or relative alone is sufficient to control linear or rotary device. My problem went away after I changed Request in Command.vi from control to all constants. Though a little bit puzzling that all inputs were the same in the control format.

 

Thank you very much.

 

Anne

0 Kudos
Message 6 of 13
(5,197 Views)

Don,

 

I need your help on Zaber return position function again. I use the function to determine a target has reached its destination when First Response reasults match destination numbers. It is in a TestStand sequence made up of 3 steps: Initialization (VISA configure Serial Port only), main body and VISA Close. One attachment shows a simplfied sequence, the other attachment is a stand alone vi combinating all steps.

 

The difficulties I experienced is after issuing a destination, the linear array/rotary device moves immediately to the destination, but the First Response doesn't get updated until 10 or even 30 seconds later. This resulted in program being executed slower and slower. I tried reset, turning power off, the devices will work alright, and then slow down again...

 

What can be done to solve this problem?

 

 

Download All
0 Kudos
Message 7 of 13
(5,131 Views)

I'm sorry to hear you're having troubles, Anne. I tried running your Zaber test calibrated.vi with an A-LSQ075A-E01 device (a linear stage), and I never saw it slow down. I moved it back and forth between 0 and 10 about 10 times, and it always updated the position several times while moving.

The only time I saw any different behaviour was when I entered a position of 100, and that calculated a negative data value. The device gave an error, but the VI kept asking its position in an endless loop, because the position was never going to match the negative destination.

I suggest you use the Highlight Execution button to see what your VI is doing in that 10 to 30 seconds before the First Response gets updated. You could also use the techniques I described on Stack Overflow to diagnose communcation problems. It's also possible that your device has a hardware problem or a faulty connection. You can look at our troubleshooting guide, or you can contact us for help.

 

yours,

Don Kirkby

Message 8 of 13
(5,119 Views)

Thank you, Don

 

After power reset, the setup works ok now. I'll monitor communications like you suggested if it happens again.

 

Anne

Message 9 of 13
(5,085 Views)

Don,

 

I started a new run this morning and saw the slow-down again. There are total 160 distance operations in my program between distance 0.5 and 29.7cm. The distance settings were in normal speed at the beginning, then became slow. There is no delay executing moving absolute command, but it took 40 seconds to get first response matching the set distance. During the 40-second time period, though the linear stage had already arrived at its destination, the first response still read back previous destinations during the while loop. Many while loops later, the first response was finally updated, but the amount of time waiting for updates got worse with accumulated operations.

 

Thanks,

Anne

Message 10 of 13
(5,065 Views)