|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
PWM
How do you use PWM 2 and 3 for roboRIO?
|
|
#2
|
|||
|
|||
|
Re: PWM
There's not enough information in your question to really be able to answer. What language are you talking about?
|
|
#3
|
|||
|
|||
|
Re: PWM
We are using Labview.
|
|
#4
|
||||
|
||||
|
Re: PWM
Right click the 2 Motor vi in begin and replace it with the 4 motor vi. Now you should have the option for 4 pwm ports instead of two.
|
|
#5
|
|||
|
|||
|
Re: PWM
When we change 2 motor vi to 4 motor vi it makes the program not runnable. What did we do wrong?
|
|
#6
|
|||||
|
|||||
|
Re: PWM
If you do a direct replacement of Open 4 Motor for Open 2 Motor where the PWM constants have already been defined, then the PWMs can end up wired to the wrong spots (and there may not be enough of them, or too many).
This is also true if you use the speed controller pull-down selector to change from a PWM to a CAN type of control. You need to remove the old PWM constants and create->constant new inputs. When you replace a vi with another, it's safest to also delete any input constants and recreate them, so they end up correctly wired to their new input spots. Last edited by Mark McLeod : 01-02-2016 at 19:39. |
|
#7
|
|||
|
|||
|
Re: PWM
What are the constants for the FRC roboRIO project?
|
|
#8
|
|||||
|
|||||
|
Re: PWM
Here's how to add a constant using the attached image as a reference.
|
|
#9
|
|||
|
|||
|
Re: PWM
Where do you find open 4 motor?
|
|
#10
|
|||||
|
|||||
|
Re: PWM
It's in the Robot Drive palette:
Last edited by Mark McLeod : 10-02-2016 at 20:19. |
|
#11
|
|||
|
|||
|
Re: PWM
Is there any thing else we need to do to get it working?
|
|
#12
|
|||||
|
|||||
|
Re: PWM
I'd suggest posting your Begin.vi and Teleop.vi here for us to check for you.
They are both located on you PC in the Documents folder under LabVIEW Data and then in your 2016 Robot Project folder. You can post attachments using the Manage Attachments button on the Reply to Thread page. |
|
#13
|
|||
|
|||
|
Re: PWM
A Victor SP is attached to PWM 0 that drives the rear left motor and PWM 1 is connected to rear right. A Victor 888 motor controller is connected to PWM 2, running front left and the PWM 3 is running front right.
|
|
#14
|
|||||
|
|||||
|
Re: PWM
There is a little anomaly in Begin.vi with both
- the constants for PWM 0 and PWM 1, and - the Inverted flags They still have the labels from previously being part of an Open 2 Motor. I'd recommend that you delete those four constants and do a create constant for them again. After you've gotten new constants there, turn on the label for each of them by hovering the cursor over them and right-clicking to get the popup menu and choosing Visible Items -> Label (You can drag the labels around to better places too if you would like.) With the Open 4 Motor there are also two more Inverts located along the bottom edge of the Open 4 icon that you need to create constants (and labels) for. An issue is that because you had constants left over from the 2 Motor, they reverse only one of the motors on the left side (I think the left rear). So the left side motors would be fighting each other. So, make sure to Invert both Left side motors (make them T for true). If when you test the robot you find that the front and back are reversed, then just reverse all the Inverts and make the Left side motors False and the right side motors True. Last edited by Mark McLeod : 12-02-2016 at 19:53. |
|
#15
|
|||
|
|||
|
Re: PWM
Thank you for all your help. our programming is going well now.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|