Go to Post While at kickoff I asked Woodie if there were any concerns about missed shots at the center goal hitting the operators or the controls. He handed me a ball and told me to throw it at him as hard as I could... How many times does an opportunity like that come up? - Barry Bonzack [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 18-02-2010, 21:10
dan_h dan_h is offline
EE Grad Student
AKA: Dan Huizenga
#0518
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Grand Rapids, MI
Posts: 20
dan_h is an unknown quantity at this point
Help! Can't get PWMs to work...

I'm trying to get our control system working, and everything seems to be communicating properly (diagnostics shows communication, robot code, stop button, left stick, enet link, ds radio, bridge, and robot as all green), and when I enable the robot in teleop the RSI light switchs to long on/ short off, however, output to the PWMs doesn't seem to be working. Our robot code is as follows:

Code:
#include "WPILib.h"

class DefaultRobot : public SimpleRobot
{
	RobotDrive *myRobot;			// robot drive system
	Joystick *rightStick;			// joystick 1 (arcade stick or right tank stick)
	DriverStation *ds;				// driver station object

public:
	/**
	 * 
	 * 
	 * Constructor for this robot subclass.
	 * Create an instance of a RobotDrive with left and right motors plugged into PWM
	 * ports 1 and 2 on the first digital module.
	 */
	DefaultRobot(void)
	{
		ds = DriverStation::GetInstance();
		myRobot = new RobotDrive(1, 2, 3, 4);	// create robot drive base
		rightStick = new Joystick(1);			// create the joysticks
		//Update the motors at least every 100ms.
		GetWatchdog().SetExpiration(100);
	}

	/**
	 * Drive left & right motors for 2 seconds, enabled by a jumper (jumper
	 * must be in for autonomous to operate).
	 */
	void Autonomous(void)
	{
		GetWatchdog().SetEnabled(false);

		myRobot->Drive(0.5, 0.0);			// drive forwards half speed
		Wait(2000);							//    for 2 seconds
		myRobot->Drive(0.0, 0.0);			// stop robot

		GetWatchdog().SetEnabled(true);
	}

	void OperatorControl(void)
	{
		Jaguar temp(5);
		
		temp.Set(1.0); /* Expect, at the least, to see PWM5 on slot 4 move */
		
		while (IsOperatorControl())
		{
			GetWatchdog().Feed();
			myRobot->ArcadeDrive(rightStick);  // drive with arcade style (use right stick)
		}
	}
};

START_ROBOT_CLASS(DefaultRobot);
At the very least, I would expect to see PWM5 move. I also tried adding a printf to show the location of the joystick Y axis (through the target console in the debugger), and it updated as expected. Any help would be greatly appreciated!
__________________
--
Team 518 Home Page
Reply With Quote
  #2   Spotlight this post!  
Unread 19-02-2010, 12:24
Racer26 Racer26 is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Beaverton, ON
Posts: 2,229
Racer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond repute
Re: Help! Can't get PWMs to work...

Do you have 12V wired into the sidecar through the WAGO connector? are all three lights at the bottom of the sidecar on, is the sidecar connected to the DIO module in slot 4 on your cRIO?
Reply With Quote
  #3   Spotlight this post!  
Unread 19-02-2010, 20:54
dan_h dan_h is offline
EE Grad Student
AKA: Dan Huizenga
#0518
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Grand Rapids, MI
Posts: 20
dan_h is an unknown quantity at this point
Re: Help! Can't get PWMs to work...

Quote:
Originally Posted by 1075guy View Post
Do you have 12V wired into the sidecar through the WAGO connector? are all three lights at the bottom of the sidecar on, is the sidecar connected to the DIO module in slot 4 on your cRIO?
12V -> Yes, lights -> On, Sidecar connected to slot 4 -> Yes

In addition, the expected pattern blinks on the RSI light.

Interestingly, the dashboard shows now change in the PWM output level, which leads me to believe that it's probably not a connection problem, and more likely a software problem ... it's just that I can't find anything that's out of place. I'm going to try formatting and reflashing the cRio tomorrow, because I'm out of ideas.
__________________
--
Team 518 Home Page
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get program to execute Thxe C/C++ 3 09-02-2009 08:33
CANT GET THE CANERA CODE TO WORK!!!! plz HELP!! its da PAT!!! Programming 3 18-02-2007 23:07
Can't get EDU RC to print things. devicenull Programming 2 29-01-2006 16:42
can't get R/C controller to work with EDUbot sweet-chan Robotics Education and Curriculum 2 04-03-2005 01:35
Why can't we get along? Sean_330 General Forum 23 19-03-2003 21:38


All times are GMT -5. The time now is 13:27.

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