Hello! I don’t know if this question has been answered yet, but I didn’t seem to find an answer anywhere.
When we are trying to run autonomous code, PWMs 1-12 aren’t doing anything, and the speed controllers that are hooked up into those PWMs are blinking yellow. We think that the PWMs aren’t being enabled, but we’re not quite sure how to do that in the autonomous code. We have the drivetrain motors in PWMs 13-16, and those are working fine. Nothing else, however, will work.
// If it might be part of the problem, we’re using Kevin’s streamlined code as a base.
If we do the first one, then there’s an error saying there’s too many calls in the argument. The second one doesn’t work either because apparently the PWM() function only affects 13-16. I think I have an idea, though, and I’ll see if it works.
Edit: Yeah, I didn’t think it would. I thought the problem may have been PWM vs. Generate_Pwms, but that’s not the issue.
No, the PWM() only deals with 13-16. Try setting all your PWMs to 254 (disconnect any motors first!) and then power up and go into autonomous. Take the PWM cable coming from your Victor and move it up from 1 through 12, and see if the light on the Victor stays blinking orange or if it changes to green or red. If so, then one of your outputs may be bad. If not, switch cables and repeat. I have encountered several bad cables this year. If none of your cables working, switch Victors. The connection from the cable to the Victor is commonly loose on our 'bot this year too.
If none of these work, use the dashboard program (either IFI’s or Sean Witte (sp?)) and see if they read 254 or not.
I take it that the PWMs work fine in Teleoperated mode?
Anyway, using that test, the Victor was blinking yellow from PWMs 1 - 12, but it was green from PWMs 13 - 16, and yet all 16 of them were reading 254, so we think it has to be initialization or something to that effect. Thanks for the suggestion.
If they read 254 on the Dashboard then I would hazard that it is an electrical problem, not strictly software. Did you use this Dashboard, plugged into your OI, to test?
On last possible test I can think of would be to try this year’s FRC plugged into some of the Victors on last year’s 'bot. I am assuming at this point that everything else about autonomous work? (eg. analog inputs, digital in/outputs, etc.)
If you happen to be in charge of electrical as well, I’m sorry, but I can’t really tell you how to proceed from here, other than maybe trying this year’s speed controllers on last year’s bot.
Good luck again (it’s starting to sound like you need it),
Well, I don’t know much about the electrical side, either, so you’re not alone. I’ll have to ask the electrical team to look at it. Thanks for your advice, at least it’s narrowed down the problem. If it actually isn’t the problem, then (I’m going to regret this) I may have to drop the autonomous mode (which would not be good…). Thanks, anyway.