Usb-6501 Labview Example

48 views
Skip to first unread message

Florentina Holcombe

unread,
Aug 5, 2024, 10:46:41 AM8/5/24
to terkomscockhin
Thisis my first post, i read a few others but couldn't find the answer i needed, and it looks like everyone here has a pretty good opinion on things. I'm trying to use USB-6008/6009 DAQ cards to control the RPM of a electric motor. I want to use the digital output to generate a PWM, but I'm not sure exactly how to control the frequency of the Square Wave I want. So, I have a few questions...

2) I know i have to use the softaware to trigger the output, so I'm limited to how fast the software is going through the itterations, is it possible to get my signal reasonably to 50Hz while still having a descent amount of samples such that I can manipulate the duty cycle?


3) Has someone already done something similar to this and has code to give me a starting point? I'm in a bit of a jam with time . If not, i can try to get something together if it makes it easier for you guys to give me advice.


I would not recommend to use a 6008/6009 to create a stable PWM-signal. You would have to do everything by software, which limits you to a theoretical resolution of 1 ms, but even that is not stable. You never know what Windows is doing besides.


I recommend to use any M-series DAQ-card, and then create the PWM-signal with the counter of that card. Very easy to do, very stable. You can find code as a starting point within the NI-Examplefinder, look for examples about continous pulse train.


(2) Use the COM or printer ports for your digital PWM signal. I'm pretty sure you'll have less latency, but if I remember correctly you still get 1-5ms of jitter. Worth a try though (look up the printer port example in the ExampleFinder).


@jmtj6009: Oh, you want to control 4 motors. Then perhaps my suggestion is not the best one. You need 1 counter to control 1 motor, and a M-Series card has 2 counters. So you would need 2 M-series cards. Perhaps JustinReina's idea with the IC is also a good one.


also, NI has a single controller usb card (USB-6501) which has one counter channel which goes up to 5Mhz. Would it be possible to get a usb hub and plug in 4 of these bad boys and have stability in my signals? This would run me about 400 bucks since its 100/each which is pretty cheap.


Also, I'm not quite sure how it would work in the end, but does the microcontroller have an embeded program and oscillator? How would I use to talk to the controller, and what language do you use to program it?


So, I think i'm going to go with this path, Could you walk me through your code a little?Also, essentially, what should I be ordering? And when everything is finished, does this end with me inputing a voltage and then receiving a set frequency at a duty cycle proportional to the voltage?


*If your curious, I will be developing similar code (exactly similar) for a project coming in about two weeks. Figured if it helped you, I could just develop it now. Wont take more than an hour to write and debug.


I have some electronics background, definately enough to hook up some simple circuits. I'm a Mechanical engineer (will be at the end of this semester ) And this project is for my senior design project (need to control motors for the thrusters to my hovercraft). I asked around to my electrical engineering dept., but they were telling me stuff that sounded way more compliated than this.


I'll be using a Electrifly Hobby aircraft motor . The way we use it now is by sending generating the PWM signal through labview and sending the analog signal to an ESC card the motor comes with. I cant find a .pdf for the ESC, but when i go to school tomorrow i can scan it if you'd like.


As a caution, you may want to power the chip separate from you motor battery if possible. Not sure how much electrical noise you motor will generate it may be enough to cause erratic operation of the chip. Not sure if this is feasible for your craft due to additional weight. You may want to fire up the motor and check for noise with an oscilloscope then make a decision.


actually, we have a 40HP engine that will create a 36V power sink using some marine batteries that will be powering the motors seprately than all the other components of the craft. There is a seperate 12V alternator hooked up to the same engine that will be fed into an inverter to create the power source, which i think will be used for the controls. At this point weight really isnt an issue . We had 4 of us in the group stand on the hovercraft at once, plus all the other components (around 600 lbs total weight) and we were floating .


Maybe when those parts arrive, would you mind posting a semi-detailed circuit diagram and/or hardware diagram of your setup? Sounds like you got some serious stuff, just wanna make sure everything is kosher


Definately, no prob. The guy working on the Motor/Alternators will meet up with me tomorrow and i'll start drawing out a diagram to put together. I'll send it to you as soon as we finish it up. In retrospect, we should have talked with the EE department and tried to steal some students for our senior design project lol.


