Go to Post Here on CD, we are all one big FIRST team, mentoring each other. - Joe G. [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-02-2015, 13:27
frc_team_4615 frc_team_4615 is offline
Registered User
FRC #4515
 
Join Date: Jan 2015
Location: Chambersburg, PA
Posts: 1
frc_team_4615 is an unknown quantity at this point
Motor Stuttering

Hello all,

We are trying to program one of our motors to move one direction when we press a button and the other direction off of a different button. We're using a Jaguar motor controller right now.

When going one direction operation is normal but the reverse direction stutters. If we reverse the code we get the same results but with opposite directions.

If we use the joystick axis to control this movement both directions are working. We checked that the buttons are at 1 and -1 when pressed.

Things we've tried so far:

Different motor
Different motor controller
Changed which buttons were assigned in the code
Changed which directions were assigned in the code

I tried searching but was having trouble with using the right keywords. Has anyone else had this problem? Is there an easier way to accomplish the same task?

TIA
  #2   Spotlight this post!  
Unread 02-02-2015, 13:36
AustinH's Avatar
AustinH AustinH is offline
Registered User
FRC #4918 (The Roboctopi)
Team Role: Coach
 
Join Date: Apr 2013
Rookie Year: 2013
Location: Port Townsend
Posts: 85
AustinH is a splendid one to beholdAustinH is a splendid one to beholdAustinH is a splendid one to beholdAustinH is a splendid one to beholdAustinH is a splendid one to beholdAustinH is a splendid one to behold
Re: Motor Stuttering

Doesn't sound like a hardware problem. When this happened to us on our first lift test, we dug through the code and found conflicting instructions being sent to the motor controller when various buttons were pushed. Can you publish some of your code?
__________________
3826: 2013 Seattle Regional Industrial Design Award & Semi-Finalists
4918: 2014 PNW Glacier Peak District Event Rookie Inspiration Award & Quarter-Finalists, 2014 PNW Mount Vernon District Event Highest Rookie Seed Award, Rookie All Star & Semi-Finalists, 2015 PNW West Valley District Event Engineering Excellence Award & Semi-Finalists, 2015 PNW Mount Vernon District Event Semi-Finalists





Visit us on the web at www.team4918.org
  #3   Spotlight this post!  
Unread 02-02-2015, 13:37
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is online now
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,717
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Motor Stuttering

What are you programming in? Can you post your code?
  #4   Spotlight this post!  
Unread 02-02-2015, 13:42
AllenGregoryIV's Avatar
AllenGregoryIV AllenGregoryIV is offline
Engineering Coach
AKA: Allen "JAG" Gregory
FRC #3847 (Spectrum)
Team Role: Coach
 
Join Date: Jul 2008
Rookie Year: 2003
Location: Texas
Posts: 2,551
AllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond repute
Send a message via AIM to AllenGregoryIV
Re: Motor Stuttering

Quote:
Originally Posted by AustinH View Post
Doesn't sound like a hardware problem. When this happened to us on our first lift test, we dug through the code and found conflicting instructions being sent to the motor controller when various buttons were pushed. Can you publish some of your code?
This was my first thought as well. It sounds like part of your code is sending 0 and then a different part is sending 1. Is the stop command from the first button always executing when it's not pressed? That would be my blind guess.
__________________

Team 647 | Cyber Wolf Corps | Alumni | 2003-2006 | Shoemaker HS
Team 2587 | DiscoBots | Mentor | 2008-2011 | Rice University / Houston Food Bank
Team 3847 | Spectrum | Coach | 2012-20... | St Agnes Academy
LRI | Alamo Regional | 2014-20...
"Competition has been shown to be useful up to a certain point and no further, but cooperation, which is the thing we must strive for today, begins where competition leaves off." - Franklin D. Roosevelt
  #5   Spotlight this post!  
Unread 03-02-2015, 07:00
jgrindle's Avatar
jgrindle jgrindle is offline
Losing Sleep
AKA: John Grindle
FRC #5122 (RobOTies)
Team Role: Programmer
 
Join Date: Nov 2014
Rookie Year: 2015
Location: Old Town, ME
Posts: 34
jgrindle will become famous soon enough
Would you be able to post your riolog? if you're working in java or c. Also posting your code to github would be helpful, we've had a similar problem. If it's on github, it makes for other teams to help debug a little easier.
__________________

FRC 2015 Season: Programmer, Electrical, PIDTuner, Safety Captain
FRC 2015 Off-Season: Programmer, CAD Designer, Driver, Drive Team Coach, Electrical, Mechanical, PIDTuner
  #6   Spotlight this post!  
Unread 03-02-2015, 09:21
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Motor Stuttering

I am guessing your code is doing something like this:
Code:
if button 1 pressed
  then run motor forward
  else stop motor
endif

if button 2 pressed
  then run motor backward
  else stop motor
endif
Button 2 will work. However, if you press button 1 the motor will run but will immediately be stopped by the button 2 code.

Instead, try this:
Code:
if button 1 pressed
  then run motor forward
endif

if button 2 pressed
  then run motor backward
endif

if neither button pressed
  then stop motor
endif
You might also want to explicitly deal with both buttons pressed at the same time.
Closed Thread


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 14: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