06-30-2024 09:13 AM
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).
Solved! Go to Solution.
06-30-2024 10:02 AM
07-01-2024 07:03 AM
07-01-2024 07:11 AM
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…
07-01-2024 04:46 PM
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.
07-01-2024 07:05 PM
@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.
07-01-2024 08:26 PM
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.
07-01-2024 09:37 PM
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.
07-02-2024 01:00 AM - edited 07-02-2024 01:00 AM
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…
07-02-2024 07:40 AM
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.