![]() |
Re: Talon SRX spamming forward and backward constantly
Quote:
|
Re: Talon SRX spamming forward and backward constantly
Well to sanity checks things I grabbed the stock example at ...
http://wpilib.screenstepslive.com/s/...-mecanum-drive ...and tweaked it a bit. It is just mechanum drive with CANTalons and no gyro. I... -changed the Talons to CANTalons and used 1,3,4,5 for the device IDs to match your bot. Although I did NOT cross-reference your code to make sure the number-to-positions matched (LF,LR,RF,RR). -I increased the motor safety timeout to 500ms. Seems like the default is not long enough to cover the time between enabling and getting to the first TeleopOpLoop. -Changed the joystick index to 0 from 1. To use this example just create a new IterativeRobot and paste this into Robot.cpp. Code:
#include "WPILib.h"/** |
Re: Talon SRX spamming forward and backward constantly
If you don't have any load on the drive wheels when you try to control the speed in closed-loop mode, you're very likely to get wildly oscillating wheels as they overshoot the target speed and try to correct.
Try giving them some load, like a patch of carpet pressed lightly against the rollers. You might also try adding some rate limiting on the motor power to keep it from thrashing so badly. |
Re: Talon SRX spamming forward and backward constantly
Our head mentor uploaded some new code to get and it seemed to work. However the controls are off. See the video. https://www.youtube.com/watch?v=uDY6QJa7FKw Thanks everyone for there help and especially ozrien for putting the code on your robot. Tomorrow I'll post how he was able to fix it but for now sleep and class.
|
Re: Talon SRX spamming forward and backward constantly
Got this working on my bot. I used 3,1,4,5 for LeftFront, LeftRear, RightFront, RightRear respectively. Also added gyro an analog0 so holds absolute angle.
-I use the F350-similar gamepad (the wireless version), so I changed the three axes to X,Y,Z. -Also I added button5 so that it will reset angle, thus allowing you to reselect the angle heading to servo to. -Also inverted my right side since right-side motors have to drive negative (red) to move robot forward. Actually I've been playing with this for about half an hour, driving it around the CTR office, so it seems pretty good. Code:
#include "WPILib.h" |
Re: Talon SRX spamming forward and backward constantly
Quote:
|
Re: Talon SRX spamming forward and backward constantly
Quote:
Quote:
Basically two Common-ID talons can't be enabled at the same time. One will win while the other stays disabled. Also there will be instances when both disable. When a Talon SRX is disabled it will blink orange each LED in an alternate pattern (think rail road crossing). See Talon User Guide for LED table. |
Re: Talon SRX spamming forward and backward constantly
So it turned out that we only disabled half of our encoders. We had old code running the encoders even though we bypassed the joystick inputs. Whenever we tried to move our motors the old code kicked in and tried to bring the wheels back to 0, but overshot and just continued to do so. Thanks everyone for all the help! So mandrews281 make sure you have all your PID loops disabled.
|
Re: Talon SRX spamming forward and backward constantly
There are no PIDs in our code. It's only 4 TalonSRX, a robotdrive, a Gyro (disabled I think, need to check with my programming captain) and joystick. I saw 1452-Leo's solution here:
http://www.chiefdelphi.com/forums/sh...5&postcount=20 and I'm thinking that's the way to go. Our electrical team has our test base disassembled at the moment, I'll have to try this tomorrow. |
Re: Talon SRX spamming forward and backward constantly
Quote:
Is your problem that you are seeing motor safety errors in the DS AND as a result your motors are neutral (solid orange)? Please be specific. |
| All times are GMT -5. The time now is 21:10. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi