01-14-2024 09:33 AM
Hello. I’m using the DAQ card 6361 and I want to use it to generate PWM single to control motor. First of al, I’m wondering what is the difference between PFI and PO pins ? Also, to which pin I connect motor to generate ? Thank you
01-14-2024 10:29 AM
This article explains it well - https://www.ni.com/en/support/documentation/supplemental/18/pinout-terminology-and-definitions-for-n...
PWM is generated using counters, and counters can be routed to PFI pins, and some pins are multi-functional.
Here is an example reference to generate PWM using counters - https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x1P0CAI&l=en-US
01-16-2024 12:31 AM
Hello. Thank you , this example was very useful and easy to use . I have another question related to it . So now , I send pwm and my motor works , and if I I need to send different signal , the motor stops and then starts with another pwm . My question is , is it possible gradually increase or decrease pwm without stopping the task ? For example, motor works with 15 % and I increase to 16, 17 and so on ?
01-16-2024 12:41 AM
Hi bezdoganna,
@bezdoganna wrote:
My question is , is it possible gradually increase or decrease pwm without stopping the task ? For example, motor works with 15 % and I increase to 16, 17 and so on ?
Yes, that's possible.
You can set a new PWM value while the task is running, it's the same as setting a new AO value while the AO task is running. With PWM the only limit is: you cannot change the PWM value twice within one PWM cycle…
01-16-2024 12:56 AM
So I can set it from 17 to 18% for example , but not further to 19 ? If I understand correctly
01-16-2024 01:16 AM
Hi bezdoganna,
@bezdoganna wrote:
So I can set it from 17 to 18% for example , but not further to 19 ? If I understand correctly
You can also set to 19%, but only in the next PWM cycle…
What is your PWM frequency? Let's assume it's 100Hz then you can set a new PWM value each 10ms, once for every PWM cycle…
01-16-2024 01:21 AM
Can you provide an example how to do it ? I don’t quite get it
01-16-2024 01:34 AM - edited 01-16-2024 01:34 AM
Hi bezdoganna,
@bezdoganna wrote:
Can you provide an example how to do it ? I don’t quite get it
Right now no.
Try:
Like this:
01-16-2024 01:43 AM
Currently I am using this code, I modified example form the LabVIEW. But for duty cycle I have array of values that are inputs, but before setting new PWM, motor stops and then initiated with a new value.
01-16-2024 02:17 AM
Hi bezdoganna,
@bezdoganna wrote:
Currently I am using this code, I modified example form the LabVIEW. But for duty cycle I have array of values that are inputs, but before setting new PWM, motor stops and then initiated with a new value.
When you call the whole VI just to change the duty value then it will start and stop the PWM task with each call.
Why don't you implement my suggestion in this VI to output all the duty cycle array elements in this loop?