Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   need a simple motor program (http://www.chiefdelphi.com/forums/showthread.php?t=83687)

Bill Taylor 27-02-2010 15:05

need a simple motor program
 
I am using the basic FRC wizard to generate the program and the only modification is that i have switched the default 2 motor tank to a 4 motor arcade by simply replacing the VI's. This worked fine. i need to control a motor on the 2nd joystick y axis thru pwm 5. i understand a little about labview but i cannot figure out where to place code for this motor. does it need to placed inside the execute case struture on Teleop? do i need to set up references in the Begin part. the software gives examples but no clear explanation of where it goes. if someone could give me a simple solution and preferably a diagram, that'd be great!

Mark McLeod 27-02-2010 17:09

Re: need a simple motor program
 
3 Attachment(s)
Did you find the single motor palette okay?
It can be gotten to in two different places:
WPI Robotics Library -> Actuators -> MotorControl
or
WPI Robotics Library -> RobotDrive ->Advanced -> MotorControl
----------------------------------------
Begin.vi -- open everything here
  • Motor Open (open the PWM and tell LabVIEW what it's going to be)
  • Motor Refnum Set (name your motor)
Teleop.vi -- use everything here
  • Motor Refnum Get (usually kept outside the case, so it can be used in all cases if necessary)
  • Motor Set speed (inside the Teleop Execute case)
Finish.vi -- close everything here
  • Motor Refnum Get
  • Motor Close
I removed much of the cluttering default code in these screen shots.

Bill Taylor 27-02-2010 17:49

Re: need a simple motor program
 
thanks. i've plugged this in and its running. i've tied it to a window motor and when i push on the stick full it moves but very slow, even for a window motor. while in operator mode the driver station shows the #5 PWM feedback as only about half even though i'm pushing the stick all the way. anyway to speed it up full?

Mark McLeod 27-02-2010 18:02

Re: need a simple motor program
 
Are you using a Victor or a Jaguar?
Make sure the Motor Open in Begin.vi is set for the correct one.

Other than that, I'd suspect the joystick wasn't doing it's best.
Make sure when you plug in the USB joystick that it's in neutral.

Bill Taylor 27-02-2010 18:04

Re: need a simple motor program
 
victor. its set in the Begin.

Mark McLeod 27-02-2010 18:08

Re: need a simple motor program
 
The Victor might need to be calibrated then.
Page 2 of this.
No, strike that. The Dashboard PWM indicator could only be fooled by the joystick input.

You can take the joystick out of the loop temporarily by changing the Motor Set Speed to use a constant (1=full backwards or -1=full forwards).
Since the window motors probably attached to something, you can pull the breaker for it and just watch the Dashboard PWM indicator to see if it goes to full.

Bill Taylor 27-02-2010 18:24

Re: need a simple motor program
 
recalibrated the victor and switched joysticks. same effect. its like its running at almost half speed. any way to double the value between the joystick vi and get speed vi?

Mark McLeod 27-02-2010 18:43

Re: need a simple motor program
 
Is the Victor status light going red when you push the joystick all the way forward-an indication of full speed?

You can certainly multiply the joystick output, but the range of the motor speed is only -1 to 1, the same as the joystick. A larger number would get cut back to 1. And calibrating the victor to the joystick range should have made it full speed no matter what.

Not a low battery, bad wire connection, or anything simple like that is it?

Bill Taylor 27-02-2010 19:30

Re: need a simple motor program
 
you're right, doubling the value didn't help. it has the same behavior. wiring and all that looks good and everything works as expected (lights, blinkies, indicators) except it is slow.

Mark McLeod 27-02-2010 19:36

Re: need a simple motor program
 
Is it a new motor, possibly damaged?
That's the only other thing that comes to mind.

At full speed you should be able to test with a multi-meter to see if the motor's receiving the full 12v or close to it. Readings at other speeds won't come out right without a more sophisticated meter.

Bill Taylor 27-02-2010 19:41

Re: need a simple motor program
 
thats the only thing i can think of is a bad motor or controller. i'm gonna swap them out at the shop monday and see if something happens. this victor came out of an "old box" and may have went bad. might just switch it with a jaguar. thanks for the help. i really appreciate it.

Joe Ross 27-02-2010 20:23

Re: need a simple motor program
 
If the dashboard PWM isn't showing full value, then the problem is not on the robot side.

Alan Anderson 27-02-2010 22:30

Re: need a simple motor program
 
Quote:

Originally Posted by Bill Taylor (Post 929531)
recalibrated the victor and switched joysticks. same effect. its like its running at almost half speed. any way to double the value between the joystick vi and get speed vi?

Doubling a value is easy, but there's obviously something unusual going on here. Let's try to figure out what's wrong before trying to patch it.

Run the code (open the Robot Main vi and click the white "run" arrow at the top) and probe the value coming out of the joystick vi. If it doesn't go full range (+1 to -1) as you move the joystick, that's a clue that the problem is in one direction. If it does go full range, that's a clue that the problem is in a different direction. What do you see?


All times are GMT -5. The time now is 11:04.

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