![]() |
No clue where to start on Programming...
Good evening Delphi,
My name is Adam of Team 3763. Our team has just recently started Programming, and I am our so called "lead programmer." To simply state it, I have gone through and installed ALL required files onto the HOST Computer. These Files include: FRCLabVIEWupdate4.00for2012, FRC2012Utilities, and the FRC2012DriverStationUpdate. I have gone through ALL tutorial steps found here: file:///C:/Program%20Files/National%20Instruments/LabVIEW%202011/manuals/FRC_Programming_Guide/index.html#exampleprog. Now, I am at a loss as to what to do next. I'm unsure of what to do next. This is our first year with programming, but our second year with FRC. Any and ALL help would be appreciated. We wish to use an Xbox360 WIRED controller, however we CAN, if need be, use the standard provided Joysticks. All help is appreciated from anyone. Please reply ASAP. Thank you, Adam of Team3763 - Wildcards |
Re: No clue where to start on Programming...
I would use the standard joysticks that is what i use. To have base for programming use the FRC example provided by labview.
|
Re: No clue where to start on Programming...
Do you have any other teams in your area that can walk you throught the basics? That is how we have helped new teams in our are, or teams with new programmers.
For now, start with getting the motors spinning for Teleop driving. |
Re: No clue where to start on Programming...
We have one team nearby that I know of, however I believe they're lacking in the field of Programming. I've looked through a majority of examples provided in LabVIEW. It's just a matter of "ok what do I do now?" and where to start. Once I get passed this, I think we'll be good so far as programming goes. It's just comprehending the basics.
|
Re: No clue where to start on Programming...
http://www.frcmastery.com/ has some great tutorials for LabVIEW. I suggest you take a look at these if you already haven't.
|
Re: No clue where to start on Programming...
You can't go wrong with the resources at WPI either: http://thinktank.wpi.edu/tag/1
The 2 minute lesson: In Labview, generate a default project for your robot. Be sure to put your team number in for the IP address (10.37.63.2) when you generate the project. In Project Explorer, Expand the Build Specification thingy, right click on FRC Robot Boot Up Deployment and BUILD, after that finishes, same thing but click RUN AS STARTUP. If all that succeeds, you now have a robot that will drive with a single joystick and a left and right motor. To add more functionality, open up BEGIN.VI, press Ctrl-E to get to the block diagram. This is where you connect the programming world of Labview to the physical world of your robot. Check out the definition for the motors and the joystick to see how this is done. To add other functions, right click in the block diagram to bring up the functions toolbox. Down at the bottom you will see the WPI LIBRARY, this is where most (all?) of the robot related functions are located. You can add motors, joysticks and other stuff here. The bulk of your programming will take place in TELEOP.VI, this is the LOOP that runs while your robot is in telop mode. Same ideas apply as in BEGIN.VI, except here you will open references to the things you defined in BEGIN.VI, and do stuff with them; read sensors, send signals to motors. That is the basics, after that, go check out examples, spend time on FRCMASTERY, hook up with other teams and all will be good. |
Re: No clue where to start on Programming...
I agree with all the rest of them. I am a first year labView programmer in lead position. However I have done other languages before. Do you have any other experience? I learned a lot from the tutorials, and the programer from last year (now in college). For where you are I would just suggest setting up your cRIO with the default code and getting it to deploy. After that, start from the basics. Add a motor with a default power value into your code. For a motor to run you need an "Open VI" and a "Set Refnum VI" wired together in the "Begin VI". Then in your telleop VI write a "Get Refnum VI" wired to a "Set Output VI" with an output value. And in the "End VI" write in a "Get Refnum VI" wired to a "Close VI" with the same refnum name you put into the other Refnum name terminals. The wiring is easy using the color coding. Also to give a constant value to a terminal right click on the terminal and chose Create then Constant. Once you have this, start adding in other controlls, doing the same setup, and hook them together in a logical order.
ps. some of the VIs might be the wrong name since I was working off of memory. |
Re: No clue where to start on Programming...
Quote:
While in LabVIEW:: -Went to Robot Main.vi -Pressed Ctrl+E which opened the Robot Main.iv Block Diagram. -Double-clicked the Begin.vi and opened up the Begin.vi Front Panel -Pressed Ctrl+E and opened the Begin.vi Block Diagram. Now from here I tried 2 different options for adding 2 MORE motors. Option one: After opening the Begin.vi Block Diagram I did the following: -Added another...Pink-ish text box and titled it "Left and Right Motors 2." -From here I wired up EXACTLY how the first 2 motors were wired up. (Refnum, Drive - Open 2 motors, etc...) -I COPY and PASTED the 2 PWMs provided on-screen and titled them PWM 3/4. -With NO ERRORS, I deployed the code onto the cRIO. -Afterwards, we switched over to the Classmate Driver Station. -We had Robot Code and Communication, however when moving the joystick, only 2 of the 4 motors spun. (The 2 motors that were already written in the program. **Option one failed. Option two: -Instead of ADDING another "Drive - Open 2 motors," I DELETED the provided Drive - Open 2 motors and REPLACED that with a Drive - Open 4 motors, adding 2 more PWMs, 3 and 4, where the other 2 motors were wired. -With everything wired correctly and NO ERRORs displayed on screen, we moved over to the Classmate. -Again, only 2 of the 4 motors were spinning. And again, only the 2 motors that were previously programmed. **Option 2 Failed. Right now, we are JUMPING all 4 motors together, but this is causing one motor to stay constant running, while the other 3 react to the position of the joystick. Any and ALL help reguarding adding 2 more motors to the Begin.vi Block Diagram would be appreciated. ~Team 3763. Adam. |
Re: No clue where to start on Programming...
Option two should have worked for you, assuming you kept the same name for the RefNum so that the Drive block in Teleop would find it properly.
When you say you "deployed the code onto the cRIO", what exactly do you mean? Did you Build the project first? |
Re: No clue where to start on Programming...
I have done the whole "Build" through the Build Specifications part of the Project Viewer. Deploying the code to the cRIO is when you press the arrow in the upper left hand of the screen that points right. This transfers all programmed code onto the cRIO ready for use on the cRIO and Driver Station. It is also known as "Run."
Option two might not have worked for this reason, and I think I hit a breakthrough. I used the same refnum function blocks and everything, however this was only under the Begin.vi Block. I had never taken into account that the Teleop.vi is I guess for lack of a better word, the "control station" of programming. I looked under the Teleop.vi block, and I found a pathway I would call it where would show Left and Right Motors ---> Drive RefNum Get ---> Drive Arcade Drive. Along with that, the joystick information is also directed INTO the Drive Arcade Drive. Now, I THINK that because I never made a replicate of this path, motors 3 and 4 had nothing "controlling" them. No joystick function, no Drive RefNum Get. Nothing. However being that I am home now, I cannot "test" my theory for the time being. Any schematics, drawings, anything involving LabVIEW and how to wire up ADDITIONAL motors would be so helpful! Looking forward to all responses, Adam of Team 3763 - Wildcards |
Re: No clue where to start on Programming...
A HUGE shoutout to commonsense of Team 3452!
I have rewrote a fresh, new program and I have high hopes of this one working!! Come tomorrow I'll get back to all of you, read any new posts, and let you all know how I did. I have a great feeling about this, for once! Once again a shoutout to commonsense of Team 3452! And of course everyone else who has contributed in some sort of way! This is Adam of Team 3763 signing off until another day. Thank you everyone! |
Re: No clue where to start on Programming...
Each time I try to Deploy the new code onto the cRIO, a Conflict Resolution window appears. Below will be a Screenshot of the window.
If anyone knows why this is occuring and can help fix this, please reply. ASAP. http://imgur.com/lTOrP |
Re: No clue where to start on Programming...
Quote:
|
Re: No clue where to start on Programming...
Quote:
|
Re: No clue where to start on Programming...
Quote:
If you're deploying and running by clicking the run arrow (which is what I'm gathering from your description), make sure you do so from Robot Main, not one of the other VIs like Teleop, so that all the setup code runs. This method is fine for testing since you can set probes to see what's happening, but will not stay if you disconnect the laptop or reboot the robot. You also don't have to Build before running this way. When you have some code you'd like to stay in the robot after it's rebooted, use "Run at Startup" (not "Deploy") from the same right-click menu where you did the Build. You do need to complete a build before using this option. |
Re: No clue where to start on Programming...
I have run into yet another problem.
In LabVIEW, I cannot get our other 2 motors to respond to the programming. I've tried with 4-motor and 2-motor drives, and nothing works. We've checked all the hardware and wirings, with nothing working. If anyone can help, it would be great. I made sure I had everything edited properly in Teleop, Begin, and Finish vi's. Motors 3 and 4 were wired into PWMs 3 and 4, with neither working. However, 1 and 2 DO work, but because they were pre-programmed, I have no clue what the problem could be. A simple schematic would be great. A screenshot, anything really. In need of desperate help. |
Re: No clue where to start on Programming...
Quote:
What is the light on the speed controller showing, both before and after you Enable the robot using the Driver Station? |
Re: No clue where to start on Programming...
1 Attachment(s)
Here's what your Begin should look like and the original drive code must be gone.
Things to watch out for include:
That doesn't mean your PWM cables aren't reversed or something. |
Re: No clue where to start on Programming...
Quote:
To answer the previous question, all 4 Jaguars blinked a constant yellow. -The 2 motors that ACTUALLY worked then displayed a solid green or red, depending on their direction of travel. |
Re: No clue where to start on Programming...
Quote:
|
Re: No clue where to start on Programming...
http://imgur.com/pHaX7 --- Teleop.vi
http://imgur.com/hic4V --- Begin.vi http://imgur.com/mE9fR --- Finish.vi As you can see, I removed the original code, and then added in my OWN code. I can successfully deploy the robot code to the cRIO. Then, I switch over to the Classmate and I get Robot Communication and Code. However, when we move the joystick on our controller, motors 3 and 4 DO NOT respond with the code. There is no signal being sent to either Jaguar. Please help. If you know what the problem is, please tell. We are desperate right now. It's not our hardware or wiring. The only solution I can think of is the programming itself. So please explain what my problem is. |
Re: No clue where to start on Programming...
The quick answer is to zip the project folder (Documents/LabVIEW Data/project name) and post it here so we can see what the problem is, or at least isolate it to wiring vs programming.
P.S. Your photo hosting site is blocked here, so I'll take a look when I get home. Potential wiring problems include:
|
Re: No clue where to start on Programming...
I see nothing immediately wrong with the code. How are you deploying it to the robot?
When you say you "switch over to the Classmate", what exactly does that mean? |
Re: No clue where to start on Programming...
I have a Host Computer with LabVIEW downloaded onto it, and the Host computer is what I use for programming. I then deploy the code by pressing the right-facing arrow on-screen. Switching over to the Classmate I mean unplugging the Host computer (Ethernet chord) and plugging into the Classmate (again with an Ethernet chord).
|
Re: No clue where to start on Programming...
That would be bad, since the white arrow only runs in debug mode and automatically shuts down the cRIO code when your laptop disconnects.
Rebooting the cRIO restores previous code, which obviously is a two motor version. Either get a second Ethernet cable and go through a switch, so they can both remain plugged in, and/or download the code permanently. |
Re: No clue where to start on Programming...
We tried reversing the PWM cables, and our battery has full volts.
However, we have NO lights on the Sidecar, and it IS the one provided this year. That being said, 2 of our 4 motors work properly. As if they were "pre-programmed" |
Re: No clue where to start on Programming...
If you go to the Project Explorer -> build specifications -> FRC Robot Boot-up deployment and right click Boot-up Deployment, you should see an option "deploy." Would this work to permanently deploy the code onto the cRIO? If not, is there a way to PERMENANTLY deploy any new/changed code to the cRIO while using a Host computer?
|
Re: No clue where to start on Programming...
Quote:
Do you have 12 volt power connected to the Digital Sidecar's power input from a 20 amp circuit on the Power Distribution Board? You should. There is enough leakage through the signals from the cRIO to power a couple of PWM outputs, but you're not supposed to rely on that accident. To permanently load code to the cRIO, "Build" and then "Run as startup". There's really no use for the "Deploy" command in that popup menu. |
Re: No clue where to start on Programming...
Quote:
The ribbon cable does trickle enough power to maybe run a couple of the PWM outputs (unreliably). |
Re: No clue where to start on Programming...
If you installed everything from the LabVIEW USB you should have the FRC Driver Station program on your host computer. You can start that and run it in place of the ClassMate. If you are plugging your ethernet cables into the Wireless Bridge, you can plug both your host and classmate in at the same time. (Just make sure your host has a unique IP address ie not 10.te.am.6 or 10.te.am.5)
|
Re: No clue where to start on Programming...
Ok it was just a technical glitch in the computer/ports!
EVERYTHING is responding and working now. Thank you to ALL teams who helped! |
| All times are GMT -5. The time now is 22:25. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi