Hi I have one of your PS12DC boards and I will be using it to control a simple DC motor. I have read the documentation and what I am not sure about is how, if possible, do I control the speed of the motor? From what I can gather the board simply turns on and off devices attached to it with a voltage rated at the input voltage to the board. So for example if I connect an external 12V DC power supply I can then toggle the appropriate channel to set the output to the motor at 0 or 12V, is this correct?
Thanks, Stuart.
Hi Stuart,
The PS12DC is designed for switching power to a load from a 5-28V supply. The voltage at the load will either be ON or OFF, depending on the digital state of the IO line used to control the output (EIO0-CIO3). In order to change the speed of your motor you will need a variable voltage which can be created using Pulse Width Modulation (PWM) and the PS12DC. Here you will simply apply a PWM switching scheme to the channel your motor is on.
Two things to be aware of:
1. The maximum switching speed on the PS12DC is 6 kHz. That will be the upper limit for your PWM frequency.
2. Motors can be pretty hard on switching electronics. Review appendix D in the PS12DC data sheet where we discuss current limiting techniques when using large motors.
https://labjack.com/support/datasheets/accessories/ps12dc/appendix-d
How big of a motor do you plan on using?
Hi thanks for the reply. I will be using a 6-15V DC motor, which I will want to use the lower end. I will have another read of the documentation.
Thanks.
Hello again. It has been a while but I have finally got back to tinkering with the motor. I am now powering my 12V DC motor with a PWM signal from the PS12DC device. The PWM signal is generated by the labjack device and then read back into the device which is then sent to the appropriate register for the PS12DC board. I have a 100 ohm resistor connected in parallel to the source and ground connections for the DC supply (connected just off of the PS12DC terminals). I also have a 4.7 ohm ICL (inrush current limiter) connected in series with the source for the DC motor.
I have the motor working and the PWM does work, however at a constant duty cycle my motor does not run at a constant speed. it has random spikes at low and high speeds. I initially thought this could be due to the PS12DC's switching frequency limit but I have lowered the frequency to 50Hz (compared to the 2.5KHz max using the 100 ohm parallel resistor) and I still get the same problem.
Would you have any ideas what could be causing this?
Thanks,
Stuart.
A couple quick questions:
I'm initially looking to see if there is either something on the software side that is changing your PWM settings, or another load causing transients on the power bus as it is switched on and off.
Have you put a scope on the PWM (PS12DC output)? A change in the duty cycle will indicate a software issue and a shift in the peak voltage will point to transients on the power bus..
Hi I am using the T7 device and I am using LabView. Nothing else is being powered for the moment.
Unfortunately I don’t have access to a scope.
Thanks any help.
You can use the Pulse Width In extended feature if FIO0 or FIO1 are available in the absence of a scope:
https://labjack.com/support/datasheets/t7/digital-io/extended-features/p...
Pulse Width In returns the PWM high and low time, which you can easily calculate the duty cycle and monitor. If you see the duty cycle fluctuate we will know it's something with the software. Did you use one of our LV examples or is this a custom VI?
Have you updated the T7's firmware and the LJM driver to the latest versions?
T7 FW - Release(1.0188) Beta(1.0202)
LJM - Release(1.12) Beta(1.13)
I would update to the latest Beta versions if you haven't already.
I have now updated all of the above, but no difference unfortunately. I am only using your supplied VI's.
I have tested the PWM using the pulse width in extended feature and without using the PS12DC device the PWM high time is constant with no fluctuations.
I then measured the same using the PWM coming from the PS12DC and the signal is very erratic so I can say that the problem lies in how I am sending the signal to the PS12DC.
Is there an easy way to virtually make a PWM signal that I can send directly to the PS12DC switch register? as I am doing it quite a convoluted way.
Thanks for any help you can give.
Stuart.
I set up a small motor on the PS12DC to recreate your setup here. There is a small offset voltage when the PWM signal is OFF which is right in the transition region for the T7's digital inputs. Any variation in the OFF voltage will affect the duty cycle measurement. A noisy load (motor) will cause the off voltage to move around, and result in ambiguous duty cycle readings like what you see. The variation in the duty cycle measurement when connected to the PS12DC's outputs is expected.
I modified our PWM example to drive a small fan motor (12V DC) . I am not seeing the fluctuations in motor speed in my test test setup. Have a look at my example and see if it helps some.
Hi thanks for the detailed reply. I have had a look at the VI you supplied and it is what I have been doing to produce and read the PWM. Your example does not use the PS12DC, as far as I can tell. Does what you said at the start of the reply mean that I cannot use the PS12DC to produce a PWM to a DC motor?
My comment about the duty cycle measurement only applies to using the Pulse Width In extended feature when measuring the duty cycle at the PS12DC outputs. There shouldn't be any reason you can't use the PS12 to drive your motor. At least from my current understanding of your setup.
The example VI outputs a PWM signal on FIO0. You will see the PWM at S0 when the PS12DC is connected at the T7's DB37 connector. It should look like figure 2 in the PS12DC's data sheet (https://labjack.com/sites/default/files/2014/05/LabJack-PS12DC-Datasheet...). How do you have yours connected?
Are you detecting the fluctuations in motor speed with an encoder/tach or is it an audible change?
I have my PS12DC connected to the DB15 connector. I already have another board attached to the DB37 connector so I cant use that.
I can hear the fluctuations as they are quite large.
If you are on the DB15 connector you can con only use EIO0-5. The PWM Out is only available on FIO0,2-5, so I am assuming you are not using the PWM Out extended feature. Is that correct? Do you have a schematic/picture of your setup or the VI you are using to output the PWM signal? That might shed some light on the subject.
You might try disconnecting your T7 from your test setup and connect the PS12DC to the DB37 (no other connections). This will eliminate any external connections that might be causing problems, and you can run the example VI I posted. I ran a 12V motor at constant speeds with the example. We will know it is either something in your setup, or your VI, if your motor runs smoothly as well.
Hi sorry for not getting back to you, been rather busy lately. I have since solved the problem now that I have a better understanding of the PS12DC.
Thanks again.
Glad to hear you are up and running now. We are happy to help.