Go to Post FIRST has given me too much for me to leave without leaving a mark... - Joe G. [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 16-02-2015, 18:31
restouffer's Avatar
restouffer restouffer is offline
Registered User
AKA: Bob Stouffer
FRC #2539 (Krypton Cougars)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2010
Location: Palmyra, PA
Posts: 11
restouffer is an unknown quantity at this point
CAN Talon Does Not Move in Speed Mode

We have a CAN Talon SRX wired to an encoder. When in PercentVBus mode, the motor moves and we can see our encoder values changing. When changed to kSpeed mode, the motor does not move. We have checked the System Configuration webpage on the roboRIO, and have even run a Self-Test while this is running. The Self-Test shows an error and an applied throttle, but the motor does not move. We have tried values in the range of 20 to 200.

Here is a snapshot of one Self-Test:
Click image for larger version

Name:	talon-snapshot.png
Views:	59
Size:	17.4 KB
ID:	18391

We followed the code given in the Software Reference:

Code:
        elevatorMotor = new CANTalon(RobotMap::Elevator::elevatorMotorID);
	elevatorMotor->SetControlMode(CANSpeedController::kSpeed);
	elevatorMotor->SetSensorDirection(true);
	elevatorMotor->ConfigSoftPositionLimits(
		RobotMap::Elevator::maxPosition,
		RobotMap::Elevator::minPosition
	);
	elevatorMotor->SetPID(
		RobotMap::Elevator::P,
		RobotMap::Elevator::I,
		RobotMap::Elevator::D
	);
	elevatorMotor->SelectProfileSlot(0);
	elevatorMotor->SetIzone(300);
	elevatorMotor->SetCloseLoopRampRate(48);
	elevatorMotor->SetVoltageRampRate(0);
Code:
elevatorMotor->Set(speed);
Anyone have any thoughts?
Reply With Quote
  #2   Spotlight this post!  
Unread 16-02-2015, 18:45
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,113
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: CAN Talon Does Not Move in Speed Mode

Section 17.5 of the TALON SRX Software Reference Manual lists the throttle range as -1023 to +1023. A throttle of -19 is very, very small--less than 2%. You might need to increase the P value.

Note that the speed value is in encoder counts per 100 milliseconds. You will need to convert from RPM (or whatever speed units you use) based on the number of encoder counts per revolution. Note also that the encoder is always read in 4x mode, so a 250 cycle per revolution encoder is actually 1000 counts per revolution.
Reply With Quote
  #3   Spotlight this post!  
Unread 16-02-2015, 19:05
restouffer's Avatar
restouffer restouffer is offline
Registered User
AKA: Bob Stouffer
FRC #2539 (Krypton Cougars)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2010
Location: Palmyra, PA
Posts: 11
restouffer is an unknown quantity at this point
Re: CAN Talon Does Not Move in Speed Mode

Thanks for the quick reply. We have increased the P value and will give it a try as soon as the fabrication team gets done with the robot.
Reply With Quote
  #4   Spotlight this post!  
Unread 16-02-2015, 19:56
restouffer's Avatar
restouffer restouffer is offline
Registered User
AKA: Bob Stouffer
FRC #2539 (Krypton Cougars)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2010
Location: Palmyra, PA
Posts: 11
restouffer is an unknown quantity at this point
Re: CAN Talon Does Not Move in Speed Mode

Yep, that was our problem. I'm not used to working with numbers in the thousands, and we were a bit worried about setting the value too high. Now we know better.

Thanks for your time.
Reply With Quote
  #5   Spotlight this post!  
Unread 17-02-2015, 19:44
ozrien's Avatar
ozrien ozrien is online now
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 523
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
Re: CAN Talon Does Not Move in Speed Mode

Glad you guys are up and running.

Just a guess : AppliedThrottle at -19 and ClosedLoopErr is -200, so I'm guessing Pgain was 0.1.
Reply With Quote
  #6   Spotlight this post!  
Unread 18-02-2015, 08:27
restouffer's Avatar
restouffer restouffer is offline
Registered User
AKA: Bob Stouffer
FRC #2539 (Krypton Cougars)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2010
Location: Palmyra, PA
Posts: 11
restouffer is an unknown quantity at this point
Re: CAN Talon Does Not Move in Speed Mode

Good guess. Changing P to 1 and speed to 400 seems to work much better.
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 14:50.

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