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 pwm voltage u3HV


  • Please log in to reply
9 replies to this topic

#1 idans

idans
  • Members
  • 6 posts

Posted 26 March 2015 - 07:58 AM

hi

i want to controll a dc motor using u3 hv,i searched the user guide and example but i didnt find

how to set the pwm lotage to +/-10.8v . i use labview to program u3 so which vi i need to do so?

 



#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 26 March 2015 - 11:41 AM

You cannot adjust the voltage of the PWM output.  It is 3.3V/0V.  The timer drives a digital output between output-high and output-low:

 

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

 

http://labjack.com/s...form-generation

 

 

Also, how much current do you need?  Sounds like you need a 10.8V power supply which you feed to an H-bridge, and then the U3 controls that H-bridge.  Or better yet, get some sort of motor controller and have the U3 control that.



#3 idans

idans
  • Members
  • 6 posts

Posted 30 March 2015 - 06:36 AM

hi again

ok i understood this point , i had to read more carfully the u3 spec...

now i have h cbridge that need to get two pwm input if i want the motor run farward and backward.

is it possible that both pwm output will run at the same frequency ?



#4 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 30 March 2015 - 08:40 AM

Yes.  The U3 has 2 timers.  If both are set to PWM16 they will be at the same frequency, and if either is set to PWM8 it will be 256x the frequency of the PWM16:

 

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

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



#5 idans

idans
  • Members
  • 6 posts

Posted 16 April 2015 - 06:53 AM

i want to controll a dc motor, therefor i need 2 pwm16 outputs connected to full h bridge (L298n) for farward and backward controll. 

i programmed a controller in labview ,see attached file, based on pwm example.

i found one pwm port at fio4 but i didnt find the other one.. what port is for timer 1 output? 

did i confiured the timers correctly? what do i have to do in order to configure both timers ans counter0?

idan



#6 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 16 April 2015 - 11:06 AM

If pinoffset=4, then Timer0 will be on FIO4, Timer1 will be on FIO5, and Counter0 will be on FIO6:

 

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

 

The UD driver interface for timers & counters is documented in Section 4.3.6, but you are probably using eTCConfig and eTCValues so also check out Section 4.3.9:

 

http://labjack.com/s...ers-guide/4.3.6

http://labjack.com/s...ers-guide/4.3.9

 

 

I suggest you start with the test panel in LJControlPanel.  You can configure the timers/counters as desired and see how the hardware works.

 

After you test in the test panel, then move to LabVIEW.  We did not get an attachment, and even if we did there is a good chance your LabVIEW version is too new and we would not be able to open your VIs.  If you still have trouble, I suggest you post screenshots.



#7 idans

idans
  • Members
  • 6 posts

Posted 19 April 2015 - 12:39 AM

If pinoffset=4, then Timer0 will be on FIO4, Timer1 will be on FIO5, and Counter0 will be on FIO6:
 
http://labjack.com/s...users-guide/2.9
 
The UD driver interface for timers & counters is documented in Section 4.3.6, but you are probably using eTCConfig and eTCValues so also check out Section 4.3.9:
 
http://labjack.com/s...ers-guide/4.3.6
http://labjack.com/s...ers-guide/4.3.9
 
 
I suggest you start with the test panel in LJControlPanel.  You can configure the timers/counters as desired and see how the hardware works.
 
After you test in the test panel, then move to LabVIEW.  We did not get an attachment, and even if we did there is a good chance your LabVIEW version is too new and we would not be able to open your VIs.  If you still have trouble, I suggest you post screenshots.

 

 

thanks again and i checked the HW in labjack application and it  is semm to work fine.

i did as you said and that is in my labview code : pin offset is set to 4 that's why timer 0 is in fio4 ,

both timers are enabled and so counter 0 for motor encoder, init value for timer is 65535 for both timers.

but i dont find timer1 on fio5



#8 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 20 April 2015 - 03:58 PM

Have you tried the example "U3 2-PWM and Counter.vi"?  You can jumper FIO4 or FIO5 to FIO6 and see that either one is working.



#9 idans

idans
  • Members
  • 6 posts

Posted 20 April 2015 - 11:24 PM

my code is based on that example, the main diffrences are i seperated the counter reading from writing to timers and adding timing to for loop.

another question my encoder has two outputs ch A and B , now i want to increase accurecy by reading both channels , how that can be done?

do i need to add XOR gate before counter input ot it is already inside? moreover i wish to determine motor roatation direction from two channels readings

how i can do that?

thanks



#10 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 21 April 2015 - 08:02 AM

 

my code is based on that example, the main diffrences are i seperated the counter reading from writing to timers and adding timing to for loop.

 

If the example works, but not your code, then you need to look at the changes you have made to figure out what is not correct.  You can post screenshots (Alt-PrintScreen) if you need us to take a look at what you have done.

 

 

 

another question my encoder has two outputs ch A and B , now i want to increase accurecy by reading both channels , how that can be done?

 

If your encoder has A and B outputs, it is most likely a quadrature encoder.  If you want to keep track of forward and reverse movement, you need to use a pair of timers (i.e. 2 timers) in quadrature mode:

 

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

 

Keep mind that the U3 only has 2 timers, so 1 quadrature encoder will use both timers leaving you with none for PWM output.

 

 

 

do i need to add XOR gate before counter input ot it is already inside?

 

I don't see a reason for an XOR gate.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users