12-03-2018 06:26 PM
Hello, friends. I am still learning my way around NI products/software. I would greatly appreciate your thoughts. In short, the following are my project goals:
1. I am trying to power a 12V DC motor that draws 1 amp with a clean 50kHz PWM signal.
2. I want to record the real-time PWM voltage signal (actual waveform and amplitude) seen by the motor with excellent accuracy.
Background:
I have 6008 and 6259 NI-DAQ's but can purchase more.
So far I have accomplished these goals by using a cheap PWM controller powered with a cheap ~12V, 2 amp power supply. The power supply output is not precise (i.e. measured at 12.22V), and the PWM signal is noisy. I measured the PWM signal using a voltage divider to halve the signal from 12V to 6V in order to be recorded with the 6259 DAQ (max input is +-10V) at 500kHz. I then divided the recorded signal by the voltage divider multiplier when processing the data in MATLAB to recover the correct amplitude. This process worked but had many sources of error.
My thoughts:
In a perfect world, there would be a NI DAQ with 12V output at 1 amp. Then LabVIEW could generate a 12V PWM signal that goes directly to the motor while easily recording the high-quality signal. This product might not exist, but there is more likely a cheaper solution.
I see others recommend using op amps to increase the DAQ's analog output from 10V to 12V, but this still won't support 1 amp. Is this true?
I am thinking my current setup could be immediately improved by buying a more accurate 12V power supply and voltage divider, but the PWM controller is still junk.
I could use LabVIEW to generate the PWM signal while recording it, foregoing the need for a voltage divider. What type of independent driver should I use that accepts a power supply and LabVIEW generated signal to drive the motor? I have seen others mention half bridge drivers. I am concerned that a driver will introduce inaccuracies/noise such that the signal recorded in LabVIEW is not representative of the signal waveform/amplitude reaching the motor.
Thank you so much!
12-03-2018 09:37 PM - edited 12-03-2018 09:38 PM
Hi Big_Blue,
Maybe you can googling or create your own mosfet motor driver. You can control 12 V dc motor with more than 1 A using 5 V input..
it can be one of your ref : http://2.bp.blogspot.com/-d72zY7fT900/VogkDNmyk5I/AAAAAAAAACU/En9KcL-HdIA/s1600/kie.JPG
12-04-2018 11:47 AM
A simple 50 cent MOSFET is all you need to control a higher voltage/current with any digital output.
Also there are plenty of H-bridge based high current motor drivers out there available for a couple bucks.
01-14-2019 01:53 PM - edited 01-14-2019 01:56 PM
I greatly appreciate everyone's help thus far. I have purchased an A4950 motor driver (datasheet: https://www.digikey.com/product-detail/en/allegro-microsystems-llc/A4950ELJTR-T/620-1400-1-ND/262634...). I am still struggling to make my system work, though.
To recap, my goal is to control a 12V DC motor with the A4950 motor driver, a PWM signal generated in Labview, and the NI USB-6259 device.
This is my block diagram. It generates a square PWM signal, and allows me to save this signal if "Collect Data" switch is true. I have checked this with an oscilloscope, and the code is correctly creating a 0-5V square signal at 50kHz with adjustable duty cycle 0-100%. The output is the AO 0 (pin 15) of the NI6259.
The following are my connections for the A4950 motor driver:
-Pin 1 (GND): ground
-Pin 2 (IN2): grounded to set to "low"
-Pin 3 (IN1): NI6259 AO 0, so the "high" logic input is the 0-5V PWM signal
-Pin 4 (VREF): no connection
-Pin 5 (VBB): 12V power supply
-Pin 6 (OUT1): motor positive terminal
-Pin 7 (LSS): no connection
-Pin 8 (OUT2): motor negative terminal
Note: Pins 4 and 7 are unconnected because these are for "adjustable current limit," which is not something I think I need. I could be mistaken.
When everything is connected and running, the motor does not move at all. What am I doing incorrectly or misunderstanding? Thank you so much!
01-14-2019 01:57 PM
I greatly appreciate everyone's help thus far. I have purchased an A4950 motor driver (datasheet: https://www.digikey.com/product-detail/en/allegro-microsystems-llc/A4950ELJTR-T/620-1400-1-ND/262634...). I am still struggling to make my system work, though.
To recap, my goal is to control a 12V DC motor with the A4950 motor driver, a PWM signal generated in Labview, and the NI USB-6259 device.
This is my block diagram. It generates a square PWM signal, and allows me to save this signal if "Collect Data" switch is true. I have checked this with an oscilloscope, and the code is correctly creating a 0-5V square signal at 50kHz with adjustable duty cycle 0-100%. The output is the AO 0 (pin 15) of the NI6259.
The following are my connections for the A4950 motor driver:
-Pin 1 (GND): ground
-Pin 2 (IN2): grounded to set to "low"
-Pin 3 (IN1): NI6259 AO 0, so the "high" logic input is the 0-5V PWM signal
-Pin 4 (VREF): no connection
-Pin 5 (VBB): 12V power supply
-Pin 6 (OUT1): motor positive terminal
-Pin 7 (LSS): no connection
-Pin 8 (OUT2): motor negative terminal
Note: Pins 4 and 7 are unconnected because these are for "adjustable current limit," which is not something I think I need. I could be mistaken.
When everything is connected and running, the motor does not move at all. What am I doing incorrectly or misunderstanding? Thank you so much!
01-15-2019 01:55 AM
Pin 4 (VREF) should also be connected. See the table on page 4 of the datasheet.
Also your datalogging block won't work, it will execute after the other block.
01-15-2019 01:09 PM
Hi LennartM, thanks for your reply. What should Pin 4 (VREF) be connected to? I thought you only needed Pin 4 connected if you want to monitor the current from Pin 7 (LSS).
The datalogging block prompts me to save after collecting data for several seconds, so this works to my satisfaction. I have used the same layout with other projects. Thank you for your input. My main concern is powering the motor with a Labview-generated PWM through a motor driver.
01-16-2019 01:55 AM
From what I understand the chip has a current limiting function. Which is set by the voltage on Vref and the resistor on Lss. Vref/(10RS) = Itripmax. I am not sure if it works without anything connected.
01-24-2019 10:09 AM
I appreciate everyone's input. I was unable to solve my issues, so I ended up using a SparkFun motor driver because the documentation is thorough and straightforward. Although not ideal, this will work for now.
I am still struggling with data collection. If anyone is interested in helping me further, I would greatly appreciate it! The discussion I started for this named, "How to collect data for n seconds after pressing button" and is found here: https://forums.ni.com/t5/LabVIEW/How-to-collect-data-for-n-seconds-after-pressing-button/m-p/3885903...