Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Using NI Motion 7344 to generate triangle waveform

Hi,

I have a NI Motion 7344 4-axis card and would like to generate a 60Hz triangle waveform (Is it possible to have faster frequency if I want to?). I am wondering what's the best way to go about this? I'm planning to use the output (amplitute 100mV - 2V) to drive a galvo scanning mirror. I'm thiking to use a while loop and with the "Load DAC.flx" to load incremental values the DAC, but this may not be the proper approach.

Thanks for your help.

0 Kudos
Message 1 of 9
(7,329 Views)

Hi Ghulam,

 

I think you’re on the right track with the Load DAC.flx, I believe that is the proper approach when generating analog output signals from the 7344 motion card. You could put the Load DAC.flx in a while loop and just update the signal with a triangle waveform. You can refer to the documents below for more detailed information.


How do I use the Analog Outputs from an NI PCI-7344 Motion Controller in Measurement & Automation Explorer?
http://digital.ni.com/public.nsf/allkb/04B940903BDD987C862579320083C6FF

 

Generate Analog Output Signal From Motion Board
http://zone.ni.com/devzone/cda/epd/p/id/2806

 

Tim O

Applications Engineer
National Instruments
0 Kudos
Message 2 of 9
(7,285 Views)

Thanks Tim.

How can I control the timing though? it is important to have the triangle frequency exact, and not varying over time due to some other processes. Aslo I need 512 per sample (or around that numder, as long as it remains constant for each run).

Thanks again for your attention.

0 Kudos
Message 3 of 9
(7,282 Views)

Hi Ghulam,

 

If you are running on a windows system I do not believe you will be able to achieve deterministic timing from analog out with this motion card, but you might be able to get close. You could put the Load DAC.flx in a while loop with a Wait Until Next ms VI. You can then update your Load DAC.flx ever while loop iteration. The while loop will be controlled by the Wait Until Next ms time as long as the time it takes to process the loop is less than the time on the wait VI. If you need to have deterministic timing you may have to use a real time system or you could use a hardware timed Multifunction DAQ device with analog out.

 

Wait Until Next ms Multiple Function
http://zone.ni.com/reference/en-XX/help/371361E-01/glang/wait_till_next_ms_multiple/

 

Tim O

Applications Engineer
National Instruments
0 Kudos
Message 4 of 9
(7,267 Views)

Is there any way to take advantage of the PID update rate (62.5 microsec)? How about using On-board programming? Is there any routine that can be implemented so that  the traingle waveform is generated  On-board and take advantage of the minimum On-board timing (which is 62.5 microsecond)?

Thanks again!

0 Kudos
Message 5 of 9
(7,264 Views)

Hi Ghulam,

 

The only way to take advantage of the 62.5usec PID rate is to actually use the PID loop. You have to load a position (which doesn't have to be a position; it could be a force, a velocity,etc) and then based on the feedback and the PID gains, the PID loop will update the analog output at 62.5usec. However, you don't have direct control of the output; its value is determined by the setpoint, the feedback, and the PID gains. If your feedback always returns 0, you might be able to produce a triangular waveform by carefully choosing your setpoints and PID gains. However, I would worry about the DAC precision, the fact that you would have to make a sharp corner and the onboard interpolator would round it, etc. You could probably get something approaching a triangle waveform, but with rounded corners.

 

If what you want is a hardware timed triangle wave, you need a DAQ card. The motion card is not well suited for this application, even with onboard programming. The motion card is best suited for taking position, velocity, and acceleration parameters and turning them into motion.

 

Thanks,

0 Kudos
Message 6 of 9
(7,258 Views)

OK. Thanks.

Now we are planning to buy the NI PCI-6229 to do job. Do you think this is a good investment for the task? Essentially, we need a 60-100Hz (tiangle) waveform to be generated with a minimum of 500 samples per cycle.

0 Kudos
Message 7 of 9
(7,254 Views)

Hi Tim!

I have a similar application. I have 2 galvomirrors(mirrors driven by motors). My application requires the code to identify the rising edge of the hardware trigger and sendout a sample voltage value and hold that value until the next rising edge appears and then output another sample voltage value and hold it. Basically output and hold and its  a retriggerable task.So my motor is following a triangular waveform with 200 samples in each period .For example if I want my triangular waveform of 20kHZ then for 200 samples in each period i give a hardware trigger of 4MHz. I am using a PCI6711 card now..

can you please provide me with example codes relavant to my application and suggest me how to go about it as I  just  started learning labView a month ago. 

0 Kudos
Message 8 of 9
(4,212 Views)

Hello Munawar31,

This is a pretty old forum thread that you have posted to.  I think you will get better responses if you post your question to a new thread.  You may also want to clarify your application with a diagram as well, as I had trouble visualizing a triangular wave when I think of a voltage value being held until the next rising edge appears. 

 

All the best in your project! 

Clemens | Technical Support Engineer | National Instruments
0 Kudos
Message 9 of 9
(4,182 Views)