Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

position tracking using encoder counts

I am using PCI 7342 to control my motor which has an incremental encoder. I need to track the motor's position using encoder counts even when power cycles. In my another system which use another company's products, I wrote current encoder counts in a non-volatile memory. so when system loses power, encoder counts is stored in non-volatile memory, once power on, read number from memory and write it to encoder. So the position is able to be tracked.

How can PCI 7342 handle this kind of thing?

Thanks.
0 Kudos
Message 1 of 13
(5,008 Views)
Thank you for contacting National Instruments. The 734x motion controllers do contain a section of nonvolatile memory, in the form of flash ROM, that can be used to store onboard programs and variables that will remain in memory even through a power loss. Refer to the Object Memory Management VI in LabVIEW for information on saving information to nonvolatile memory.

Also, depending on the programming language you are using, you can find a number of shipping examples that demonstrate how to create and use an onboard program. I would recommend using a buffer to store the information so that you have more flexibility to store a number of pieces of information.

Below is one LabVIEW example on our website that illustrates a Buffer Read/Write application:

http:/
/sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3E13156A4E034080020E74861&p_node=DZ52465&p_source=External

Also, Chapter 15 of the NI-Motion User Manual discusses onboard programming and gives examples of them in both LabVIEW and text-based programs. I hope this helps answer your question, and if you have any more specific questions then please let us know.

Regards,
Michael
Applications Engineer
National Instruments
0 Kudos
Message 2 of 13
(5,007 Views)
I remember I read a post which was an answer from NI's engineer in this discussion forum, it mentioned that PCI 7342 doesn't support onboard programming, which is shown in page 625 in 2003 catalog. I don't have 2003 catalog and couldn't find this in the manual. Is that true for 2004 product?

I also noticed that write and read buffer functions only write and read to or from RAM rather than ROM. Is that right and could it be kept when power cycle?

Thanks
0 Kudos
Message 3 of 13
(5,007 Views)
In 2003 with our older NI-Motion drivers, we did not provide support for onboard programs on the 7342 motion controller. With the newer versions of NI-Motion, such as version 6.1, then you have the ability to create onboard programs for the full line of 734x motion controllers. If you reference page 632 in the 2004 catalog, then you will see that this change is reflected in the latest catalog.

In regards to your question about storing a buffer in ROM, then you will need to use the Object Memory Management VI. This VI allows you to saves, delete, or free programs or buffers in RAM and ROM. Objects saved to non-volatile Flash ROM are available for use at any future time, even after power cycles.

Regards,
Michael
Applications Engineer
National
Instruments
0 Kudos
Message 4 of 13
(5,007 Views)
Can I use read buffer and write buffer function in this situation?
I tried it and the problem is if the first operation is read buffer after power on, I will get error -70072 which is old data was encountered while reading or writing buffer. But what I need is this old data.

Thanks
0 Kudos
Message 5 of 13
(5,007 Views)
Hi Michael,

Any simple example of using Object memory managemant vi to read and write a data from and to ROM?

Thanks.
0 Kudos
Message 6 of 13
(5,007 Views)
Hi Michael,

According to online help, "you cannot save or delete an object when any motor is moving. Attempting to execute this VI in these cases generates an error. Saving or deleting an object takes 2 to 4 seconds.", is it possible to track position using encoder counts. Because in my program, it is needed to save encoder counts to ROM in every loop time when the motor is running. If it takes 2 to 4 seconds, it will lose the accuracy because the motor will move thousands of or hundreds of thousands counts within 2 to 4 seconds.
How can I do in this case? I want to track position as accurate as possible for every program loop which is probably within 200ms.

Any solution for that?

Thanks.
0 Kudos
Message 7 of 13
(5,007 Views)
You are correct that you need to stop the motor before doing a memory management operation on the motion controller. There are a few options if you want to store a set of encoder readings. You can right them to a variable in your onboard program and then have a program on your host computer read those variables whenever they are written.

You can also set up a buffer and write the encoder values to this buffer while your onboard program is running. Please take a look at the following website for an example of how this can be done:

Onboard Program - Continuous High Speed Capture into General Purpose Buffer
http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3D77D56A4E034080020E74861&p_node=DZ52480&p_source=External

Regar
ds,
Michael
Applications Engineer
National Instruments
0 Kudos
Message 8 of 13
(5,007 Views)
Hi Michael,

When the controller primary feedback is set to ADC-channel 1 for pressure control, there is no encoder counts and velocity reading in MAX. When I use Read encoder counts.flx in my program under this configuration, got error -70006.
How can I monitor position in this situation? Do I have to use software PID control instead of PID in PCI 7342 controller?

Thanks.
0 Kudos
Message 9 of 13
(5,007 Views)
If you are using analog feedback and do not have an encoder, then obviously we have no encoders to read and will receive an error. From you last post, I was under the impression that you did have an encoder that you wanted to read. If you are using analog feedback, then you can read in those analog values and determine where your system is at based on the voltage. The value of this voltage should correspond to a known position or movement in your system.

In LabVIEW (and through functions in text based languages) you can read in the ADC (analog to digital channels) and get the value from your feedback sensor. How the voltage corresponds to the position will depend on the sensor and system you have.

Regards,
Michael
0 Kudos
Message 10 of 13
(5,007 Views)