Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI-6025E: How can I avoid triggering CTR1 whenever I start a task at CTR0?

Hi,

I am using the outputs CTR0 and CTR1 of my 6025E board to step two stepper motors.
However, when for example I start the task (DAQmx Start) for CTR1 to create 5 impulses at a frequency of 1 Hz, the following happens:

1. CTR1 creates 5 pulses, each 0.5s long, as expected.
2. CTR0 is pulled high (5V) for 5 seconds (goes high at DAQmx Start for CTR0 and back down to 0V at DAQmx Stop for CTR0)

Unfortunately that means that each motor is stepped once whenever the task for the OTHER motor is started/stopped.

Is there a way to avoid that?

Here is how my motors are connected within my SCB-100 screw terminal box:
Motor 1: CTR 1 OUT (pin 43) / D GND (pin 24)
Motor 2: CTR 0 OUT (pin 49) / D GND (pin 84)

I attached my program.

Thank you very much in advance,

Jochen Smolka
0 Kudos
Message 1 of 5
(3,442 Views)
 

Hi Jochen,

The reason that CTR0 is pulled high for 5 seconds is because our E Series cards require the use of both counters for finite pulse train generation.  This is done by generating a pulse of the desired width (5 seconds) and using it as the gate for CTR1.  I've attached an image of your application as seen by test panels.  This explains the event for other readers of this thread.  This is also explained in the article found here.



If you require complete hardware timed accuracy on your finite pulse generation, then you will have to use two counters.  However, since your going at a slow rate (such as 1-100Hz) you could use a software timed continuous pulse train by doing the modifications to your code as shown below.  I did the test below at 100Hz by using a time delay of around 1100 ms to generate an average of 5 pulses.  This is not 100% accurate but it may work for your application.





I hope this helps,
Paul C.

 

Message Edited by Paul C. on 10-30-2007 12:04 PM

Message 2 of 5
(3,412 Views)

Hi Jochen,

I found another post, found here, that talks about the same concerns and offers a few more suggestions that you might want to take a look at.  Specifically, take a look at the post by Stilly32 about tristating the output line.

I hope this helps,
Paul C.

 
0 Kudos
Message 3 of 5
(3,397 Views)
Hi Paul,

thanks a lot for your reply. Indeed the timing of the pulses is not important, even a large discrepancy in pulse width or duty cycle would only make the motor a bit more noisy. However, the NUMBER of pulses is critical (the motors are basically driving a turn table to an exact angular position and accumulating missing or extra pulses would ruin the accuracy). Also I will need to use frequencies up to 1000 Hz (equals 2.5 degrees/secons, so 100 Hz would be too slow).

As it turns out now, I have to drive 3 motors, so the 2 CTR outputs wouldn't be enough anyway. So I'm using ao0 and ao1 (with an analog square wave) for motors 1 and 2 and CTR0 for the third motor.

The only other (much more elegant) option I can see is if I could use CTR0 and dynamically route it to one of three other pins (which the three motors would be connected to). As far as I understand it, that's not possible with the board though (?).

Thanks again,

Jochen
0 Kudos
Message 4 of 5
(3,390 Views)

Hi Jochen,

Without a switching device or some external circuitry you won't be able to control which motor CTR0 is connected to.  If you had a switching device that you send a digital output control line to, that would allow you to control which motor is active.  You might also consider one of our counter boards such as the PCI 6602.  This card has 8 counters that you could use to control each motor precisely with finite pulse generation.  The product page for this device can be found here.

I hope this helps,
Paul C.

 
0 Kudos
Message 5 of 5
(3,369 Views)