PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

6602

Jingwei,

It sounds reasonable to achieve the performance you are looking for with the equipment you have listed.  A real-time system (such as the one you listed) is ideal for this type of application.  The difference between a real-time operating system and a regular operating system is in the timing.  In a regular operating system the focus is on providing equal or nearly equal resources to all running tasks.  It also focuses on improving the average response time.  Often the tasks that are given highest priority are the user interface tasks such as moving windows or the mouse.  In a real-time environment, however, the focus is on deterministic (or predictable) timing.  The real-time OS does not give provide time to less critical tasks when higher priority tasks are ready to run.  Thus your control loop would be given a higher priority and would enjoy greater determinism on the real time system.

I took a look at your example and noticed you are running your application on your host PC instead of the real-time system.  You may experience more deterministic performance if you move the VIs to the real-time target (By dragging them to the real time target in your project).  You can still interact with the VIs from your host PC but it will allow you to leverage the benefits of your real-time controller.

Also, I am still not completely clear on what you are trying to achieve.  Are you using your current VI to simulate the actual application?  Are your going to replace the current simulate signal VIs with an actual reading from the encoder from the motor?  If so, you may experience improved performance when using the counter board over creating a simulated signal.

Typically encoders are read by counting the number of pulses that occur as the motor turns.  These pulses are then interpreted as positions around the motor.  Are you trying to modify the PWM as the encoder reaches various positions?  In other words would you like to modify the PWM signal when the motor is at pi/6, 5*pi/6, 3*pi/2, ...  positions?  The 6602 is capable of measuring this encoder position, however, the rate at which you will be able to sample the position will depend on the other tasks that are using bandwidth on the PXI bus.  The 6602 has a two sample FIFO that can store position measurements.  If these samples cannot be moved into the memory of the RT controller in time an overflow can occur.  However I suspect that you should be able to achieve a few kHz at least with the 6602.

I was also wondering, what are you using the PXI-4472 to measure?  How is this data related to the overall application?

As I further understand your application I hope I will be able to provide you with some useful pointers to get you up and running.  Let me know if there are any other details I should understand.

I look forward to hearing back from you.

Regards,

Neil S.
Applications Engineer
National Instruments
0 Kudos
Message 11 of 14
(1,690 Views)

Dear Mr. Neil S:

Thank you for your helpful information.

You are right I try to modify the duty cycle of PWM signals when the encoder reaches various position. I plan to use one of the PXI 6602 channels to acquire the rotor position signal.  The system function and waveforms are illustrated in the attached file. Now I just try to finish the first step function. I am not sure if my idea is reasonable. Please give me some advice on how to realize my function.  

Now I have the PXI8196RT and Host PC. In project explorer, I can watch the my computer and PXI8196RT system in the host PC. I have copied the program into the remote system (PXI8196RT) , then I run the program. I am not sure whether this is the way to run the program in the real time system.

I am a new LabVIEW user, any suggestion and help will be appreciate to me.

Thank you very much!

Best regards!

Jingwei Zhu

   

0 Kudos
Message 12 of 14
(1,681 Views)

Dear Mr. Neil S and Mr. Jeff Tipps:

Thank you for your helpful information. I sent you my project summary a week ago, I have not received your reply  until now. Maybe you are very busy.

I am looking forward to your reply.

The project summary is attached to this reply.

You are right I try to modify the duty cycle of PWM signals when the encoder reaches various position. I plan to use one of the PXI 6602 channels to acquire the rotor position signal.  The system function and waveforms are illustrated in the attached file. Now I just try to finish the first step function. I am not sure if my idea is reasonable. Please give me some advice on how to realize my function.  

Now I have the PXI8196RT and Host PC. In project explorer, I can watch "my computer" and "PXI8196RT system" in the host PC. I have copied the program into the remote system (PXI8196RT) , then I run the program. I am not sure whether this is the way to run the program in the real time system.

I am a new LabVIEW user, any suggestion and help will be appreciate to me.

Thank you very much!

Best regards!

Jingwei Zhu

0 Kudos
Message 13 of 14
(1,652 Views)
Jingwei,

Thank you for the additional information. 
To answer the question from your post: Yes when you move the VIs under the RT controller they are running on the RT host.  However, since in your orginal example you were generating a ramp signal instead of reading the position from a counter your performance will be somewhat different in your end application than what you are currently experiencing.

From what I understand your application will require several operations:

1.  A position measurement of the rotor.  An example of how to do this with the 6602 can be found in the LabVIEW example finder under: Hardware Input and Output >> DAQmx >> Counter Measurements >> Position >> Measure Angular Position. 

2.  The position measurement loop must trigger the execution of the PWM generation loop by sending a Notifier when the rotor reaches certain positions.  To see an example of how a Notifier could be used, open LabVIEW and go to File >> New ... When the New window comes up navigate to VI >> From Template >> Frameworks >> Design Patterns >> Master/Slave Design Pattern and click OK.  In this VI you will notice two loops on the block diagram.  The top loop could be used for the position read operation and will send a notifier if the position has reached certain points.  You could use the notifer to send the new PWM settings to the second bottom loop.  A notifier can send any data type given that the notifier was configured with that data type when it was obtained.

3. The bottom loop could then be used to write new PWM settings to the counters.  Very much like you have set up in your example.

You will likely want to avoid using local variables in this application to send the new PWM settings.  Using local variable will allow the second loop to change the PWM setting more often than you need to.  Using notifiers will allow you to set the PWM settings only when they need to be set freeing up the processor to address more critical tasks.

Hopefully this gives you some idea of where to start.  You mentioned that you are a newer LabVIEW user and I have mentioned several advanced topics.  I recommend spending some time reading in the LabVIEW help file to better understand what a notifier is and how it is used.  I would also recommend looking into taking a LabVIEW Basics class in your area if one will be offered in the near future.  You can find more details about LabVIEW classes offered in your area at: http://www.ni.com/training/

Let me know if you have additional questions.  Good luck with your application.

Regards,

Neil S.
Applications Engineer
National Instruments
Message 14 of 14
(1,635 Views)