Go to Post Y'know... I think I'd much rather have big balls than hang myself... - FotoPlasma [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-02-2016, 18:16
ICE_Bear ICE_Bear is offline
Registered User
FRC #5875 (ICE)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Northern Nevada
Posts: 72
ICE_Bear is an unknown quantity at this point
PWM

How do you use PWM 2 and 3 for roboRIO?
Reply With Quote
  #2   Spotlight this post!  
Unread 01-02-2016, 18:18
GreyingJay GreyingJay is offline
Robonut
AKA: Mr. Lam
FRC #2706 (Merge Robotics)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2015
Location: Ottawa, Canada
Posts: 783
GreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond repute
Re: PWM

There's not enough information in your question to really be able to answer. What language are you talking about?
Reply With Quote
  #3   Spotlight this post!  
Unread 01-02-2016, 18:19
ICE_Bear ICE_Bear is offline
Registered User
FRC #5875 (ICE)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Northern Nevada
Posts: 72
ICE_Bear is an unknown quantity at this point
Re: PWM

We are using Labview.
Reply With Quote
  #4   Spotlight this post!  
Unread 01-02-2016, 18:21
samfruth's Avatar
samfruth samfruth is offline
Registered User
FRC #1710 (Ravonics Revolution)
Team Role: Driver
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Olathe, Kansas
Posts: 132
samfruth will become famous soon enough
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.
__________________



I kind of know programming
Reply With Quote
  #5   Spotlight this post!  
Unread 01-02-2016, 19:28
ICE_Bear ICE_Bear is offline
Registered User
FRC #5875 (ICE)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Northern Nevada
Posts: 72
ICE_Bear is an unknown quantity at this point
Re: PWM

When we change 2 motor vi to 4 motor vi it makes the program not runnable. What did we do wrong?
Reply With Quote
  #6   Spotlight this post!  
Unread 01-02-2016, 19:36
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,844
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 01-02-2016 at 19:39.
Reply With Quote
  #7   Spotlight this post!  
Unread 09-02-2016, 18:42
ICE_Bear ICE_Bear is offline
Registered User
FRC #5875 (ICE)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Northern Nevada
Posts: 72
ICE_Bear is an unknown quantity at this point
Re: PWM

What are the constants for the FRC roboRIO project?
Reply With Quote
  #8   Spotlight this post!  
Unread 09-02-2016, 23:05
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,844
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: PWM

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.
Attached Thumbnails
Click image for larger version

Name:	AddConstant.jpg
Views:	33
Size:	46.9 KB
ID:	20026  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #9   Spotlight this post!  
Unread 10-02-2016, 19:58
ICE_Bear ICE_Bear is offline
Registered User
FRC #5875 (ICE)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Northern Nevada
Posts: 72
ICE_Bear is an unknown quantity at this point
Re: PWM

Where do you find open 4 motor?
Reply With Quote
  #10   Spotlight this post!  
Unread 10-02-2016, 20:14
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,844
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 10-02-2016 at 20:19.
Reply With Quote
  #11   Spotlight this post!  
Unread 11-02-2016, 17:46
ICE_Bear ICE_Bear is offline
Registered User
FRC #5875 (ICE)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Northern Nevada
Posts: 72
ICE_Bear is an unknown quantity at this point
Re: PWM

Is there any thing else we need to do to get it working?
Reply With Quote
  #12   Spotlight this post!  
Unread 11-02-2016, 22:59
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,844
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #13   Spotlight this post!  
Unread 12-02-2016, 18:23
ICE_Bear ICE_Bear is offline
Registered User
FRC #5875 (ICE)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Northern Nevada
Posts: 72
ICE_Bear is an unknown quantity at this point
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.
Attached Files
File Type: vi Teleop.vi (17.5 KB, 6 views)
File Type: vi Begin.vi (17.5 KB, 4 views)
Reply With Quote
  #14   Spotlight this post!  
Unread 12-02-2016, 19:46
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,844
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 12-02-2016 at 19:53.
Reply With Quote
  #15   Spotlight this post!  
Unread 12-02-2016, 20:01
ICE_Bear ICE_Bear is offline
Registered User
FRC #5875 (ICE)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Northern Nevada
Posts: 72
ICE_Bear is an unknown quantity at this point
Re: PWM

Thank you for all your help. our programming is going well now.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:02.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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