|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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.
|
|
#2
|
||||
|
||||
|
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. |
|
#3
|
||||
|
||||
|
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. Last edited by FrankJ : 23-08-2016 at 09:46. |
|
#4
|
||||
|
||||
|
Re: CAN to PWM converter?
I don't understand why someone would want to do this. Can you elaborate on the advantage?
|
|
#5
|
||||
|
||||
|
Re: CAN to PWM converter?
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
|
|
#6
|
||||
|
||||
|
Re: CAN to PWM converter?
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.
|
|
#7
|
||||
|
||||
|
Re: CAN to PWM converter?
The advantage I see is being able to connect all your devices in sequence.
|
|
#8
|
||||
|
||||
|
Re: CAN to PWM converter?
Quote:
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. Last edited by marshall : 23-08-2016 at 10:52. |
|
#9
|
|||||
|
|||||
|
Re: CAN to PWM converter?
Code:
You must spread some Reputation around before giving it to marshall again. |
|
#10
|
||||
|
||||
|
Re: CAN to PWM converter?
Quote:
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. |
|
#11
|
||||
|
||||
|
Re: CAN to PWM converter?
My bad, sorry :|
Thanks for the info. Must have been the late night that caused me to miss those sections. Last edited by nickbrickmaster : 23-08-2016 at 14:37. |
|
#12
|
|||||
|
|||||
|
Re: CAN to PWM converter?
Quote:
You also give up most of the usefulness of CAN while doubling your number of control system connections. |
|
#13
|
||||
|
||||
|
Re: CAN to PWM converter?
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.
|
|
#14
|
||||
|
||||
|
Re: CAN to PWM converter?
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.
|
|
#15
|
||||
|
||||
|
Re: CAN to PWM converter?
Quote:
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|