Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   CAN Talon Does Not Move in Speed Mode (http://www.chiefdelphi.com/forums/showthread.php?t=134726)

restouffer 02-16-2015 06:31 PM

CAN Talon Does Not Move in Speed Mode
 
1 Attachment(s)
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:
Attachment 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?

Alan Anderson 02-16-2015 06:45 PM

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.

restouffer 02-16-2015 07:05 PM

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.

restouffer 02-16-2015 07:56 PM

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.

ozrien 02-17-2015 07:44 PM

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. :)

restouffer 02-18-2015 08:27 AM

Re: CAN Talon Does Not Move in Speed Mode
 
Good guess. Changing P to 1 and speed to 400 seems to work much better.


All times are GMT -5. The time now is 10:09 AM.

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