View Single Post
  #5   Spotlight this post!  
Unread 28-01-2017, 09:20
flemdogmillion's Avatar
flemdogmillion flemdogmillion is offline
Programmer, Builder, Driver...
FRC #3007
 
Join Date: Nov 2016
Rookie Year: 2015
Location: Minnesota
Posts: 138
flemdogmillion will become famous soon enoughflemdogmillion will become famous soon enough
Quote:
Originally Posted by Jonathan L. View Post
Just by looking at it, I don't think it should be a problem for the roboRIO to handle. Using Elapsed Time.vi as Mark McLeod said would be a good idea if you really want to know for sure.



I see a Negate function just before the PID's process variable input. I don't know if that's what your looking for.







Visually, it does seam a bit messy. You can fix that by creating subVIs for each function (e.g. Drive.vi, Feeder.vi, Climber.vi, etc.). I wouldn't hesitate to copy the Joystick Get code into each of those VIs. If you end up with two actuators that are strongly related, you can still put those in the same vi. For example, in 2015 we had an elevator that used a motor and a pneumatic piston as a brake. The operator had an up button and a down button. Whenever, the up or down buttons were pressed, the brake would be off and the motor would move in the appropriate direction (assuming it was safe according to limit switches). If neither button was pressed the motor would be off and the brake would be on. That was all a subVI in TeleOp.



Additianaly, you can put most of that code inside a VI that gets reused in autonomous. See our code from last year for an example of that.



Of course there are other ways to organize code. This is just one way that you could easily use without having to learn a whole lot about communication inside a LabVIEW program.







FYI, I think you can safely remove the compressor code as the compressor will still run automatically as long as you open a solenoid.


The compressor code is there to turn off the compressor when the climber is enabled.
__________________
Team 4506: 2015-2016
Team 3007: 2017

Jack of all trades except C++ & Java
Reply With Quote