Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Can't get motors to spin correct way. (http://www.chiefdelphi.com/forums/showthread.php?t=124973)

jee7s 20-01-2014 17:31

Re: Can't get motors to spin correct way.
 
Quote:

Originally Posted by Racer26 (Post 1329870)
First 3. RobotDrive instantiates the motors on its own but does not instantiate the Joysticks. (though stop to think of it, I'm not sure what it instantiates them as... Talon, Jaguar, and Victor all extend the MotorController class...)

For total clarity, that means you need to declare these:
RobotDrive chassis = new RobotDrive(1, 2);
private final Joystick leftStick = new Joystick(1);
private final Joystick rightStick = new Joystick(2);

And then call this:
chassis.TankDrive(leftStick, rightStick);

If you then have a side spinning in the wrong direction, swap the MOTOR wiring on the Talon OUTPUT. (Don't swap the input wiring, as you'll fry the talon.)

Racer26 20-01-2014 17:31

Re: Can't get motors to spin correct way.
 
Quote:

Originally Posted by Wzup4021 (Post 1329871)
While I see what you're saying, I don't think that's the issue. We can control the speed and on/off of the motors fine, and the direction. Forward on the joystick is moving the wheels backwards, and backwards on the JS is moving the wheels forwards.

...so flip the polarity of the wires at the output of the speed controllers.

Wzup4021 20-01-2014 17:44

Re: Can't get motors to spin correct way.
 
Okay, we discussed reversing the output wires on the Talons, but our team members are worried that in inspection they will tell us we can't have red to negative and black to positive. Has anybody had to reverse hot/cold wires and gotten in trouble for it, or were inspectors okay with it?

jee7s 20-01-2014 17:47

Re: Can't get motors to spin correct way.
 
Quote:

Originally Posted by Wzup4021 (Post 1329882)
Okay, we discussed reversing the output wires on the Talons, but our team members are worried that in inspection they will tell us we can't have red to negative and black to positive. Has anybody had to reverse hot/cold wires and gotten in trouble for it, or were inspectors okay with it?

Speaking as an inspector, we don't mind which color wire goes to which output terminal of the talon or any other speed controller to a motor. Strictly speaking, those don't have a polarity since the talon can reverse it based on the PWM signal it receives. It's only the input side we worry about, and as I said before, if you hook that up backwards you destroy the talon.

MANY teams have the speed controller output polarities flipped on one side of the robot.

Joe Ross 20-01-2014 17:54

Re: Can't get motors to spin correct way.
 
Quote:

Originally Posted by Wzup4021 (Post 1329882)
Okay, we discussed reversing the output wires on the Talons, but our team members are worried that in inspection they will tell us we can't have red to negative and black to positive. Has anybody had to reverse hot/cold wires and gotten in trouble for it, or were inspectors okay with it?

If anyone does have a problem, show them R49.

However, I do recommend getting to the bottom of the software issue. It may be important for some other system in the near future.

Gregor 20-01-2014 18:27

Re: Can't get motors to spin correct way.
 
Before this turns into another thread discussing the merits of inverting the motors physically or in code, it's already been done.

http://www.chiefdelphi.com/forums/sh...d.php?t=122186

Racer26 20-01-2014 20:31

Re: Can't get motors to spin correct way.
 
For what its worth, IIRC the TankDrive() method of the RobotDrive class automatically takes into account that you have to turn one side backwards.

Wzup4021 21-01-2014 16:54

Re: Can't get motors to spin correct way.
 
Thanks for the help, we ended up just flipping around the 2 PWM cables that are going out the the 4 talons and that fixed out problem. Side question: I know we need a different talon for each motor, but do we need a different PWM cable for each talon, or can we use PWM splitters?

cgmv123 21-01-2014 17:13

Re: Can't get motors to spin correct way.
 
Quote:

Originally Posted by Wzup4021 (Post 1330353)
Side question: I know we need a different talon for each motor, but do we need a different PWM cable for each talon, or can we use PWM splitters?

PWM splitters are legal, and in many cases, recommended.


All times are GMT -5. The time now is 22:05.

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