![]() |
CAN Talon Encoder
Hey I am a programmer on 4085 and we are having a ton of struggle with the new encoders. We have an encoder hooked up directly to the pins on our Talon SR's. We are currently getting position and I have spent 3 hours working on a dry board trying to get it to move forward for 4' and stop. Simple right? But there's a catch! There is no reset encoder position command. So we have no way of making it "zero" at the beginning of autonomous. Now you understand why I had 3 hours at the dry board. Our "get encoder position" command returns a number that doesn't start a "zero". Our "get velocity" command returns a largely changing number so we are calling it "dead" and bugged. We do have the breakout board plugged into the encoders before we plug them into the Talon. What are you guise using this year? We want to know that the pin out on the speed controllers don't work before we just rewire it back to the analog ports. Can you help?
Code:
package org.usfirst.frc.team4085.robot; |
Re: CAN Talon Encoder
What ports on the breakout board are the encoders plugged into. You made it wound like they are plugged into the analog ports. The A and B channels from the encoder should be plugged into the corresponding ports on the breakout.
As for resetting the encoder, how about just saving the current value whenever you want to reset it and just add that to your setpoint. EDIT: Actually ignore this, Neal has a better answer It would also help to know what type of encoder you are using and to see your autonomous command. |
Re: CAN Talon Encoder
Quote:
|
Re: CAN Talon Encoder
Good question Neal :)
Also, are you using Analog Encoder or Quadrature Encoder? If you're using Analog encoder be sure to update your Talon to 1.4 and also read the workaround for Functional Limitation 21.17 in the Talon SRX Software Reference Manual. CANTalon defaults to Quadrature Encoder for the feedbackdevice. Follows the steps in Section 7 for selecting the feedback device (Sensor) and follow 7.4 for selecting the sensor direction correctly. Use the Self-Test (section 2.4) to see what's going on in the Talon. |
Re: CAN Talon Encoder
Quote:
|
Re: CAN Talon Encoder
We are trying to read the encoder value by calling leftMotor.getPosition or leftMotor.getEncPosition, both returned zero while the motor is running. Is there a trick to do this? Did I miss some sort of configuration to "enable" encoder on the CANTalon? I hooked the encoder wires to +5V, A, B and GND of the Talon. We are not using the breakout board (they are out-of-stock). We spliced the ribbon cable to a 8-pin molex connector. Encoder should have +5V on pin 2, A on pin 7, B on pin 5 and GND on pin 10. I assume the red wire on the ribbon is pin 1. I checked with a volt meter that pin 2 and pin 10 is indeed 5V to GND. So it means I did not flip the connector backward. In code, aside from instantiate the CANTalon motor controller, the only call we made is to leftMotor.setFeedbackDevice(CANTalon.FeedbackDevic e.QuadEncoder). I am thinking we may not even have to do that if we call getEncPosition. But we set the feedback device anyway so we can also call getPosition. But somehow both calls returned zero. Any help is appreciated.
BTW, everybody said there is new beta firmware for the Talon SRX but nobody seems to know where to download it. A link to it would be nice. Thanks. |
Re: CAN Talon Encoder
Never mind, got it all working. The encoder was mis-wired.
|
Re: CAN Talon Encoder
Quote:
http://www.crosstheroadelectronics.c...ol_system.html Also please read the FRC team updates... http://www.usfirst.org/roboticsprogr...ated-documents ...not only are the updates mentioned (and their links) but you don't want to miss API updates, firmware updates, rule changes, scoring updates, etc... You can rely on CD for some stuff, but this is the source. |
| All times are GMT -5. The time now is 10:30. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi