Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

real-time < DA / AD / Encoder > control

I want to control my motor using 5 functions per loop.

 

flex_read_adc16_rtn(boardID, ADC1, &adc);

flex_read_adc16_rtn(boardID, ADC2, &adc);

flex_read_pos_rtn (boardID, axis, &encoder);

flex_load_dac (boardID, DAC1, dac, 0xFF);

flex_load_dac (boardID, DAC2, dac, 0xFF);

 

But it takes 8ms/loop (125Hz).

It’s too slow to use in my application. I need 1KHz.

 

Later, I tried < Onboard > programming.

It takes almost 8ms/loop too.

It’s still slow.

 

Below are my programs.

<01.c>, <02.c>

 

Thanks

Message Edited by jinyjie on 10-09-2008 08:51 AM
Download All
0 Kudos
Message 1 of 11
(5,104 Views)
We need some more information.  What board are you using?  Are you trying to perform your own control loop?
0 Kudos
Message 2 of 11
(5,096 Views)

I have some programming problems with <7350 Motion Controllers (8axis)>.

 

I use VC++ 7.1 for programming.

 

For some reasons, I use AD/DA/Encoder functions for my motor control.

0 Kudos
Message 3 of 11
(5,087 Views)

Hi jinyjie,

 

if you want to run your own control algorithm, the 73xx boards are definitely not the right product for you. The onboard DSP on NI motion control devices has fast and direct access to the I/Os and it runs the trajectory generation and the control algorithm. The host PC can access the I/Os only indirectly through the onboard microprocessor and this takes some time. There is no chance to run a control loop on your host PC with 1 kHz.

 

In fact if you want to implement your own motion control algorithm, you don't need a motion control board at all, but you should use a multifunction DAQ device in a - and that's important! - real-time environment. Stable software loop rates of 1 kHz and above are hard or even impossible to accomplish on a Windows based system. The best option that NI could offer for your approach is using LabVIEW Real-Time and the NI SoftMotion Development Module.

 

If you are familiar with C programming and don't want to switch to a graphical approach, LabWindows/CVI Real-Time is also a very good option for you. Even though the NI SoftMotion Development Module makes live much easier when developing a real-time based motion control application it is not mandatory. I mention that, as this module is only available for graphical programming and not for text based programming.

 

If you want more in-depth information, please be more specific about the scope of your application and I will be happy to discuss alternative approaches in more detail with you.

 

Thanks,

Jochen Klier

National Instruments

Message 4 of 11
(5,074 Views)

hello.

 

I want use

 

flex_read_adc_trn();

 

but there are some noises in input voltage.

 

Is there adny method to reduce noises?

 

<7350 Motion Controllers (8axis)>.

<VC++2003 programming>

Message Edited by jinyjie on 11-01-2008 02:33 AM
0 Kudos
Message 5 of 11
(4,942 Views)

Jinyie,

 

as the 7350 is not a data acquisition device, there are no advanced features for signal conditioning available. With a hardware clocked device you could use some simple approaches like oversampling and averaging or digital filtering to reduce noise, but that's not an option for 73xx devices. The only thing you could do is using an external filter circuitry to reduce the noise of your signals.

 

Jochen
0 Kudos
Message 6 of 11
(4,914 Views)
tre
0 Kudos
Message 7 of 11
(4,825 Views)
Hello I have DAQ6221, and using VC2003 for programming. I want know how to measure time of one control loop.The times taken in every control loop are constant. Or, how to measure velocity and acceleration.
0 Kudos
Message 8 of 11
(4,822 Views)

Hi jinyjie,

 

Your "control loop" on your DAQ 6221 will be completely software dependent.  How fast are you looping your daq commands (analog input and output, I assume) in your VC program?

Chris Bolin
LabVIEW Partner Program, CLA
Message 9 of 11
(4,800 Views)

1~3ms for one loop.

 

0 Kudos
Message 10 of 11
(4,794 Views)