Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   PWM (http://www.chiefdelphi.com/forums/showthread.php?t=142990)

ICE_Bear 01-02-2016 18:16

PWM
 
How do you use PWM 2 and 3 for roboRIO?

GreyingJay 01-02-2016 18:18

Re: PWM
 
There's not enough information in your question to really be able to answer. What language are you talking about?

ICE_Bear 01-02-2016 18:19

Re: PWM
 
We are using Labview.

samfruth 01-02-2016 18:21

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.

ICE_Bear 01-02-2016 19:28

Re: PWM
 
When we change 2 motor vi to 4 motor vi it makes the program not runnable. What did we do wrong?

Mark McLeod 01-02-2016 19:36

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.

ICE_Bear 09-02-2016 18:42

Re: PWM
 
What are the constants for the FRC roboRIO project?

Mark McLeod 09-02-2016 23:05

Re: PWM
 
1 Attachment(s)
Here's how to add a constant using the attached image as a reference.
  1. Drag an Open 4 Motor into the Begin.vi block diagram
  2. Put the cursor on the vi icon you just dropped and you'll see the input and output nodes highlighted (left of the attached image)
  3. Put the cursor on one of the input node until the cursor becomes a wirespool (on the left of the vi icon) and right-click to get a pop-up menu (seen on the right of the attached image)
  4. Navigate to Create->Constant and left-click
  5. You'll get a new constant attached to the node that is the proper type for that particular kind of node. In this case a PWM constant.
  6. The PWM constant by default starts as Invalid, so put the cursor on the new constant until the cursor becomes a hand, then left-click and choose the PWM it should be.

ICE_Bear 10-02-2016 19:58

Re: PWM
 
Where do you find open 4 motor?

Mark McLeod 10-02-2016 20:14

Re: PWM
 
It's in the Robot Drive palette:
  1. Right-click on any white space and you'll get the palette popup
  2. Put the cursor over the WPI Robotics Library at the bottom
  3. The top left icon is a folder for RobotDrive, move the mouse over that
  4. You'll see Drive Open 4 Motor
  5. Left-click and drag it to the block diagram

ICE_Bear 11-02-2016 17:46

Re: PWM
 
Is there any thing else we need to do to get it working?

Mark McLeod 11-02-2016 22:59

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.

ICE_Bear 12-02-2016 18:23

Re: PWM
 
2 Attachment(s)
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.

Mark McLeod 12-02-2016 19:46

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.

ICE_Bear 12-02-2016 20:01

Re: PWM
 
Thank you for all your help. our programming is going well now.


All times are GMT -5. The time now is 10:11.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi