Go to Post Woodie once said he wanted to make our brains hurt. And I *don't* think he was talking about getting beaned by 198 grams of foam.... - Ken Patton [more]
Home
Go Back   Chief Delphi > Technical > Electrical > CAN
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 17-08-2010, 04:16
ssica_jj ssica_jj is offline
Registered User
FRC #0368 (TKM)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Hawaii
Posts: 9
ssica_jj is an unknown quantity at this point
CAN-Where to Start

Hello,
Our 2010 robot encountered some serious problem during the season.
When we are driving the robot, at some moment, one of the driving motor will overheat and the robot would get disabled for 2~3 seconds.
We are not sure what the reason is yet, but we were suspecting that the motor might be drawing too much current and it would trip off the internal switch of the Gray Jaguar that we were using.
To fix that problem, my team chose to apply CAN on 2010 robot. We are planning write a program that will use the CAN's current sensing ability to check whether the current is in the safe range and whenever it gets too high, we would like to reduce the current.
We have all the hardwares ready but we just don't know where to start in programming wise. Could anyone please help us get started with CAN?
Any help will be greatly appreciated. (LabVIEW codes, picture, link, anything)
It can also be about something else we can do with CAN. (anything relating to CAN is much appreciated!)
Thank you so much!
Reply With Quote
  #2   Spotlight this post!  
Unread 17-08-2010, 09:52
Bot190's Avatar
Bot190 Bot190 is offline
Registered User
FRC #0166 (ChopShop)
Team Role: Programmer
 
Join Date: Sep 2009
Rookie Year: 2009
Location: Merrimack NH
Posts: 105
Bot190 will become famous soon enough
Re: CAN-Where to Start

My team had the same problem this past year. I have looked into it, but it seems the only way to control the current is to use the current control mode, obvious, but it won't give you the same control over speed as you get with voltage control mode. As far as i could see there was no way to just set a limit on the amount of current the jaguars would let through, other than their own safety shutoff.
__________________

Reply With Quote
  #3   Spotlight this post!  
Unread 17-08-2010, 12:01
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: CAN-Where to Start

I'm a C++ programmer, so I can't give you too many specifics on how to do this in Labview, but once you have opened the jaguar, there is a vi called CAN Jaguar Get Status.vi which includes the current running through the jag even if you aren't in current control mode (well, the C++ equivalent works out of current control, so LV probably does too). Once you have that you can change your levels as needed.

Alternatively, you can use current control mode to set the current that should be passing through the jaguar, which could be combined with a PID loop on the cRIO to make up for the loss of speed control.
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"
Reply With Quote
  #4   Spotlight this post!  
Unread 17-08-2010, 17:04
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: CAN-Where to Start

Sorry if this seems deviant from the purpose of the thread, but have you figured out why the motor is drawing too much current? If it's a mechanical or electrical problem, it's worth figuring out that problem instead of trying to patch it with code (especially since you have the time afforded by the offseason).

Just a couple of ideas: You say it's a drive motor, so did an axle get bent? Did a bearing or some of the chain links (if using chain) collapse? Are any gears aligned and spaced properly? Did the frame get skewed or something causing binding in some other way? Is the gearbox greased? Which type of motor is it? What reduction are you using? Check out the motor curves for your motor and make sure it's running near the efficient range. If you are using multiple drive motors ganged together, are they balanced? Is the motor in good condition? E.g. If it ever "let out magic smoke", some of the wire insulation in the motor has been burned away and the power output of the motor could be decreased if the wires are shorting internally.

Current control will help to prevent your motor from burning out, without identifying what's causing the high current draws, it's quite possible you'll end up with a robot that only moves very slowly in order to meet your current requirements.

--Ryan
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote
  #5   Spotlight this post!  
Unread 23-08-2010, 02:50
ssica_jj ssica_jj is offline
Registered User
FRC #0368 (TKM)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Hawaii
Posts: 9
ssica_jj is an unknown quantity at this point
Re: CAN-Where to Start

Quote:
Originally Posted by RyanCahoon View Post
Sorry if this seems deviant from the purpose of the thread, but have you figured out why the motor is drawing too much current? If it's a mechanical or electrical problem, it's worth figuring out that problem instead of trying to patch it with code (especially since you have the time afforded by the offseason).

--Ryan
When we found out the problem, we actually switched out the Jaguars with Victors and it worked fine... That's how we found out that Jaguars were the one that was causing the robot to stop.
Thank you for the response!
Reply With Quote
  #6   Spotlight this post!  
Unread 02-10-2010, 01:05
sam_who sam_who is offline
Registered User
FRC #2190
 
Join Date: Oct 2010
Location: Mississippi
Posts: 42
sam_who is an unknown quantity at this point
Jaguars and 2CAN

I'm trying to run a black jaguar with a 2CAN. I'm having only limited success. The jag works fine when in voltage mode ... not so well in speed mode. When I command the motor to move (in speed mode), I get a tiny bit of movement from the motor then nothing. Adjusting the PID values does not appear to make a difference. The driver station software states that I am enabling the jag. The LED on the jag is on steady (not pulsing). This behavior is consistent across several black jags. None are damaged. Switching back to voltage shows me that the jag works just fine.

Using BDC-COMM (yeah, non-CAN), the jag runs in either voltage or speed mode. I do have an encoder connected. I do have a terminating resistor at the end of the CAN chain. The results are similar whether I use a single jag or several jags. I can point my browser to the 2CAN ip address and view the status of all jags on the CAN bus. I updated the firmware on my jags to version 91 (yes, I used the black jag firmware version).

I'm wondering if I'm missing a hardware connection or (most probably) it's simply a programming issue. I'm programming in C++.

I have searched through these forums but have not found an answer that works.

The code I'm using now is pretty much a clone of the code at,

http://firstforge.wpi.edu/integratio...ystem=exsy1002

If anyone out there has successfully used C++ to operate a black jag in speed mode, could you please itemize the steps necessary to accomplish the task. The more specific the reply, the better.

One last unrelated thing. I've obviously figured out how to reply to a forum post. How to you start a new thread?

Thanks

Sam
Reply With Quote
  #7   Spotlight this post!  
Unread 02-10-2010, 08:43
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
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: Jaguars and 2CAN

Quote:
Originally Posted by sam_who View Post
One last unrelated thing. I've obviously figured out how to reply to a forum post. How to you start a new thread?

See attached screenshot.
Attached Thumbnails
Click image for larger version

Name:	new thread.png
Views:	40
Size:	77.2 KB
ID:	9309  
Reply With Quote
  #8   Spotlight this post!  
Unread 02-10-2010, 13:28
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,560
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: Jaguars and 2CAN

Quote:
Originally Posted by sam_who View Post
The code I'm using now is pretty much a clone of the code at,

http://firstforge.wpi.edu/integratio...ystem=exsy1002
Are you running the Speed Control Dashboard? It's required for the demo you linked, since the dashboard is what sets the PID parameters.
Reply With Quote
  #9   Spotlight this post!  
Unread 02-10-2010, 20:18
sam_who sam_who is offline
Registered User
FRC #2190
 
Join Date: Oct 2010
Location: Mississippi
Posts: 42
sam_who is an unknown quantity at this point
Re: CAN-Where to Start

That doesn't sound familiar.

I thought you could set the PID parameters with SetPID command.

double P = 1.0;
double I = 0.0;
double D = 0.0;
jag_name.SetPID ( P, I, D );
Reply With Quote
  #10   Spotlight this post!  
Unread 02-10-2010, 20:25
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: CAN-Where to Start

You can.
But the example you linked is not as simple as the "Voltage Mode Example".
If you want the same functionality as in the voltage example (but regulating speed instead of voltage), then your best option is to modify the voltage example to use speed instead.
If you've already determined the appropriate PID values though testing with the BDC-COMM, then use those values when you set the PID.
__________________
-- Marshal Horn
Reply With Quote
  #11   Spotlight this post!  
Unread 17-08-2010, 19:50
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
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: CAN-Where to Start

Quote:
Originally Posted by Bot190 View Post
My team had the same problem this past year. I have looked into it, but it seems the only way to control the current is to use the current control mode, obvious, but it won't give you the same control over speed as you get with voltage control mode. As far as i could see there was no way to just set a limit on the amount of current the jaguars would let through, other than their own safety shutoff.
CAN Jaguar speed control with cRIO current limit:

http://www.chiefdelphi.com/media/papers/2406


~
Reply With Quote
  #12   Spotlight this post!  
Unread 17-08-2010, 20:38
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,560
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: CAN-Where to Start

If you don't have it already, you need the canJaguar software from firstforge: http://firstforge.wpi.edu/sf/projects/canjaguar. It has the necessary API, as well as examples.
Reply With Quote
  #13   Spotlight this post!  
Unread 18-08-2010, 23:18
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 328
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
Re: CAN-Where to Start

Quote:
Originally Posted by Joe Ross View Post
If you don't have it already, you need the canJaguar software from firstforge: http://firstforge.wpi.edu/sf/projects/canjaguar. It has the necessary API, as well as examples.
Make sure you take a look at my mods to support the sync mode of the Jaguars. You'll find it in the open issues section of the CANJaguar section of the site.

Good luck,

Mike
Reply With Quote
  #14   Spotlight this post!  
Unread 23-08-2010, 02:45
ssica_jj ssica_jj is offline
Registered User
FRC #0368 (TKM)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Hawaii
Posts: 9
ssica_jj is an unknown quantity at this point
Re: CAN-Where to Start

Thank you so much for all the responses!
I think we will try some things with CAN based on the responses.
Once again, thank you so much for the guidance and the tips!
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
HELP!!! Don't know where to start! comwiz7 Programming 3 29-01-2006 19:22
can anyone please tell mw where or with what can i lear programing in C techsage Programming 7 23-08-2005 00:25
Where does the line start? Morgoth General Forum 1 19-03-2003 20:44
Where to start? MacZealot General Forum 4 12-10-2002 03:27


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

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