Go to Post I wanted to make an epoxy/carbon fiber/fiberglass arm for our 'bot, but I was outvoted by conservative teenagers. Oh well... - Rick TYler [more]
Home
Go Back   Chief Delphi > Technical > Electrical
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 23-08-2016, 01:08
asid61's Avatar
asid61 asid61 is online now
Registered User
AKA: Anand Rajamani
FRC #0115 (MVRT)
Team Role: Mechanical
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Cupertino, CA
Posts: 2,216
asid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond repute
CAN to PWM converter?

After reading the recent thread on motor controller selection, I realized that if a poor-ish team wanted to use CAN they would have to drop $40 more than a SPARK to buy a Talon SRX. Does anybody know how one could have a separate PCB that would act as a CAN device and relay commands to a Spark or Victor SP as PWM? I anybody could help me with it/answer case-by-case questions (like how CAN commands would be set up, how to set up a particular chip) I would be very grateful.
__________________
<Now accepting CAD requests and commissions>

Reply With Quote
  #2   Spotlight this post!  
Unread 23-08-2016, 02:14
nickbrickmaster's Avatar
nickbrickmaster nickbrickmaster is offline
Not Allowed Near Power Tools
AKA: Nick Schatz
FRC #3184 (Blaze Robotics)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Eagan MN
Posts: 151
nickbrickmaster is an unknown quantity at this point
Re: CAN to PWM converter?

IIRC, the CAN protocol used for FRC is pretty heavily modified and kept under wraps to prevent tampering.

If you do somehow figure out the protocol, you would need to use a microprocessor to a. spoof a talon SRX and b. translate the commands into PWM values.

I can't really help you with anything, sorry. If you wanted to try to reverse-engineer the protocol, I would start with the firmware files, or maybe see if it's on robotpy's github.
__________________
I have approximate knowledge of many things.

FRC 3184: 2014-, FTC 10648: 2015-
Reply With Quote
  #3   Spotlight this post!  
Unread 23-08-2016, 08:51
FrankJ's Avatar
FrankJ FrankJ is offline
Robot Mentor
FRC #2974 (WALT)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2009
Location: Marietta GA
Posts: 1,901
FrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond repute
Re: CAN to PWM converter?

Current FRC rules would prohibit that anyway. R68 in 2016 rules. The usual caveat about future rules, but I don't see this changing. The device would be more than a simple convertor. It would have to read & respond to Canbus commands and the make a PWM output. Would still would not get the advantages of the additional modes in the native Canbus motor controler By the time you made that, you would have covered the gap to the Talon.

If you just want Canbus, a cheaper solution might be to find used Jaguars. They have a somewhat undeserved bad reputation.
__________________
If you don't know what you should hook up then you should read a data sheet

Last edited by FrankJ : 23-08-2016 at 09:46.
Reply With Quote
  #4   Spotlight this post!  
Unread 23-08-2016, 09:15
Chris is me's Avatar
Chris is me Chris is me is online now
no bag, vex only, final destination
AKA: Pinecone
FRC #0228 (GUS Robotics); FRC #2170 (Titanium Tomahawks)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Glastonbury, CT
Posts: 7,621
Chris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond repute
Send a message via AIM to Chris is me
Re: CAN to PWM converter?

I don't understand why someone would want to do this. Can you elaborate on the advantage?
__________________
Mentor / Drive Coach: 228 (2016-?)
...2016 Waterbury SFs (with 3314, 3719), RIDE #2 Seed / Winners (with 1058, 6153), Carver QFs (with 503, 359, 4607)
Mentor / Consultant Person: 2170 (2017-?)
---
College Mentor: 2791 (2010-2015)
...2015 TVR Motorola Quality, FLR GM Industrial Design
...2014 FLR Motorola Quality / SFs (with 341, 4930)
...2013 BAE Motorola Quality, WPI Regional #1 Seed / Delphi Excellence in Engineering / Finalists (with 20, 3182)
...2012 BAE Imagery / Finalists (with 1519, 885), CT Xerox Creativity / SFs (with 2168, 118)
Student: 1714 (2009) - 2009 Minnesota 10,000 Lakes Regional Winners (with 2826, 2470)
2791 Build Season Photo Gallery - Look here for mechanism photos My Robotics Blog (Updated April 11 2014)
Reply With Quote
  #5   Spotlight this post!  
Unread 23-08-2016, 09:18
ASD20's Avatar
ASD20 ASD20 is offline
Registered User
AKA: Andrew
FRC #4761 (The Robockets)
Team Role: College Student
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Reading, MA
Posts: 271
ASD20 has much to be proud ofASD20 has much to be proud ofASD20 has much to be proud ofASD20 has much to be proud ofASD20 has much to be proud ofASD20 has much to be proud ofASD20 has much to be proud ofASD20 has much to be proud ofASD20 has much to be proud of
Re: CAN to PWM converter?

Quote:
Originally Posted by Chris is me View Post
I don't understand why someone would want to do this. Can you elaborate on the advantage?
I'm guessing the main one is that a poorer team would not have to buy all new motor controllers if they wanted to connect everything with CAN
__________________

Reply With Quote
  #6   Spotlight this post!  
Unread 23-08-2016, 09:35
Chris is me's Avatar
Chris is me Chris is me is online now
no bag, vex only, final destination
AKA: Pinecone
FRC #0228 (GUS Robotics); FRC #2170 (Titanium Tomahawks)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Glastonbury, CT
Posts: 7,621
Chris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond repute
Send a message via AIM to Chris is me
Re: CAN to PWM converter?

Quote:
Originally Posted by ASD20 View Post
I'm guessing the main one is that a poorer team would not have to buy all new motor controllers if they wanted to connect everything with CAN
I mean, what is the advantage of using CAN on a motor controller that does not support it? You don't get any of the cool CAN-only features of the Talon that way. I'm not the most electrical / software guy so I think I'm missing something here.
__________________
Mentor / Drive Coach: 228 (2016-?)
...2016 Waterbury SFs (with 3314, 3719), RIDE #2 Seed / Winners (with 1058, 6153), Carver QFs (with 503, 359, 4607)
Mentor / Consultant Person: 2170 (2017-?)
---
College Mentor: 2791 (2010-2015)
...2015 TVR Motorola Quality, FLR GM Industrial Design
...2014 FLR Motorola Quality / SFs (with 341, 4930)
...2013 BAE Motorola Quality, WPI Regional #1 Seed / Delphi Excellence in Engineering / Finalists (with 20, 3182)
...2012 BAE Imagery / Finalists (with 1519, 885), CT Xerox Creativity / SFs (with 2168, 118)
Student: 1714 (2009) - 2009 Minnesota 10,000 Lakes Regional Winners (with 2826, 2470)
2791 Build Season Photo Gallery - Look here for mechanism photos My Robotics Blog (Updated April 11 2014)
Reply With Quote
  #7   Spotlight this post!  
Unread 23-08-2016, 10:25
nickbrickmaster's Avatar
nickbrickmaster nickbrickmaster is offline
Not Allowed Near Power Tools
AKA: Nick Schatz
FRC #3184 (Blaze Robotics)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Eagan MN
Posts: 151
nickbrickmaster is an unknown quantity at this point
Re: CAN to PWM converter?

Quote:
Originally Posted by Chris is me View Post
I mean, what is the advantage of using CAN on a motor controller that does not support it? You don't get any of the cool CAN-only features of the Talon that way. I'm not the most electrical / software guy so I think I'm missing something here.
The advantage I see is being able to connect all your devices in sequence.
__________________
I have approximate knowledge of many things.

FRC 3184: 2014-, FTC 10648: 2015-
Reply With Quote
  #8   Spotlight this post!  
Unread 23-08-2016, 10:44
marshall's Avatar
marshall marshall is offline
My pants are louder than yours.
FRC #0900 (The Zebracorns)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2003
Location: North Carolina
Posts: 1,254
marshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond repute
Re: CAN to PWM converter?

Quote:
Originally Posted by nickbrickmaster View Post
IIRC, the CAN protocol used for FRC is pretty heavily modified and kept under wraps to prevent tampering.

If you do somehow figure out the protocol, you would need to use a microprocessor to a. spoof a talon SRX and b. translate the commands into PWM values.

I can't really help you with anything, sorry. If you wanted to try to reverse-engineer the protocol, I would start with the firmware files, or maybe see if it's on robotpy's github.
If by heavily modified and kept under wraps you mean CAN spec compliant and out in the open based on the manuals provided by CTRE then you are absolutely right!

