01-27-2015 09:18 PM
I am using NI Motion card UMI-7764 and using c-language to control DC motor. I am using flexmotion library from NI and able to read the encoder value from NI Motion card using the function flex_read_encoder_rtn(boardID, axis, &encoderCounts). Now I am willing to control a dc motor using PID control depending upon my desired position but I don't know how to send the output of PID control to the DC motor conneted to my NI Motion card. Please guide me how can I do that.
Right now I have tried function flex_load_dac(boardID, NIMC_DAC1, (positionCommand), 0xFF) but it is not working.
Thank you.
Best Regards
Nabeel
01-28-2015 05:06 PM
If you navigate your Start Menu to All Programs->National Instruments-> Motion -> Documentation, do you see examples listed in that folder? There are several examples that should provide a starting point to control a motor there.
01-28-2015 05:50 PM
yes I have checked that folder but there is no example. I can read the encoder value from NI Motion card but when I am trying to set voltage to roate motor, it is not rotating. I have made the program in LabVIEW and it is working fine but I have do it in c-language. Any help?
01-28-2015 08:43 PM
could you please guide me what is max sampling rate of NI Motion card??
01-28-2015 09:14 PM
I am using the attaced code provided by NI but motor is not moving at all, is there any configuration problem? but when I am using LabView code it is working file that's I am thinking that my configuration is correct. please guide me.
01-29-2015 11:14 AM
Does the code return any errors or does the motor just not run?
I'm assuming you've made no modifications to the hardware setup itself. You're just changing from LabVIEW to C and using the identical setup. Is this correct?
01-29-2015 03:53 PM
01-30-2015 04:38 PM
Did you choose the same profile you were using to see that behavior on LabVIEW or were you also getting 3ms with LabVIEW?
01-31-2015 12:03 AM
yes I am also getting 3ms in LabVIEW.
02-02-2015
08:39 AM
- last edited on
11-21-2024
09:15 AM
by
Content Cleaner
Motors have maximum limits. Are you reaching the maximum for your motor? If not, take a look at this: https://www.ni.com/docs/en-US/bundle/371242b/resource/371242b.pdf