Go to Post Why does 1114 have to be good at everything? ;) - Justin Montois [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 23-01-2013, 17:30
ZeroCoder ZeroCoder is offline
Registered User
FRC #2344
 
Join Date: Jan 2013
Location: Yonkers, NY
Posts: 2
ZeroCoder is an unknown quantity at this point
Silly question about controlling motors

So I'm using the RobotDrive class and two Jaguar motor controllers to control out robot. In tank drive mode, I'm periodically calling RobotDrive.tankDrive(leftJoystick, rightJoystick).

My problem is that the direction of the motors is inverted with respect to the joystick axis. In other words, if I push the joysticks forward, the robot goes backwards, and vise versa. I know I can just invert the motors in the code, but my OCDness is telling me that it should be working correctly by default.

The left joystick is properly corresponding to the left motor controller and the same goes for the right side. Basically, if I push the left stick forward, I get a negative voltage reading on the output of the left jaguar. If I push the left stick backwards, I get a positive voltage reading on the jaguar output.

Any ideas what could be causing this?
Reply With Quote
  #2   Spotlight this post!  
Unread 23-01-2013, 17:34
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,753
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: Silly question about controlling motors

It's an industry standard that's tripping you up.
Joysticks came from the flight simulator genre where forward on the stick puts the nose of the aircraft down or (-1), up is pull back (+1).


How about doing to the Setup tab on the Driver Station and reversing the order of joystick 1 and joystick 2?
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 23-01-2013 at 17:48.
Reply With Quote
  #3   Spotlight this post!  
Unread 23-01-2013, 18:10
ZeroCoder ZeroCoder is offline
Registered User
FRC #2344
 
Join Date: Jan 2013
Location: Yonkers, NY
Posts: 2
ZeroCoder is an unknown quantity at this point
Re: Silly question about controlling motors

Quote:
Originally Posted by Mark McLeod View Post
How about doing to the Setup tab on the Driver Station and reversing the order of joystick 1 and joystick 2?
Wouldn't that make the left stick control the right side and the right stick control the left side?
Reply With Quote
  #4   Spotlight this post!  
Unread 23-01-2013, 18:19
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,753
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: Silly question about controlling motors

Yea, that was pretty silly. I was thinking about something else entirely and crossed wires.
That would work, but it would change which end was the front of the robot.

Turning the joysticks around to face the back of the plane would work
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 24-01-2013 at 10:49.
Reply With Quote
  #5   Spotlight this post!  
Unread 24-01-2013, 10:47
omalleyj omalleyj is offline
Registered User
AKA: Jim O'Malley
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New Jersey
Posts: 132
omalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to behold
Re: Silly question about controlling motors

Quote:
Originally Posted by ZeroCoder View Post
I know I can just invert the motors in the code, but my OCDness is telling me that it should be working correctly by default.

Any ideas what could be causing this?
The RobotDrive code has no way to know whether your motors and transmissions end up with the wheels spinning forward for positive or not. I suspect that it defaults to the kit-bot orientation to make things easy on new teams.

The first thing I have the students do when we code the drivetrain is put the chassis on blocks and see what happens this year.
Reply With Quote
  #6   Spotlight this post!  
Unread 24-01-2013, 10:57
omalleyj omalleyj is offline
Registered User
AKA: Jim O'Malley
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New Jersey
Posts: 132
omalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to behold
Re: Silly question about controlling motors

BTW, When I wonder what the heck is going on in wpilibj, I find looking at the source code is enlightening/interesting/scary depending on the day.

I recommend you opening wpilibj as a project and browsing through the RobotDrive.tankDrive source, or whatever other classes and methods you are using. It doesn't always help but sometimes it can be a real benefit.

Good luck!
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 10:08.

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