I have an application that has quite a few single input/outputs and a counter. The tasks are created in the beginning for the I/O and the task is created later in the code. What I recently observed is the task create for the counter now returns an empty string for the task and no error. What would cause this? The code had worked before. Some additional I/O was added in the earlier initialization as well as a second USB-6501 to the system. The code for the counter was not modified. I can't post the whole application but why would I get an empty task from the create with no error? Obviously, the counter is not working at this point. So, is there a maximum number of tasks that can be created on this device? If so, what is the number?


I am looking into producing 8 PWM signals using an NI-9401 in a cDAQ-9174. Ideally each PWM signal would be able to have a different duty cycle, but run at the same frequency (25kHz). From what I've read in the link below, I cannot accomplish this using counters.


I am thinking there is a way to do this by coding the digital outputs to run off the 20MHz hardware time base, but I'm not sure if this is feasible. I would appreciate it if someone could give me a quick answer as to whether my suggestion is possible or if I'm wasting my time.


I am using a NI9401 in Crio 9067 to produce sine PWM signal which will be fed into an inverter. The problem is that the output PWM signal is of 2.2V while i need the output voltage to be around 5V for the functioning of IGBTs in the inverter. Can anyone help me regarding this problem?


So I have two different PWM and I'd like to send one through one DO of my ni9401, and the other one through another DO of my NI9401 (and read the first one with one DI and the other one with another DI).


I'm using Python, and I already know how to create a multichannel task (with cDAQ)/Mod1/line0:4 for example), but after that, how do I tell it to write one PWM through only one of theDO and the other PWM through another DO. And I must write those at the same time.


If I connect 9478 and 9426 and set True to 9478 in LabVIEW, 9426 also read this signal as True. Up to this point, it is considered normal operation. However, when 9474 and 9426 are connected, 9474 is read as False when 9474's output is True, and 9426 is read as True when 9474's output is False. Is this the right behavior? Since the sourcing output and the sourcing input devices are connected together, a pull-down resistor is applied to the digital signal line. I also uploaded the hardware wiring diagram that I used. (Red is Vsup Node, and Blue is GND. Green line is digital siganl line.)


I am using a CompactRIO and am trying to dynamically control output data for an automatic test sequence, for example I want to turn on and off outputs for a certain length of time automatically without having any user input other than to start the program. Is there any examples of how I would go about doing this? I have already went through the examples in the help section and I could not find anything similar


Hi, I am using the NI DAQmx VI's in LabVIEW to write to and read from a circuit board for testing purposes. The hardware setup is the USB-6509 with SCB-100 in DIO/passthrough mode. The USB-6509 is switched to "LOW" in the rear of the box. In NI MAX, the pins are all set to "Tristate".


I have tried with both compare and drive signals, when I enter a value (e.g. 55AA) the highlighted portion of the selected waveform goes high. This doesn't look correct to me. I feel like I'm missing something even though there are a small number of settings to configure with this feature. I cant seem to find any documentation to support this and there is little discussed on NI forums.


Currently I'm still using old version of NI Elvis. The problem is, I was trying to connect the push button from labview to real LED which are available on the NI Elvis board. As usual, I used DAQ Assistant to set up the digital line output for LED. There are three groups of port available. Which output is suitable to be used?. The board has 4 PFI/O, 8 Digital output and 8 Digital input. Which output can be used to connect with digital device such as LED or buzzer. Thank you


I want to know the push pull drive current capability of SPI MOSI and MISO DIO lines of NI8452?. Is there any pullup resistor being used on SPI MOSI and MISO?. Can you please specify the PUSHUP/PULL strength, my board is having an weak pullup.


So that, I use a free DIO to generate a "flag" which trigger the acquisition as the acquisition is configured with "niHSDIO_ConfigurePatternMatchStartTrigger(vi,...)" function. As soon as the acqusition see a rising edge on that specific channel, it starts the acqusition.


We are using PCI-6221 I/O module connected to a NI SCB 68A. We try to read in/out digital signals from and to Simulink. For the screw terminals P0.0 to P0.7 we get a signal, since we need further digital signal ports we want to use the PFI ports as DIO but don't know how to configure them correctly. For better comprehension of our problem take a look at the attached figure. (green means: is working/ red: does not work/we don't get any signal)

3a8082e126
Reply all
Reply to author
Forward
0 new messages