![]() |
Use of JoystickButton in Command Based does not activate PCM
The issue we're seeing is that when a JoystickButton is added to the scheduler (ex. myButton->WhenPressed(new MyCommand())), the PCM does not activate.
The status lights for devices: PCM: Status: Green SlowPDP: Stat: Green StroberoboRio: Off RSL: Blinking - Robot On and Enabled Voltage Regulator: 5V: Bright GreenFirmware: PCM: 1.59roboRIO Image: FRC_roboRIO_2015_v23 Observations: The PCM does not activate after: A complete power cycle of the robot.The PCM does activate after we: Deploy code.Things we've tried that didn't work Multiple PCMs. 2.4GHz WiFi 5GHz WiFi Multiple Radios. 3 different WiFi channels - auto, 4, and 8. 3 different joysticks (traditional and an XBox 360 controller). Tried relocating radio on robot. Another laptop with fresh WPIlib and NI installs. Manually instantiating the compressor with the C++ Compressor class. Tried manually adding the JoystickButton to the Scheduler using Scheduler::AddButton() instead of JoystickButton::WhenPressed(). Another compressor. Things we've tried that work consistently Ethernet Tether. Iterative. Restart robot code. In fact, after a power cycle if we click Restart robot code before enabling, it works every time. Things we have not tried Another roboRIO. Another PDP. At the beginning of build season, we were able to wire and re-program a previous robot (with pneumatics) and did not have any issues. We then wired and programmed this years' robot. We did not notice any issues until we got the pneumatics hooked up on this robot. We consulted a local team that beta tested the roboRIO. Their programming mentor was also stumped. In our troubleshooting, we created a bare bones Command Based project: https://github.com/FRCTeam1987/PneumaticsTest We found that in OI.cpp, we can create a Joystick and a JoystickButton just fine. The issue arises when we add a button to the scheduler, which is line 8 in the linked project. Through NetConsole, we have seen that the code does run when we enable on a power cycle and the compressor closed loop is on, but the compressor does not turn on and the control system status indicators are as described above. The PCM does get a sticky fault saying "Comp Curr Too Low - Most likely the compressor is not connected." We have also cleared the sticky faults manually using the roboRIO web page with the self test button. What are we missing? Does anyone have any suggestions for what else to try? We are out of ideas to try and resolve this issue. Any help you all could provide would be much appreciated. Thanks. |
Re: Use of JoystickButton in Command Based does not activate PCM
I deployed it on my robot and haven't seen the symptom yet. I'll keep messing with it though.
I don't think this is part of them problem but thought I'd mention... R60 - PCM must be updated to at at least version 1.62. http://wpilib.screenstepslive.com/s/...ribution-panel |
Re: Use of JoystickButton in Command Based does not activate PCM
Omar, thanks for the response and for trying the code on your robot. I can't find the firmware file for the PCM on CTRE's web site. Do you have a link? I looked here - http://crosstheroadelectronics.com/control_system.html.
|
Re: Use of JoystickButton in Command Based does not activate PCM
It's in the documentation-link I sent...
http://wpilib.screenstepslive.com/s/...ribution-panel Quote:
|
Re: Use of JoystickButton in Command Based does not activate PCM
I think the problem you're seeing is the same that we scratched our heads on for a while... this year there is no Compressor class. This year, you hook the pressure switch to the PCM and the power from the compressor to the PCM. Then in your code, the MAGIC (ok it's not magic - it's a matter of reading the right paragraph on the right page of screensteps - sigh) is to instantiate a Solenoid.
You don't even need to USE the Solenoid...just instantiate it in your robot class and then enable the robot. Solenoid testCompressorTurningOn; |
Re: Use of JoystickButton in Command Based does not activate PCM
Quote:
...no ... they have a DoubleSolenoid in their ExampleSubsystem, which is instantiated in CommandBase::init(), so that seems ok... Are you guys still having the symptom with the simple example you posted? I haven't seen it misbehave yet. |
Re: Use of JoystickButton in Command Based does not activate PCM
If you are hearing the compressor start and your solenoid is in your command class(es), I think a simpler test is in order. Instantiate a Solenoid (or DoubleSolenoid) in the robot template code itself just for the sole purpose of seeing if the compressor will kick on. If it does, then there's a problem with how you're operating the commands. They can be tricky.
As for our simple example - I'm unaware if the team posted something that you're referring to. (blush). bob |
Re: Use of JoystickButton in Command Based does not activate PCM
Omar, I installed the PCM firmware update tonight. The problem has not gone away. We're now at 1.62 on the PCM.
|
Re: Use of JoystickButton in Command Based does not activate PCM
Are you seeing the same problem with the EXACT sample project you posted earlier? Where you enable the robot and...
- PCM reports not enabled in the self-test - PCM status LED blinks slow green [or orange if sticky faults are set] instead of fast green [enabled]. - solenoid led does not turn on when button is pressed (every solenoid channel has a red led at the case edge of the PCM). All three symptoms are occuring? Or some of them? Does the PCM still show up in the web-based config? Is it's device ID zero? |
Re: Use of JoystickButton in Command Based does not activate PCM
Quote:
We've run that self test a few dozen times over the last five days. This is the first time we've run it while the robot was enabled. Could that have made a difference? We don't understand why it's not happening now. We've pushed other projects and it's working in them too (it wasn't before). We've power cycled the robot a dozen times since then and the compressor has worked every time. Go figure. |
Re: Use of JoystickButton in Command Based does not activate PCM
Reformat/reimage the roboRIO. I had a really, really weird intermittent CPU usage and CAN bug that went away immediately after I deployed code or restarted it, but came back if I power cycled the roboRIO. It's exactly like you're describing- the code doesn't work right if the robot starts from a cold boot, but it works if the code is started after the controller fully powers on. Something different with CAN happens when the code is started by the deploy sequence vs. a cold boot.
|
Re: Use of JoystickButton in Command Based does not activate PCM
Can you try this, when you power your robot up, wait until you see the DS read "No code" then "robot disabled". Then wait maybe 15 seconds (overkill). Then robot-enable. Can you try that for a couple days and see if it changes your experience? I'm wondering if something is going on in the initial connect after power up.
Jared, is your team also using C++? |
Re: Use of JoystickButton in Command Based does not activate PCM
Quote:
When we deploy code, we can read current draw/temperature of the PDP. After restarting the roboRIO, we can no longer read the current draw/temperature, and CPU usage is very high. If we click the "restart user code" button, the cpu usage decreases, and CAN works. If we click the "reboot roboRIO" button, the cpu usage decreases, and CAN works again. We solved the problem by reimaging the controller. Waiting a long period of time (10 minutes) between power on and enabling the robot did not solve the problem. When this happened, I logged into the roboRIO and used the top command to see what was using all of the CPU usage, and it was the FRC user program. Starting and stopping the user program caused it to work normally. I also tried editing the script that starts the user program so that it did nothing, then manually started our user program, which resulted in the program running normally, confirming that the problem only happens if the user code is started as the control system is booting. |
Re: Use of JoystickButton in Command Based does not activate PCM
Quote:
|
Re: Use of JoystickButton in Command Based does not activate PCM
Hey Jared, if you're still seeing the problem can you send your eclipse project to support@crosstheroadelectronics.com?
|
| All times are GMT -5. The time now is 14:50. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi