Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

Setting up a 4 motor PWM System


  • Please log in to reply
1 reply to this topic

#1 webbrauzer

webbrauzer
  • Members
  • 1 posts

Posted 26 August 2012 - 05:18 AM

Very new to LabJack :unsure: .

Question 1:
We are trying to drive a 4 motor system with U3-LV, but only one motor at a time with PWM. We have a motor driver board that connects directly to the J2 connector on an U3 OEM board. From J2 we connect to all 16 pins: C0-C3 and E1-E4 and others via the 2 X 8 connector. We would like to drive the motor board with PWM. Can we use PWM for all of the 4 motors at one time or is it possible to dynamically move the timers/counters by reassignment as needed to move one motor at a time?

C3,C2 connects to motor1 driver board inputs, C1,C0 connect to motor 2 driver board inputs, E4,E3 connect to Motor 3 driver board inputs and E2, E1 connect to the Motor4 driver board inputs.

Please correct me if I am wrong,but only the E1-E4 outputs can be used with the PMW commands correct? If I am stuck with the motor driver board design I have is there anyway that you could think of to use C0-C3 to command the motor board?

The PWM uses low level commands, I assume, is there any way we could use those low level commands on C0-C3 to do PWM, if we can't use PWM high level commands because of the IO assignment constraint?

Our motor driver board truth table is:
Logic Motor drive output voltages
IN1, IN2 OUT1, OUT2
0 0 undefined undefined
0 1 0V 12V One Direction
1 0 12V 0V Other direction
1 1 0V 0V Brake

Question 2:
How many Counters and or Timers must be used to do a single motor's PWM?

Question 3:
The second issue is if I were only to use E1-E4 until another solution is found for the C0-C3 pins(question 1). I need to run the motors in both directions. So we were planning to hold IN1 at logic0 and pulse IN2(PWM), then for the opposite direction hold IN2 at logic0 and pulse IN1(PWM). My question is are the LJ commands flexible enough to allow us to direct the PWM, pulsing to any one EIO?

Question 4:
The motor driver board also has a current sensing circuit on it but the range is only 0.3Volts. In your opinion, is this large enough range to get out of the typical noise I would see on that line?

Question 5:
We were leaving the FIO open for possible other inputs needed. If we need closed loop feedback using the quadrature input (Mode 8) with the FIO-0 to FIO-7 inputs will that be possible because :

"The U3 has 2 timers (Timer0-Timer1) and 2 counters (Counter0-Counter1). When any of these timers or counters are enabled, they
take over an FIO/EIO line in sequence (Timer0, Timer1, Counter0, then Counter1), starting with FIO0+TimerCounterPinOffset."

We would be using PWM on EIO so is it possible to use this And the Quadrature input?


Regards, Jerry

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 27 August 2012 - 04:29 PM

Please correct me if I am wrong,but only the E1-E4 outputs can be used with the PMW commands correct? If I am stuck with the motor driver board design I have is there anyway that you could think of to use C0-C3 to command the motor board?

The two timers can appear from FIO4 up to EIO5. There is no way to get them to appear on CIO terminals.

The PWM uses low level commands, I assume, is there any way we could use those low level commands on C0-C3 to do PWM, if we can't use PWM high level commands because of the IO assignment constraint?

PWM is done by enabling and configuring timers. The timers are a feature in hardware. The only way to get PWM out on CIO lines would be to toggle them in command/response mode to create PWM through software timing, which takes 0.6ms (or more) each time you want to update the state of the lines:

http://labjack.com/s...users-guide/3.1

Question 2:
How many Counters and or Timers must be used to do a single motor's PWM?

You need 1 timer to output a PWM signal. The U3 has 2 timers total.

Question 3:
The second issue is if I were only to use E1-E4 until another solution is found for the C0-C3 pins(question 1). I need to run the motors in both directions. So we were planning to hold IN1 at logic0 and pulse IN2(PWM), then for the opposite direction hold IN2 at logic0 and pulse IN1(PWM). My question is are the LJ commands flexible enough to allow us to direct the PWM, pulsing to any one EIO?

You could enable 2 timers with an offset of 8, which would put Timer0 on EIO0 and Timer1 on EIO1. Then pass the timer outputs through inverters and set the duty-cycle to 100% to get a solid low on one or the other (see last paragraph of Section 2.9.1.1):

http://labjack.com/s...users-guide/2.9

http://labjack.com/s...s-guide/2.9.1.1

Question 4:
The motor driver board also has a current sensing circuit on it but the range is only 0.3Volts. In your opinion, is this large enough range to get out of the typical noise I would see on that line?

A low-voltage analog input such as FIO4 has a resolution of about 600uV with a typical noise level of just 1 count or so.

Question 5:
We would be using PWM on EIO so is it possible to use this And the Quadrature input?

Quadrature needs 2 timers per encoder, so if you use even a single timer for PWM output you will not have enough left for quadrature.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users