Go to Post Ah, this sounds like a sitcom whose pilot I should write and send to NBC - "Life With Lavery". There's a lot of eating, several practical jokes, and lots of bad hair. - Amanda Morrison [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-04-2016, 19:57
Aventek Aventek is offline
Registered User
AKA: Kyler Novotny
FRC #3019 (Firebird Robotics)
Team Role: Programmer
 
Join Date: Feb 2016
Rookie Year: 2013
Location: Scottsdale, Arizona
Posts: 2
Aventek is an unknown quantity at this point
Victor SP toggling from neutral to forward when enabled

When our robot is enabled, one of our victor sp's constantly swaps from neutral to forward.
we have tried:
  • swapping the victor with a new one
  • swapping and reimaging the roboRIO
  • changing the cables to and from victor(power and motor output)
  • swapping PWM location on the roboRIO
This is dumbfounding our team and we have no idea whats up with the ghost motor. The only possibility we have thought of is the code, but we cannot find anything. If anyone could take a look at the code or has any idea what else could be the problem, please comment. This is our repository on GitHub: https://github.com/Aventek/ExarchCode
Reply With Quote
  #2   Spotlight this post!  
Unread 04-04-2016, 20:05
Hadi379's Avatar
Hadi379 Hadi379 is offline
Registered User
FRC #0379
 
Join Date: Jan 2007
Location: Girard
Posts: 156
Hadi379 is a splendid one to beholdHadi379 is a splendid one to beholdHadi379 is a splendid one to beholdHadi379 is a splendid one to beholdHadi379 is a splendid one to beholdHadi379 is a splendid one to beholdHadi379 is a splendid one to behold
Re: Victor SP toggling from neutral to forward when enabled

Did you try calibrating the speed controller? If that's not the fix, and you've done all other, I may think it's the code.

Do you have an encoder or some other sensor on the drive?
Reply With Quote
  #3   Spotlight this post!  
Unread 04-04-2016, 20:14
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 243
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
Re: Victor SP toggling from neutral to forward when enabled

Concur it sounds like code. Can you replicate with a very simple new test program which is driving just that victor? Which motor is it (e.g. which PWM output is it hooked up to)? When you swapped PWM output connections did the problem move with the victor or with the PWM output? Can you give us any other details (e.g. does it happen in teleop or autonomous, as soon as you enable or only when a certain button is pressed, etc). Thanks for linking to your code, but without knowing which motor it is it's very difficult to narrow the scope of the code review to find the problem more quickly.
__________________
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)
Reply With Quote
  #4   Spotlight this post!  
Unread 04-04-2016, 20:45
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,994
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Victor SP toggling from neutral to forward when enabled

Quote:
Originally Posted by Aventek View Post
swapping the victor with a new one
could you try swapping the Victor SP with a Victor 888.


Reply With Quote
  #5   Spotlight this post!  
Unread 04-04-2016, 22:24
nighterfighter nighterfighter is offline
1771 Alum, 1771 Mentor
AKA: Matt B
FRC #1771 (1771)
Team Role: Mentor
 
Join Date: Sep 2009
Rookie Year: 2007
Location: Suwanee/Kennesaw, GA
Posts: 835
nighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant future
Re: Victor SP toggling from neutral to forward when enabled

