LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Motor Speed PID control with PWM

Hello 

I'm student from Thailand that are newbie in Labview.

I am working on speed control with PWM using PID in close loop control, The programe I tried is not working at all, motor speed is swing up and down.ni community.JPG

Here is my device 

NI 9269 use to generate PWM signal, high and low signal into L298n motor drive module

Can any one could help me.

Thank you

 

0 Kudos
Message 1 of 6
(3,173 Views)

Hi Nonters,

 

Regarding being new to LabVIEW, I'd suggest the following first steps:

  • Always try to reduce the number of bends in your wires, and keep them as straight as possible (this doesn't mean no bends, but say no more than 3 or 4 per section)
  • Have data flow from left to right - this makes it much easier to understand where the inputs (left side) and outputs (right side) are, and the bits in the middle are the bits in the middle, as it were
  • As a more difficult change, try reading this article: Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications. This isn't strictly necessary, but using DAQmx rather than Express VIs for Data Acquisition and avoiding the Dynamic Data Type (blue wire you see in most of your VI) will make it easier to understand (especially from a picture) and remove an entire group of common "new programmer" bugs related to the DDT and its behaviours.

Please go ahead and rearrange your VI a little, and if possible read about DAQmx functions, then kindly upload the VI or a snippet so that readers on the forum can directly open your code and check things out - this makes it much easier to give specific advice.

 

At a guess from the picture (could be wrong, hard to tell from the image) I'd say you may have a problem with the Merge Signals block and what you're writing to the NI 9296. Probably it isn't what you expect...


GCentral
Message 2 of 6
(3,015 Views)

Thank you for your kind respond.

Appreciate it. 

0 Kudos
Message 3 of 6
(2,841 Views)

@Nonters wrote:

Thank you for your kind respond.

Appreciate it. 


You're welcome. On the topic of thanks (since you brought it up) usually we indicate thanks on this forum by giving kudos - the gold stars under posts that you can click on to give.

 

We also mark posts as solutions when they solve your topic, but since I expect you'll probably have more questions on this same topic I don't suggest you do that yet - typically after marking a thread as solved there will be fewer new people reading it and you'll be less likely to receive new responses (so do this only when you're done with that specific question and ready to move on).

 

On that topic, please feel free to post again here if you have more questions about this question. If you have a different question, feel free to open a new thread in a one-thread-per-question manner.


GCentral
Message 4 of 6
(2,835 Views)

Hello, I have a question. If I use myRIO to implement the speed of DC motor to hardware implementation, must I change the NI 9296 to myRIO block?

0 Kudos
Message 5 of 6
(760 Views)

Hi tyralee,

 


@Tyralee wrote:

 If I use myRIO to implement the speed of DC motor to hardware implementation, must I change the NI 9296 to myRIO block?


Yes.

Also implement all other suggestions...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(744 Views)