Go to Post I'm working, don't consume my oxygen. - DonRotolo [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 19-01-2009, 07:08
kyungjin kyungjin is offline
Software Specialist
AKA: Daniel
VRC #0646
Team Role: Programmer
 
Join Date: Aug 2008
Rookie Year: 2009
Location: Honolulu, Hawaii
Posts: 65
kyungjin is an unknown quantity at this point
Send a message via AIM to kyungjin Send a message via MSN to kyungjin
Running the Motors Backward in WindRiver & cRIO Freezes

In order to fine-tune and test things, I was playing around with some of the motor control code and I kinda ran into this...

Code:
Jaguar1->Set(1.0);
This set of code worked and drove the motors forward at 100% power.

Code:
Jaguar1->Set(-1.0);
This set of code didn't work and whenever this function was called upon (I used buttons to control this), it would just ignore the code.


Also, for some reason, the cRIO sometimes locked up and froze, running the last set of processed instructions and refusing to run anymore. For example, I might be driving the bot's left wheels when the cRIO freezes. In that case, the cRIO refuses to take any other instructions and keeps powering the left wheels at the same speed until either the power is pulled or the Disable/Enable switch is toggled. I've reflashed this unit many times and tried tweaking the code, but nothing really worked. Anyone have the same problems or is this some kind of hardware defect?
Reply With Quote
  #2   Spotlight this post!  
Unread 19-01-2009, 07:34
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Re: Running the Motors Backward in WindRiver & cRIO Freezes

Here are my ideas:
1) You've got a jumper set on a jaguar that prevents it from going backwards. Try looking at the jumpers on the right side of the jaguar (marked F and R). They should both have jumpers on them. If it still doesn't work, try replacing the Jaguar. We had the same problem this weekend when a motor would only run in reverse.
2) Your battery is low and causing your cRIO to act funny.
Reply With Quote
  #3   Spotlight this post!  
Unread 19-01-2009, 07:55
Brian C's Avatar
Brian C Brian C is offline
Doer of Whatever
AKA: Brian Cholerton
FRC #1468 (J-Birds)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1999
Location: Islip Terrace Long Island-NY
Posts: 325
Brian C has a brilliant futureBrian C has a brilliant futureBrian C has a brilliant futureBrian C has a brilliant futureBrian C has a brilliant futureBrian C has a brilliant futureBrian C has a brilliant futureBrian C has a brilliant futureBrian C has a brilliant futureBrian C has a brilliant futureBrian C has a brilliant future
Re: Running the Motors Backward in WindRiver & cRIO Freezes

While I admit to being more familiar with Victors than Jaguars the controller may need to be calibrated. This is the procedure directly from Luminary Micro's information:

CALIBRATION
PROCEDURE
To calibrate the servo-style PWM input for a
specific range, connect a PWM source, then:
1. Hold down the USER switch with a
straightened paperclip.
2. After 5 seconds, the LED flashes Red and
Green to indicate Calibration mode.
3. Instruct the controller to send a full-forward
signal.
4. Instruct the controller to send a full-reverse
signal.
5. Instruct the controller to return to a neutral
signal.
6. The LED will flash Green and Yellow to
indicate a successful calibration.
7. Release the USER switch.
The MDL-BDC samples these signals and centers
the speed range and neutral position between
these limits. A calibration failure will be signaled if
an out-of-range signal is detected.

Or if you're looking to have a motor go in an opposite direction from the joystick input as in tank drive where one motor needs to be in reverse when driving in one direction. You can simply reverse the wires on the M+ and M- terminals from the motor.
__________________
2017 Season; Game Announcer at

SBPLI Long Island Regional
Reply With Quote
  #4   Spotlight this post!  
Unread 19-01-2009, 08:24
kyungjin kyungjin is offline
Software Specialist
AKA: Daniel
VRC #0646
Team Role: Programmer
 
Join Date: Aug 2008
Rookie Year: 2009
Location: Honolulu, Hawaii
Posts: 65
kyungjin is an unknown quantity at this point
Send a message via AIM to kyungjin Send a message via MSN to kyungjin
Re: Running the Motors Backward in WindRiver & cRIO Freezes

Hey, thanks for the quick replies.

I'll be sure to try both of the solutions when I get to school in a few hours.

For the cRIO issue though, I don't think it's the battery that's causing it to act all weird. I don't remember the battery ever dipping below 11V and this is a reoccuring issue, so I'm pretty sure that's not the case... Anyway, I will look into the battery. In the meantime, do you know of any possible case/solution where the cRIO will act the way it does?
Reply With Quote
  #5   Spotlight this post!  
Unread 20-01-2009, 00:12
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Running the Motors Backward in WindRiver & cRIO Freezes

Repeat the process tethered and see if the issue goes away. Also make sure you have the gaming adapter in tne filtered 12volts.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
Reply With Quote
  #6   Spotlight this post!  
Unread 20-01-2009, 00:44
kyungjin kyungjin is offline
Software Specialist
AKA: Daniel
VRC #0646
Team Role: Programmer
 
Join Date: Aug 2008
Rookie Year: 2009
Location: Honolulu, Hawaii
Posts: 65
kyungjin is an unknown quantity at this point
Send a message via AIM to kyungjin Send a message via MSN to kyungjin
Re: Running the Motors Backward in WindRiver & cRIO Freezes

I think everything is hooked up right and the jumpers seem to be in the right places...

Here's some other things I've noticed...

The lights on the jaguars and victors seem to flash (sometimes green other times orange) when this occurs. Also, when we connect it up to the console (we're using the SimpleTemplate project), it says something like...

FATAL ERROR: Unable to access allocated resource in Resource.cpp

... or something like that... I can't remember what it exactly says...

This seems to be a major problem plaguing us... We can't even get this thing to run reliably for more than 30 seconds...
Reply With Quote
  #7   Spotlight this post!  
Unread 20-01-2009, 07:01
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Re: Running the Motors Backward in WindRiver & cRIO Freezes

Quote:
Originally Posted by kyungjin View Post
The lights on the jaguars and victors seem to flash (sometimes green other times orange) when this occurs. Also, when we connect it up to the console (we're using the SimpleTemplate project), it says something like...
The lights on the victors jaguars mean a few things:
-Fast flashing green: PWM signal says "partial power forward"
-Fast flashing red: PWM signal says "partial power reverse"
-Solid green: PWM signal says "full speed ahead"
-Solid red: PWM signal says "full speed reverse"
-Solid orange: PWM signal says "neutral"
-Slow flashing orange: PWM signal not present (can happen when the cRIO is booting, and when the PWM signal is unplugged)
-There's on other that indicates an error, it might be fast flashing orange but I'm not sure.


We get that fatal error thing every time we boot too. We haven't investigated, but it doesn't seem to affect our robot's performance.
Reply With Quote
  #8   Spotlight this post!  
Unread 20-01-2009, 19:45
kyungjin kyungjin is offline
Software Specialist
AKA: Daniel
VRC #0646
Team Role: Programmer
 
Join Date: Aug 2008
Rookie Year: 2009
Location: Honolulu, Hawaii
Posts: 65
kyungjin is an unknown quantity at this point
Send a message via AIM to kyungjin Send a message via MSN to kyungjin
Re: Running the Motors Backward in WindRiver & cRIO Freezes

For us, the Fatal Error constantly repeats until we disconnect the system... I'm not sure how "normal" this thing actually is...
Reply With Quote
  #9   Spotlight this post!  
Unread 21-01-2009, 00:10
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: Running the Motors Backward in WindRiver & cRIO Freezes

Quote:
FATAL ERROR: Unable to access allocated resource in Resource.cpp
I think that's something you should ask National Instruments about. I'm not up to speed on how the guts of the C++ libraries work, but it sounds like it might be reporting a FPGA problem.

Or you might just have a program bug that tries to connect a gyro to an unsupported analog pin...
Reply With Quote
  #10   Spotlight this post!  
Unread 21-01-2009, 09:15
kyungjin kyungjin is offline
Software Specialist
AKA: Daniel
VRC #0646
Team Role: Programmer
 
Join Date: Aug 2008
Rookie Year: 2009
Location: Honolulu, Hawaii
Posts: 65
kyungjin is an unknown quantity at this point
Send a message via AIM to kyungjin Send a message via MSN to kyungjin
Re: Running the Motors Backward in WindRiver & cRIO Freezes

Well... This seems to be happening with or without any other sensors plugged in (just the basic setup of the benchmark test with some connected motors).

This awful cRIO has been giving us nothing but problems... ugh...
Reply With Quote
  #11   Spotlight this post!  
Unread 21-01-2009, 10:34
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Running the Motors Backward in WindRiver & cRIO Freezes

If your cRIO is freezing, hook up a null-modem serial cable and use hyperterminal or another terminal program to see the diagnostics from the kernel. It will often tell you what is wrong, or at least give you info so that people can help.

If you truly think you have a problem with the cRIO, try isolating it. Reimage it to the latest image, make sure it is a fresh battery with nothing else hooked up that doesn't need to be, and run an example program. If that crashes, freezes, or misbehaves, contact NI tech support by phone.

If it doesn't, then start adding things back on somewhat slowly.

You aren't going to get this debugged without more isolation and more information.

Greg McKaskle
Reply With Quote
  #12   Spotlight this post!  
Unread 02-02-2009, 19:39
bomber7 bomber7 is offline
Humanoid
FRC #0585
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2007
Location: CA - Tehachapi
Posts: 20
bomber7 is an unknown quantity at this point
Re: Running the Motors Backward in WindRiver & cRIO Freezes

I know this thread might be a little dead, but I think I might know the solution.

If you access the 'raw' values of the joysticks you get -1 to 1 ( 0 is stop ), if you access the 'raw' values of pwms you get 1 to 254 (128 is stop)!!! so 1 WOULD run your motor full speed, while -1 would be invalid.

Try setting it to 254 (not 255) and seeing if you still get the error.

I'm pretty certain the above applies for setting raw values on the pwms, I am not sure if it is true for Jaguars.


...............
Edit: On second thought, after reviwing the relevant source files of the WPI library I find it unlikely that the above is true.

Last edited by bomber7 : 02-02-2009 at 19:51.
Reply With Quote
  #13   Spotlight this post!  
Unread 03-02-2009, 17:02
yarb65 yarb65 is offline
Coach
AKA: T Bray
FRC #3189 (Circuit Breakers)
Team Role: Coach
 
Join Date: Jan 2005
Rookie Year: 2005
Location: El Dorado, CA
Posts: 85
yarb65 has a spectacular aura aboutyarb65 has a spectacular aura about
Re: Running the Motors Backward in WindRiver & cRIO Freezes

I have the same problem and I have used both Jags and Victors. The RIO is not freezing. The motor just will not reverse when using a button. Works great when using x,y,axis.
__________________
2013 Sacramento Regional Winner (3189,701,2489))
2012 Israel Regional Winner (1662,1690,1937)
2008 Sacramento Regional Winner (1662,115,2122)
2006 Sacramento Regional Winner (1662,852,1726)
Reply With Quote
  #14   Spotlight this post!  
Unread 05-02-2009, 14:48
Analog's Avatar
Analog Analog is offline
Registered User
AKA: Bob Most
FRC #2619 (The Charge)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Midland, Michigan
Posts: 53
Analog will become famous soon enoughAnalog will become famous soon enough
Re: Running the Motors Backward in WindRiver & cRIO Freezes

Re-flash and power cycle.
Reply With Quote
  #15   Spotlight this post!  
Unread 08-02-2009, 14:17
kyungjin kyungjin is offline
Software Specialist
AKA: Daniel
VRC #0646
Team Role: Programmer
 
Join Date: Aug 2008
Rookie Year: 2009
Location: Honolulu, Hawaii
Posts: 65
kyungjin is an unknown quantity at this point
Send a message via AIM to kyungjin Send a message via MSN to kyungjin
Re: Running the Motors Backward in WindRiver & cRIO Freezes

I did in fact stumble upon finding how to run the motors in reverse.

For sake of discussion let's assume that we are trying to make a Jaguar motor called wheel in port 3 go half speed backwards...

For some reason, if we code it like this, the motors only accepted forward values, thus doing nothing when going backwards:

Code:
Jaguar Wheel = new Jaguar(3);

Wheel->Set(-0.5);
I was experimenting with the code in the WPI library and found that the correct way to set motor speeds or use any other functions for that matter was:

<Object Name>.<Function Name>(<Parameters>);

Therefore, the above example would be coded something like this:

Code:
Jaguar Wheel = new Jaguar(3);

Wheel.Set(-0.5);
... where Wheel is your object name... Set is your function name... and -0.5 is your parameters (as specified in the WPI library function for setting motor speeds).

I hope this solved the problem for you. If not, it could be a hardware issue (maybe check to see if your Jaguar or Victor has jumpers that allow forward/backward movement).

- Daniel
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
cRIO Not Running Program railerobotics NI LabVIEW 5 18-01-2009 08:48
CRIO not working with Windriver dpeterson3 C/C++ 7 07-01-2009 20:49
Can you hurdle the Trackball's backward? Sila741 Rules/Strategy 14 08-01-2008 02:30
Heck Freezes Over: Windows 2000 & NT Source Code Leaked!?!? Joe Matt Chit-Chat 9 14-02-2004 21:14
Motors Running Fwd/Rev Paul Programming 3 05-02-2004 17:17


All times are GMT -5. The time now is 02:55.

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