http://www.ctr-electronics.com/Talon...e%20Manual.pdf
http://www.ctr-electronics.com/Talon...;s%20Guide.pdf
http://www.ctr-electronics.com/PCM%20User's%20Guide.pdf
http://www.ctr-electronics.com/PDP%20User's%20Guide.pdf

Being that CTRE's devices are the only CAN devices at the moment for FRC motor control (and power and pneumatic) and they offer non-FRC firmware and tons of example code, they are doing a terrible job of hiding any of this.

My smarty-pants response aside, the CAN devices available for FRC teams are pretty well documented and accessible.

Also relevant if you get into CAN jiggery pokery:

Cool device and software for making it a lot easier (CAN is integrated into the Linux Kernel these days though):
http://linklayer.github.io/cantact/

Good talk explaining how CAN works and how to use above device with software (I'm in the audience somewhere):
http://livestream.com/internetsociet...deos/130605456

EDIT: Also, the irony of FRC specific CAN being an undocumented dark art while most of the automotive industry keeps it a closely guarded secret is amusing. Seriously, watch the talk.
__________________
"La mejor salsa del mundo es la hambre" - Miguel de Cervantes
"The future is unwritten" - Joe Strummer
"Simplify, then add lightness" - Colin Chapman

Last edited by marshall : 23-08-2016 at 10:52.
Reply With Quote
  #9   Spotlight this post!  
Unread 23-08-2016, 11:26
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,715
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: CAN to PWM converter?

Code:
You must spread some Reputation around before giving it to marshall again.
Reply With Quote
  #10   Spotlight this post!  
Unread 23-08-2016, 14:31
asid61's Avatar
asid61 asid61 is online now
Registered User
AKA: Anand Rajamani
FRC #0115 (MVRT)
Team Role: Mechanical
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Cupertino, CA
Posts: 2,216
asid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond repute
Re: CAN to PWM converter?

Quote:
Originally Posted by Chris is me View Post
I mean, what is the advantage of using CAN on a motor controller that does not support it? You don't get any of the cool CAN-only features of the Talon that way. I'm not the most electrical / software guy so I think I'm missing something here.
Mostly just the ease of wiring. Plus, if you already own PWM motor controllers, if one can make a CAN-PWM converter for $2 or $3, it's not a bad investment to purchase them instead of SRXs. Personally, if I wanted to do CAN control the next year, I would rather purchase a few converters before jumping on SRXs; SRXs could be used for the motion profiling, and the converters for less critical applications.

That being said, if I could get a converter working, then it's possible to increase the size of the microcontroller and add support for PID or something, although at that point we're getting into SRX territory anyway. Kind of unfortunate that the rules disallow it, although the rule makes sense.
__________________
<Now accepting CAD requests and commissions>

Reply With Quote
  #11   Spotlight this post!  
Unread 23-08-2016, 14:31
nickbrickmaster's Avatar
nickbrickmaster nickbrickmaster is offline
Not Allowed Near Power Tools
AKA: Nick Schatz
FRC #3184 (Blaze Robotics)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Eagan MN
Posts: 151
nickbrickmaster is an unknown quantity at this point
Re: CAN to PWM converter?

Quote:
Originally Posted by marshall View Post
<snip>
My bad, sorry :|

Thanks for the info. Must have been the late night that caused me to miss those sections.
__________________
I have approximate knowledge of many things.

FRC 3184: 2014-, FTC 10648: 2015-

Last edited by nickbrickmaster : 23-08-2016 at 14:37.
Reply With Quote
  #12   Spotlight this post!  
Unread 23-08-2016, 14:37
AdamHeard's Avatar
AdamHeard AdamHeard is offline
Lead Mentor
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Atascadero
Posts: 5,497
AdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond repute
Send a message via AIM to AdamHeard
Re: CAN to PWM converter?

Quote:
Originally Posted by asid61 View Post
Mostly just the ease of wiring. Plus, if you already own PWM motor controllers, if one can make a CAN-PWM converter for $2 or $3, it's not a bad investment to purchase them instead of SRXs. Personally, if I wanted to do CAN control the next year, I would rather purchase a few converters before jumping on SRXs; SRXs could be used for the motion profiling, and the converters for less critical applications.

That being said, if I could get a converter working, then it's possible to increase the size of the microcontroller and add support for PID or something, although at that point we're getting into SRX territory anyway. Kind of unfortunate that the rules disallow it, although the rule makes sense.
if it were a COTS converter for FRC it would likely be in the $20-30 range (if not more).

You also give up most of the usefulness of CAN while doubling your number of control system connections.
Reply With Quote
  #13   Spotlight this post!  
Unread 23-08-2016, 14:52
Chris is me's Avatar
Chris is me Chris is me is online now
no bag, vex only, final destination
AKA: Pinecone
FRC #0228 (GUS Robotics); FRC #2170 (Titanium Tomahawks)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Glastonbury, CT
Posts: 7,621
Chris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond repute
Send a message via AIM to Chris is me
Re: CAN to PWM converter?

Quote:
Originally Posted by asid61 View Post
Mostly just the ease of wiring. Plus, if you already own PWM motor controllers, if one can make a CAN-PWM converter for $2 or $3, it's not a bad investment to purchase them instead of SRXs..
I don't think people actually invest in the SRXs simply because they prefer the wiring layout of a CAN system. If you're using SRXs and CAN, it's to take advantage of the features that require the CAN bus (e.g. PID). These features don't become a thing on other speed controllers just by converting PWM to CAN. It's not a good idea.
__________________
Mentor / Drive Coach: 228 (2016-?)
...2016 Waterbury SFs (with 3314, 3719), RIDE #2 Seed / Winners (with 1058, 6153), Carver QFs (with 503, 359, 4607)
Mentor / Consultant Person: 2170 (2017-?)
---
College Mentor: 2791 (2010-2015)
...2015 TVR Motorola Quality, FLR GM Industrial Design
...2014 FLR Motorola Quality / SFs (with 341, 4930)
...2013 BAE Motorola Quality, WPI Regional #1 Seed / Delphi Excellence in Engineering / Finalists (with 20, 3182)
...2012 BAE Imagery / Finalists (with 1519, 885), CT Xerox Creativity / SFs (with 2168, 118)
Student: 1714 (2009) - 2009 Minnesota 10,000 Lakes Regional Winners (with 2826, 2470)
2791 Build Season Photo Gallery - Look here for mechanism photos My Robotics Blog (Updated April 11 2014)
Reply With Quote
  #14   Spotlight this post!  
Unread 23-08-2016, 14:53
MichaelBick MichaelBick is offline
Registered User
FRC #1836 (MilkenKnights)
Team Role: Alumni
 
Join Date: Oct 2011
Rookie Year: 2010
Location: Los Angeles
Posts: 733
MichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant future
Re: CAN to PWM converter?

Quote:
Originally Posted by asid61 View Post
Mostly just the ease of wiring
I'm going to agree with Adam here and add on. One of the bigger negatives of CAN is that if your first connection in the daisy chain fails, all of your motor controllers go down. Although CAN seems like the easier method of wiring motor controllers, it has its fair share of issues.
__________________
Team 1836 - The Milken Knights
2013 LA Regional Champions with 1717 and 973
2012 LA Regional Finalists with 294 and 973
To follow Team 1836 on Facebook, go to http://www.facebook.com/MilkenKnights
To go to our website, go to http://milkenknights.com/index.html
Reply With Quote
  #15   Spotlight this post!  
Unread 23-08-2016, 14:57
asid61's Avatar
asid61 asid61 is online now
Registered User
AKA: Anand Rajamani
FRC #0115 (MVRT)
Team Role: Mechanical
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Cupertino, CA
Posts: 2,216
asid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond repute
Re: CAN to PWM converter?

Quote:
Originally Posted by AdamHeard View Post
if it were a COTS converter for FRC it would likely be in the $20-30 range (if not more).

You also give up most of the usefulness of CAN while doubling your number of control system connections.
Forgive me, but I don't know enough about CAN to see where $20 to $30 came from. I was looking up general-purpose CAN controllers and microcontrollers and found options in the $1-3 range, and PCBs should only cost $1-2 tops. What would drive up the cost?

Quote:
Originally Posted by Chris is me View Post
I don't think people actually invest in the SRXs simply because they prefer the wiring layout of a CAN system. If you're using SRXs and CAN, it's to take advantage of the features that require the CAN bus (e.g. PID). These features don't become a thing on other speed controllers just by converting PWM to CAN. It's not a good idea.
That's pretty fair. But if you could do it for cheap or wanted to try out CAN in general, a cheap converter would be useful. Plus, it would be easy to go from converter to SRX without changing much code.
__________________
<Now accepting CAD requests and commissions>

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 00:33.

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