Perspective on code for motors and Robot arm

I am a rookie programmer and I went to another school(Team 3059) to help/teach us a little about programming in LabVIEW. This is one of the codes i built using parts of the code that Team 3059 gave us. (In Teleop.vi)

I need some advice and criticism on this code.

Thank You:D





It depends what you want it to do. i can’t help you much if i don’t know what it is supposed to do.:smiley:

Oh, and what vi is this supposed to be in?

This code does not match the way that the framework is intended to function.

I would recommend heading over to www.frcmastery.com and watching at least the first video under “2011 FRC Steps to Robot Success” on the right side of the page. They really do a good job.

I placed that code into the Telop.vi.

I placed this code into the Begin.vi.

Would this be a proper setup for using buttons to switch between robot arm and motor?

Big Arm and Little Arm.jpg


Big Arm and Little Arm.jpg

To make it less confusing, I would get rid of the tank drive and just use Motor Set Output for each motor.

Do you have a picture of the arm so we can see how it is supposed to work?

I don’t see on this image the differentiation between Begin and Teleop. For your reference, the last function for each reference in the Begin should end with a Set Reference. The first function for each reference in Teleop should be a Get Reference.

And for clarification, why would you use Tank Drive on an Arm?

Well, I thought it would be easier to be able to have two joystick controls for our robot since tank mode involves using two joystick controls, correct?:confused:

Arcade mode only uses one joystick?

I guess I’m confused. Or you trying to drive an arm, or your drive system? The name of the Ref is “Big Arm” and “Little Arm”, so I thought you are commanding motors on an arm.

You should post the specifications for your system so we can help better.
Drive: What mode (Tank or Arcade)? Which Joystick(s) (need 1 for Arcade, need 2 for Tank)? What PWM Channels? What type of Speed Controllers?
Arm: How many Arms exactly (you referenced Big, Little Arms)? How do you want to control? (Joystick y-axis for each Arm I assume?) Which Joystick(s) control this? What PWM Channels?

The more text the better. So far the issue is not enough information and cryptic posts.

Drive: Tank Mode
Joysticks: 2 for Tank Mode
Number of Arms: 2 (1 big Arm and 1 little Arm)
Speed Controller: 2 Jaguars(2 motors for Big Arm)
1 Victor(Little Arm)
PWM channels: 1 & 2 for Drive motors
PWM channels:3 & 4 for Big Arm
PWM channel: 5 for Little Arm

Arm Movement: Y-Axis direction(correct me if I’m wrong)

Goal: Be able to press a button to switch from Drive motors to Arm motors. I want to have each joystick control an arm.

I posted the Begin.vi and Telop.vi to make it easier.
Also Pictures of Big Arm and Little Arm.

110217-025946.jpg
110217-025908.jpg
110217-025846.jpg


110217-025946.jpg
110217-025908.jpg
110217-025846.jpg

Tank/Arcade Drive is for robot bases.

Arm and other appendage motors are done this way:
WPI robotics Library -> Robot Drive -> Advanced -> Motor Control

MotorExample.jpg


MotorExample.jpg

sorry, here is the telop vi.

Teleop.vi (18.7 KB)


Teleop.vi (18.7 KB)

Attached .vi will perform this. Normally I would not post code but since we are only a few days left till shipment and you are struggling with tank drive here you go. Make sure you put the code that is marked “Begin.vi” in the Begin.vi and the code that is marked “Teleop.vi” in the Teleop.vi

A few suggestions:

  1. Since your Arm will be controlled by 2 motors you should use a PWM Y-Cable and only use 1 PWM Channel on the DSC. I made this assumption in the code that I wrote since we received them in the KOP.
  2. Get more joysticks. I would not want to be the drive team that only has 1 person driving AND operating the arm. It can get pretty confusing and besides it will maximize your efficiency if you have 2 people on your drive team.

    Code.vi (21.7 KB)


    Code.vi (21.7 KB)