Go to Post Note that these comments are based on the 2006 FRC game rules, and they may or may not apply to the 2007 game. Your mileage may vary. - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 15-01-2014, 20:23
xTezzie's Avatar
xTezzie xTezzie is offline
Registered User
FRC #4940
 
Join Date: Jan 2014
Location: Canada
Posts: 4
xTezzie is an unknown quantity at this point
Motor Question..

So our team is looking to add a motor separate from RobotDrive.
After looking through the java API for this year over and over and over again, I cant seem to find a motor function separate from the driving mechanisms.
I could just be missing something, but at this point we're stuck to an extent. I know there must be a way (we're using the a speed controller on the motor to power a wheel).
So if anyone has any advice, it would be appreciated
Reply With Quote
  #2   Spotlight this post!  
Unread 15-01-2014, 20:25
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 430
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Motor Question..

You control the motors through the motor controller, so there are three classes to choose from in wpilib. Choose the one for the motor controller you are going to wire up to.

Talon
Victor
Jaguar

Example Code:
Code:
Talon shooterWheel = new Talon(3); //talon on PWM channel 3 on digital sidecar

shooterWheel.set(1.0); //spin the motor at full voltage in one direction
shooterWheel.set(-1.0); //spin the motor at full voltage in the other direction
__________________
http://team2168.org

Last edited by otherguy : 15-01-2014 at 20:31. Reason: added links to javadoc and code sample
Reply With Quote
  #3   Spotlight this post!  
Unread 15-01-2014, 20:32
xTezzie's Avatar
xTezzie xTezzie is offline
Registered User
FRC #4940
 
Join Date: Jan 2014
Location: Canada
Posts: 4
xTezzie is an unknown quantity at this point
Re: Motor Question..

Would it be possible for you to elaborate a little bit more at all? How do you know which motor of the three you're wiring it up too?
Reply With Quote
  #4   Spotlight this post!  
Unread 15-01-2014, 20:56
Ipiano's Avatar
Ipiano Ipiano is offline
Registered User
AKA: Andrew Stelter
FRC #3018 (Nordic Storm)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mankato, Minnesota
Posts: 27
Ipiano is an unknown quantity at this point
Re: Motor Question..

It sounds like you don't have a large amount of experience so I'm going to start from the beginning; please don't take this as an insult, I'm just trying to cover all bases in case you're completely new to this.

Just a clarification: Talons, Victors, and Jaguars are not the motor itself, they are the motor controller--the hardware on the robot that takes power from the distribution board and sends it to the motor.

The controller will be connected to one of the outputs on the digital I/O board via a PWM cable; the number output on the I/O board will be used when you construct the object for it in Java.

What setup are you guys using? Are you using just the IterativeRobot base, or are you using a CommandBase pattern with/without RobotBuilder?

Essentially, the only code you need was in the first response from otherguy, you just need to construct an object of whatever kind of hardware is on the robot with the PWM output as the parameter and then you call .set(double speed) on the object.
__________________
________
Genius is one percent inspiration and ninety-nine percent perspiration.
--Thomas A. Edison
Reply With Quote
  #5   Spotlight this post!  
Unread 15-01-2014, 21:04
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 430
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Motor Question..

Look through this page for pictures of the Jagaur, Talon, and Victor Motor controllers. These are the devices you wire your motor up to. They are what the cRIO communicates with to control the speed and direction of the motor.

You will have to decide which component you are using. All three are capable of driving motors. Depending on what you choose, you will need to use the corresponding class that I linked above.
__________________
http://team2168.org
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 22:33.

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