Go to Post We also use CAD heavily. Cardboard Aided Design. Which is considerably more accessible and intuitive to most students than the other CAD. - JamesCH95 [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 27-01-2009, 02:45
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Victor::Set not working

I am sure this is operator error somehow but I don't see it. I initialize a new Victor instance like this:

...
#define CARD_HELICALRAMP 4
#define PWM_HELICALRAMP 3
...
pMotor = new Victor(CARD_HELICALRAMP, PWM_HELICALRAMP);
...

and use it like this:

...
pMotor->Set(fMotor);
...

The pMotor member pMotor is *Victor type and fMotor is a float. The physical output is not updating. No error messages appear on the console. Am I doing something wrong? I know the function is getting called and I know the fMotor value is in the correct range (I put a printf just before the line above).

The Set call is from a different task but that should not matter (I think). This is the only PWM I have declared at this point (no RobotDrive or anything else). Does that matter? I have only one sidecar hooked up to the DIO in slot 4. This is wired to PWM 3. Do I have to start at PWM 0 for some undocumented reason?

Any advice or help is much appreciated!
Reply With Quote
  #2   Spotlight this post!  
Unread 27-01-2009, 08:49
Eric Finn's Avatar
Eric Finn Eric Finn is offline
Registered User
FRC #0166 (Chop Shop)
Team Role: College Student
 
Join Date: May 2006
Rookie Year: 2005
Location: Merrimack, NH
Posts: 101
Eric Finn has a spectacular aura aboutEric Finn has a spectacular aura about
Send a message via AIM to Eric Finn
Re: Victor::Set not working

What's happening on the Victor? Does it have a solid light (set as neutral) or is it blinking (no signal)?

Try hooking up the console and creating print statements before *and* after the call to Set.

Also, make sure that fMotor is from -1 to 1.
__________________
It always takes longer than you expect, even when you take into account Hofstadter's Law.
--Hofstadter's Law

Reply With Quote
  #3   Spotlight this post!  
Unread 27-01-2009, 11:56
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Victor::Set not working

The print statements before and after the Set call look correct. The Victor is blinking as if it is not being written to at all. I am thinking something is wrong with the PWM class or the FPGA code. Maybe something HAS to be on the first channel? The simple and iterative examples work on my system and they all use the first channel. Who knows? I'll try tinkering with it tonight.
Reply With Quote
  #4   Spotlight this post!  
Unread 27-01-2009, 12:44
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Victor::Set not working

A blinking Victor does not point to a problem with your code. It says there is no PWM signal being received by it at all. This could be due to a number of things that are not programming issues.

First, does the Driver Station display tell you the system is enabled? A disabled robot does not send PWM signals.

Second, is there power being supplied to the Digital Sidecar? You should see the 12v, 6v, and 5v LEDs light up.

Third, is the system really enabled? The LED next to the Robot Status Light pins should be on steady. If it's blinking, that means the robot is disabled. If it's off, that could mean the cable from the Digital I/O module to the Digital Sidecar isn't hooked up right.

Finally, is the PWM cable from the Digital Sidecar to the Victor connected properly? The black lead of the cable should be next to the edge of the Digital Sidecar, and toward the fan on the Victor. It isn't always obvious when the pins are fully inserted in the Victor, so try reseating it.

After you verify that the system is correctly enabled and powered, if you still can't get the Victor to stop blinking yellow, try replacing it with a servo (making sure to install the servo power jumper on the adjacent DS pins) and see if that responds.
Reply With Quote
  #5   Spotlight this post!  
Unread 27-01-2009, 16:04
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Victor::Set not working

It is enabled. It is running. The PWM cables are wired correctly because the SimpleRobot demo works. I added a call to RobotDrive to see if that performed some magic inside the PWM classes - nothing works. But the code is definitely running.

I have defined my own class that inherits RobotClass. I suspect there is some undocumented magic. This is quite frustrating. I'm an expert with VxWorks and an experienced FIRSTer. I knew C++ very well many moons ago but I must be missing something or it is not documented.

I'll post the code later tonight, maybe someone will see something I did wrong.
Reply With Quote
  #6   Spotlight this post!  
Unread 27-01-2009, 21:43
heydowns's Avatar
heydowns heydowns is offline
Registered User
AKA: Jeff Downs
FRC #1511 (Rolling Thunder)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Ra-Cha-Cha
Posts: 142
heydowns has a reputation beyond reputeheydowns has a reputation beyond reputeheydowns has a reputation beyond reputeheydowns has a reputation beyond reputeheydowns has a reputation beyond reputeheydowns has a reputation beyond reputeheydowns has a reputation beyond reputeheydowns has a reputation beyond reputeheydowns has a reputation beyond reputeheydowns has a reputation beyond reputeheydowns has a reputation beyond repute
Re: Victor::Set not working

Quote:
Originally Posted by Alan Anderson View Post
A blinking Victor does not point to a problem with your code. It says there is no PWM signal being received by it at all. This could be due to a number of things that are not programming issues.
While this was certainly true in past years, it is no longer the case. If you do not initialize one of the PWM-derived classes on the specific PWM port, the cRIO-based system will not generate PWM signals and the speed controller will blink.

So... it could still be a problem with the code.
Reply With Quote
  #7   Spotlight this post!  
Unread 28-01-2009, 00:39
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Victor::Set not working

Attached are my new robot class source and header files. I was having this problem in another piece of code where I wanted to use a Victor. But to check what was going on I added a call to RobotDrive in the robot class. It does not work either.

My plan was to create a simple messaging system so that the students could code tasks to control each part of the robot seperately w/o too moch interdependence. But for the life of me, I cannot see why this code does not work but SimpleRobot and IterativeRobot do work. The calls to RobotDrive in this code do nothing but SImpleRobot works fine on my setup.

And yes I know this code is not complete ;o) - neither is the robot itself - we are running an old robot with the cRIO cobbed into it.

TIA

Last edited by wireties : 05-03-2012 at 12:16.
Reply With Quote
  #8   Spotlight this post!  
Unread 28-01-2009, 04:53
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Victor::Set not working

I might not be handling the watchdog in my derived robot class correctly. A classic watchdog would reset the computer but the manual says the wpi watchdog just disables outputs. And it looks to be engaged by default.

I'll test it later today.


... it was the watchdog (it is on by default!!)

Last edited by wireties : 28-01-2009 at 17:18.
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 not set team number on DS TekClaz FRC Control System 2 23-12-2008 14:25
p2 not working? Lone_Wolf92c Programming 5 22-02-2008 08:49
IR Board Not Working (But NOT Fried) itsme Electrical 2 18-02-2008 06:11
Issues with non working victor constant orange led dani190 Control System 10 21-12-2007 22:32
Victor 884's not behaving the same as Victor 883's programmer1 Programming 13 10-03-2004 21:51


All times are GMT -5. The time now is 14:34.

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