LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM signal with usb-6000 digital output

Solved!
Go to solution

Can someone help me out with or give me some direction on how to create a PWM signal from digital output in Labview.  I can figure out how to write a digital signal just fine, I’m just not sure how I’m going to create timely switching (at a specified duty cycle and frequency).

0 Kudos
Message 1 of 15
(582 Views)

Hi jseele,

 

your USB6000 is considered "cheap" and so it doesn't support Counter output tasks (like for PWM generation).

 

You still can switch a DO pin on anf off to create a (rather slow) PWM signal on your own…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 15
(571 Views)
Yes that’s my plan.
0 Kudos
Message 3 of 15
(526 Views)

Hi jseele,

 


@jseele69 wrote:
Yes that’s my plan.

So you need a loop running the same content again and again: switch ON the DO, wait x1, switch OFF the DO, wait x2.

X1 and x2 should be in the order of 10th of ms (atleast), but you still need to live with jitter…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 15
(524 Views)

I don’t think that a small amount jitter should be a concern, I’m trying to generate control signals for an esc to drive a brushless motor.

0 Kudos
Message 5 of 15
(505 Views)

@jseele69 wrote:

I don’t think that a small amount jitter should be a concern, I’m trying to generate control signals for an esc to drive a brushless motor.


Actually, that is a concern; commercial RC ESC works on a 20ms period with a 1-2ms pulse width. In case of software timed control, you will not be able to reliably vary the pulse width in the range of 1-2ms and repeat it every 20ms.

 

The easiest way is to get an Arduino, and use the Hobbyist toolkit.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 6 of 15
(492 Views)

Your answer doesn’t make sense to me.  I have previously used Arduino, but want to get rid of it and use a more professional setup.  

Arduino uses a 490 Hz (~ 2 ms period) pwm frequency.  You are correct about the pulse width however. 

0 Kudos
Message 7 of 15
(486 Views)
Solution
Accepted by topic author jseele69

So, you seem to have the fancy ESC that can update at 490Hz instead of the regular 50Hz.

 

In any case, the point I am making is that in software-timed Digital Output, the resolution of digital level changes happens in the order of ms. Which is too slow for your use case because, to generate 0% throttle, you need to set the signal high at 0ms and set it back low at 1ms, now, to set the throttle at 50%, you need to set the signal high at 0ms and low at 1.5ms. 

 

Now, if you notice, windows may not reliably send the signal low command at exactly 1.5ms, instead it could be 2ms, which is already 100% throttle of the ESC.

 

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 8 of 15
(481 Views)

Hi jseele,

 


@jseele69 wrote:

Your answer doesn’t make sense to me.

I have previously used Arduino, but want to get rid of it and use a more professional setup.


Your answer doesn't make sense to me!

You replace the Arduino (with a rather fine PWM resolution) by a cheap USB6000 and talk about "using more professional setup"???

 

When you would work in a more professional way then you would check the datasheets of the hardware you want to use and then buy some hardware that actually meets your requirements…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 15
(464 Views)

That wasn’t an answer, it was an attempt to understand your explanation of why the PWM won’t work on the usb.

 

Also, I was already using the usb for data acquisition and was told it would work for the PWM signal.

 

When I say a more professional setup, I mean compact and efficient use of space.  The Arduino doesn’t suit me because it’s only being used for one (relatively simple) task.  With my experiment the arduino and wiring gets very messy and tangled.

0 Kudos
Message 10 of 15
(452 Views)