Make sure your code is declaring the right type of Victor object (Can't view your code while on my phone.)

I'd also try recalibrating the Victor, and recalibration of the joysticks. Or unplug the joysticks and see if it still does it.
__________________
1771- Programmer, Captain, Drive Team (2009-2012)
4509- Mentor (2013-2015)
1771- Mentor (2015)
Reply With Quote
  #6   Spotlight this post!  
Unread 05-04-2016, 00:05
Fauge7 Fauge7 is offline
Head programmer
FRC #3019 (firebird robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Scottsdale
Posts: 195
Fauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to all
Re: Victor SP toggling from neutral to forward when enabled

Thank you, Will try these when we meet tomorrow, it really is not that big of a deal as it spins at a very slow speed. We did calibrate the motor controller and found it made 0 difference.
Reply With Quote
  #7   Spotlight this post!  
Unread 05-04-2016, 08:15
GreyingJay GreyingJay is offline
Robonut
AKA: Mr. Lam
FRC #2706 (Merge Robotics)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2015
Location: Ottawa, Canada
Posts: 733
GreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond repute
Re: Victor SP toggling from neutral to forward when enabled

This won't help you for the immediate future, but my team bought a few PWM signal generators - sold on Amazon as servo testers - and found them extremely helpful for diagnosing issues like these.

I like this one:

http://www.amazon.com/Andoer-Tester-...dp/B00LTOD4F4/

You can connect several PWM cables at the same time and verify that all the motor controllers are behaving the same.

They're very cheap, but they ship from China so don't expect them to arrive for 2-3 weeks. If you needed something sooner, AndyMark or your local hobby store sells similar devices, or you could roll your own.
Reply With Quote
  #8   Spotlight this post!  
Unread 05-04-2016, 08:40
FrankJ's Avatar
FrankJ FrankJ is offline
Robot Mentor
FRC #2974 (WALT)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2009
Location: Marietta GA
Posts: 1,878
FrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond repute
Re: Victor SP toggling from neutral to forward when enabled

One to keep in mind. When disabled, the Roborio sends no PWM signal which the speed controls interprets as disabled. When enabled the Roborio sends the PWM signal it is told to send. 0 speed or "neutral" is actually in the middle of PWM band which is distinctly different than the disabled non signal. The LED on the Victor will tell you the signal it is receiving. Writing the signal that is being sent to the PWM channel is also useful. You can write to smart dashboard or print it to the DS message display. BTW It is not unusual for an unloaded motor to spin slowly at 0 speed if you are using a joy stick to control it without any headband for zero speed.

The meaning of the various blinkly control systems LEDs can be found here. Really useful for findind ghosts and other control problems.
__________________
If you don't know what you should hook up then you should read a data sheet
Reply With Quote
  #9   Spotlight this post!  
Unread 05-04-2016, 10:48
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,994
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Victor SP toggling from neutral to forward when enabled

Quote:
Originally Posted by GreyingJay View Post

What's the difference between these three modes?

Quote:
Button the Select (Note: the key switch function, circulation patterns)
1. S-1 manual mode (Manual)
2. S-2-bit mode (Neutral)
3. S-3 automatic mode (Automatic)

Also, were you able to figure out what this means?

Quote:
With PPM signal test function in the display, the input PPM signal changes while the input the PPM signal synchronization output to the servo Energized automatically

Reply With Quote
  #10   Spotlight this post!  
Unread 05-04-2016, 12:22
GreyingJay GreyingJay is offline
Robonut
AKA: Mr. Lam
FRC #2706 (Merge Robotics)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2015
Location: Ottawa, Canada
Posts: 733
GreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond repute
Re: Victor SP toggling from neutral to forward when enabled

Quote:
Originally Posted by Ether View Post
What's the difference between these three modes?
Mode 1 is the mode we use most, where simply turning the knob changes the PWM duty cycle, which is displayed on the LED readout. Mode 2 is some variation of this but I don't recall the details. We just never really used it. Mode 3 sweeps the duty cycle between the min and max values. Great for making a servo swing back and forth but not so useful for FRC. Makes the wheels go from full forward to full reverse and back again within a pretty short span. I wouldn't leave it doing that for very long.

Quote:
Originally Posted by Ether View Post
Also, were you able to figure out what this means?
I think that's either trying to say that since there are three separate PWM outputs linked to the input, that you could connect three servos (or 3 motor controllers) and make sure their movements are synchronized, or simply that the output PWM value is automatically synchronized to the input from the knob. Who knows!
Reply With Quote
  #11   Spotlight this post!  
Unread 05-04-2016, 13:07
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,994
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Victor SP toggling from neutral to forward when enabled

Quote:
Originally Posted by GreyingJay View Post
Mode 1 is the mode we use most, where simply turning the knob changes the PWM duty cycle, which is displayed on the LED readout.
A few more questions, if I may. Hope you don't mind, I'm truly interested.

Resolution and stability: How fine is the resolution, and once you've dialed in a desired pulse width and taken your hand off the dial, is it stable at that value?

Toggling: Is it practical to toggle the PWM output back and forth between neutral and a pre-set value by using the "Select" button, or does Mode3 get in the way if you try to do that?

Have you cracked one of these open to see what kind of circuit they use?

Have you successfully operated a Talon SRX with this device?


Reply With Quote
  #12   Spotlight this post!  
Unread 05-04-2016, 14:20
GreyingJay GreyingJay is offline
Robonut
AKA: Mr. Lam
FRC #2706 (Merge Robotics)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2015
Location: Ottawa, Canada
Posts: 733
GreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond repute
Re: Victor SP toggling from neutral to forward when enabled

Quote:
Originally Posted by Ether View Post
Resolution and stability: How fine is the resolution, and once you've dialed in a desired pulse width and taken your hand off the dial, is it stable at that value?

Toggling: Is it practical to toggle the PWM output back and forth between neutral and a pre-set value by using the "Select" button, or does Mode3 get in the way if you try to do that?

Have you cracked one of these open to see what kind of circuit they use?

Have you successfully operated a Talon SRX with this device?
I have used the device to operate Talon SRX's and Victor 888's, the two controllers we used on our robots. The context of the tests were simply to verify that the motor controller was working, or that the cable was good, so I'm afraid I don't have solid answers as to stability or accuracy. I have also used it to test the servos on our pan/tilt camera unit.

The 4-digit LED readout lets you dial in any value in microseconds, assuming a steady hand, between about 800 and 2200 (I believe). How finely would this correlate to the actual output signal? I don't know, sorry. The dead band is right at 1500 and the motors turn from "very slowly" to "very fast" at the extreme ranges, and that's all I really ever needed this thing to do. I strapped a 4-AA battery pack to this unit and called it a "quick and dirty PWM tester".

I haven't ever cracked it open but if I get a chance I'll report back the results!
Reply With Quote
  #13   Spotlight this post!  
Unread 05-04-2016, 11:11
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Victor SP toggling from neutral to forward when enabled

Quote:
Originally Posted by Aventek View Post
When our robot is enabled, one of our victor sp's constantly swaps from neutral to forward.
we have tried:
  • swapping the victor with a new one
  • swapping and reimaging the roboRIO
  • changing the cables to and from victor(power and motor output)
  • swapping PWM location on the roboRIO
This is dumbfounding our team and we have no idea whats up with the ghost motor. The only possibility we have thought of is the code, but we cannot find anything. If anyone could take a look at the code or has any idea what else could be the problem, please comment. This is our repository on GitHub: https://github.com/Aventek/ExarchCode
My best guess, as it seems like a really common issue that I debug, is that you are setting the motor speed in two different places.

What motor is giving you trouble in the code? I have found these:
Code:
public static final int leftRearDrivePWM = 3;//3
public static final int leftFrontDrivePWM = 2;//0
public static final int rightRearDrivePWM = 1;//1 
public static final int rightFrontDrivePWM = 0;//2 
public static final int leftLaunchPWM = 4; 
public static final int rightLaunchPWM = 5;
public static final int liftAnglerPWM = 6;  
public static final int liftAngler2PWM =7;
public static final int launchAnglerPWM = 8;
public static final int intakeArmsPMW = 9;
Looking through your code, I'm placing my bets on the launch motor.

In commands/Launch.java, you're calling Robot.launcher.launch(shootSpeed) and Robot.launcher.intakeControl(0):
Code:
protected void execute() {
		
		// spinning launcher motors
		if (Robot.oi.buttonLaunch.get()) {
			// when lBump is held down run motors for launching
			Robot.launcher.launch(shootSpeed);
			Robot.launcherState = LauncherState.LAUNCH;
		} else if (Robot.oi.buttonIntake.get()) {
			// when rBump is held down run motors for intake
			Robot.launcherState = LauncherState.INTAKE;
			Robot.launcher.launch(loadSpeed);
			Robot.launcher.intakeControl(barSpeed);
			Robot.launcherState = LauncherState.INTAKE;
		} else if (auto){
			Robot.launcher.launch(shootSpeed);
			Robot.launcher.intakeControl(0);
			Robot.launcherState = LauncherState.AUTO;
			
		} else {
			// when neither are held down dont run motors
			Robot.launcher.intakeControl(0);
			Robot.launcher.launch(0);
			Robot.launcherState = LauncherState.STILL;
		}
		
		if(Robot.anglerState != AnglerState.PID){
			// activate angler
			if (Robot.oi.buttonShooterDown.get()) {
				// when B is held down angle launcher down
				Robot.launcher.angleLauncher(motorDownSpeed);
				Robot.anglerState = AnglerState.ANGLING_DOWN;
			} else if (Robot.oi.buttonShooterUp.get()) {
				// when X is held down, angle launcher up
				Robot.launcher.angleLauncher(motorUpSpeed);
				Robot.anglerState = AnglerState.ANGLING_UP;
			} else {
				// stop angling
				Robot.launcher.angleLauncher(0);
				Robot.anglerState = AnglerState.STILL;
			}
		}
		
		//control servo based on state
		if(Robot.servoState == ServoState.RETRACTED){
//			Robot.launcher.servoControl(extendedPosition);
		} else if(Robot.servoState == ServoState.EXTENDED){
//			Robot.launcher.servoControl(retractedPosition);
		}

	}
Take a look at the subsystem code for those two commands in subsystem/Launcher.java:
Code:
	public void intakeControl(double speed){
		
		leftLaunch.set(-.4);
		rightLaunch.set(-.4);
		intakeBar.set(speed);
	
	}

	// sets launch motors to spin and then set servo to firing position
	public void launch(double speed) {

		// setting launch motors
		leftLaunch.set(speed);
		rightLaunch.set(speed);

	}
You're setting the speed in two different places. That will cause issues.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 06:20.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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