Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Perspective on code for motors and Robot arm (http://www.chiefdelphi.com/forums/showthread.php?t=92039)

Team 2524 16-02-2011 18:34

Perspective on code for motors and Robot arm
 
1 Attachment(s)
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

Ian McShane 16-02-2011 18:45

Re: Perspective on code for motors and Robot arm
 
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.:D

Ian McShane 16-02-2011 18:48

Re: Perspective on code for motors and Robot arm
 
Oh, and what vi is this supposed to be in?

Vikesrock 16-02-2011 20:10

Re: Perspective on code for motors and Robot arm
 
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.

Team 2524 17-02-2011 08:23

Re: Perspective on code for motors and Robot arm
 
1 Attachment(s)
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?

Chris Hibner 17-02-2011 10:42

Re: Perspective on code for motors and Robot arm
 
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?

DavidGitz 17-02-2011 10:47

Re: Perspective on code for motors and Robot arm
 
Quote:

Originally Posted by Team 2524 (Post 1024959)
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?

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?

Team 2524 17-02-2011 11:26

Re: Perspective on code for motors and Robot 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?

Chris Hibner 17-02-2011 11:29

Re: Perspective on code for motors and Robot arm
 
Quote:

Originally Posted by Team 2524 (Post 1025096)
Well, I thought it would be easier to be able to use two 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.

DavidGitz 17-02-2011 12:11

Re: Perspective on code for motors and Robot arm
 
Quote:

Originally Posted by Team 2524 (Post 1025096)
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?

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.

Team 2524 17-02-2011 15:14

Re: Perspective on code for motors and Robot arm
 
3 Attachment(s)
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.

Mark McLeod 17-02-2011 15:36

Re: Perspective on code for motors and Robot arm
 
1 Attachment(s)
Tank/Arcade Drive is for robot bases.

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

Team 2524 17-02-2011 15:47

Re: Perspective on code for motors and Robot arm
 
1 Attachment(s)
sorry, here is the telop vi.

DavidGitz 17-02-2011 19:50

Re: Perspective on code for motors and Robot arm
 
1 Attachment(s)
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.


All times are GMT -5. The time now is 09:19.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi