Go to Post "I need the adjustable hammer" "You mean that wren-" "No, it's a hammer" - Karibou [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 15-01-2012, 13:52
That Canadian That Canadian is offline
Registered User
FRC #0346 (RoboHawks)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Chesterfield
Posts: 13
That Canadian is an unknown quantity at this point
Digital Sidecar Control Not Working

My team and I have been trying to get our old robot running and the Digital Sidecar isn't responding to I/O commands. I can control a relay (spike) just fine, but we can't control the victor at all. It's just flashing orange. We know the PWM cable is good and the code is just very simple and should work. Also every node from the Digital I/O section of the Digital sidecar is giving out a constant 5v. Any help appreciated, I'll also post my code here in-case that may be the problem.
Code:
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.                             */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

package edu.wpi.first.wpilibj.templates;


import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Relay;
import edu.wpi.first.wpilibj.Victor;

/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the IterativeRobot
 * documentation. If you change the name of this class or the package after
 * creating this project, you must also update the manifest file in the resource
 * directory.
 */
public class RobotTemplate extends IterativeRobot {
    /**
     * This function is run when the robot is first started up and should be
     * used for any initialization code.
     */
    //ADXL345_I2C accel;
    Relay spike;
    Joystick joy;
    Victor vict;
    public void robotInit() {
        //accel = new ADXL345_I2C(1,ADXL345_I2C.DataFormat_Range.k2G);
        spike = new Relay(1);
        vict = new Victor(1);
        joy = new Joystick(1);
    }

    /**
     * This function is called periodically during autonomous
     */
    public void autonomousPeriodic() {

    }

    /**
     * This function is called periodically during operator control
     */
    public void teleopPeriodic() {
        //System.out.println("Acceleration X: " + accel.getAcceleration(ADXL345_I2C.Axes.kX));
        System.out.println("Joystick Y:" + joy.getY());
        vict.set(joy.getY());
        
        if(joy.getAxis(Joystick.AxisType.kY)<0)
        {
            spike.set(Relay.Value.kForward);
            System.out.println("Spike reverse");
        }
        else if(joy.getAxis(Joystick.AxisType.kY)>0)
        {
            spike.set(Relay.Value.kReverse);
            System.out.println("Spike reverse");
        }
    }
    
}

Last edited by That Canadian : 15-01-2012 at 13:55.
Reply With Quote
  #2   Spotlight this post!  
Unread 15-01-2012, 17:14
youxinche95 youxinche95 is offline
Registered User
AKA: Eugene Che
FRC #0649 (MSET)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Saratoga, CA
Posts: 18
youxinche95 is an unknown quantity at this point
Re: Digital Sidecar Control Not Working

Assuming your code is not throwing an exception as you are able to control the Spike, would you check if the pwm's are plugged in correctly, as that was the first mistake when we were programming our DT.

I'm pretty sure the code is fine though.

Good luck!
Reply With Quote
  #3   Spotlight this post!  
Unread 15-01-2012, 17:41
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,801
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Digital Sidecar Control Not Working

Did you move the cRIO modules around to their new positions?

__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 15-01-2012 at 17:43.
Reply With Quote
  #4   Spotlight this post!  
Unread 15-01-2012, 19:30
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,567
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Digital Sidecar Control Not Working

It is very hard to get a PWM cable installed in a Victor far enough the first time. I wouldn't be surprised if that was the problem.

Another possibility is if you had to fix your DB37 cable, it may not have been fully crimped, and only some of the pins made contact. I saw one robot where PWM 1 worked but PWM 2 did not because of that problem.

Last edited by Joe Ross : 15-01-2012 at 19:41.
Reply With Quote
  #5   Spotlight this post!  
Unread 15-01-2012, 19:52
ProgrammerMatt ProgrammerMatt is offline
Programmer-Electrical-Mechanical
FRC #0228 (Gus)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Southington
Posts: 138
ProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really nice
Re: Digital Sidecar Control Not Working

Dont you need a while loop in teleop? otherwise it just runs once no?
Reply With Quote
  #6   Spotlight this post!  
Unread 15-01-2012, 19:53
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Digital Sidecar Control Not Working

Quote:
Originally Posted by ProgrammerMatt View Post
Dont you need a while loop in teleop? otherwise it just runs once no?
Not in the Iterative template. The "periodic" functions in the Iterative Template are called once per DS packet, ~ every 20ms (which one gets called obviously depends on the current mode)
Reply With Quote
  #7   Spotlight this post!  
Unread 17-01-2012, 11:15
ProgrammerMatt ProgrammerMatt is offline
Programmer-Electrical-Mechanical
FRC #0228 (Gus)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Southington
Posts: 138
ProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really nice
Re: Digital Sidecar Control Not Working

Quote:
Originally Posted by RufflesRidge View Post
Not in the Iterative template. The "periodic" functions in the Iterative Template are called once per DS packet, ~ every 20ms (which one gets called obviously depends on the current mode)
Ah ok, im used to using:

Code:
public void operatorControl {
while(isOperatorControl) {


   }
}
Reply With Quote
  #8   Spotlight this post!  
Unread 16-01-2012, 15:23
That Canadian That Canadian is offline
Registered User
FRC #0346 (RoboHawks)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Chesterfield
Posts: 13
That Canadian is an unknown quantity at this point
Re: Digital Sidecar Control Not Working

Yes we do have the Modules in the correct new positions (minus the last solenoid breakout, we only have one of those). The DB37 cable should be fine, as we've used this robot before (it's ~6 years old.) however I will check the continuity of all pins once we meet again. I'll also be sure to triple-check PWM orientation and make sure it is in far enough, although I'm 99% sure orientation is correct.(Signal cable on outside of Victor?)
Reply With Quote
  #9   Spotlight this post!  
Unread 16-01-2012, 22:47
Derschatten Derschatten is offline
Registered User
FRC #1203 (Pandemonium)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2003
Location: West Babylon
Posts: 31
Derschatten is an unknown quantity at this point
Re: Digital Sidecar Control Not Working

Yes, White on the outside.
Reply With Quote
  #10   Spotlight this post!  
Unread 18-01-2012, 22:20
mkoval's Avatar
mkoval mkoval is offline
Registered User
AKA: Michael Koval
FRC #4281 (Bulldogs)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: New Jersey, USA
Posts: 8
mkoval has a spectacular aura aboutmkoval has a spectacular aura about
Re: Digital Sidecar Control Not Working

We're having the same issue, except we're controlling Jaguars instead of Victors. It's definitely a problem with either the software or the digital sidecar because we've probed the signal wire on the PWM cable and it is always 0 V.

Our digital module is plugged in Port 2 on the cRIO, which we believe is correct and it shows up as green in the provisioning tool. Were you able to diagnose your problem?
Reply With Quote
  #11   Spotlight this post!  
Unread 19-01-2012, 23:22
mkoval's Avatar
mkoval mkoval is offline
Registered User
AKA: Michael Koval
FRC #4281 (Bulldogs)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: New Jersey, USA
Posts: 8
mkoval has a spectacular aura aboutmkoval has a spectacular aura about
Re: Digital Sidecar Control Not Working

We solved this problem on our robot today. One of the connectors on the ribbon cable between the cRIO module and digital sidecar was not crimped tightly enough. This may be your problem as well if you received a faulty ribbon cable and had to correct re-crimp the connector yourself. Even if it superficially looks correct, it may not be crimped tightly enough to make the connections.

Check the LED next to the RSL connector on the digital sidecar. If it is not illuminated, then this is likely your problem.
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 22: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