Low-cost Talon SRX computer?

As an off season project, I’d like to lead a build of a couple of the catapult concepts we had back around week 1 or 2 that we dropped because we didn’t have any experience with them. Ideally, these would be standalone projects, with no drive system and a low-cost controller (e.g. arduino, rather than RoboRIO). One is essentially pneumatic, so we’re ready to drive this with some relay modules. Another requires PID. I don’t see any reason that a Talon SRX internal PID shouldn’t fill the bill, but I really don’t want to commit a RoboRIO to control the SRX over CAN. As controlling the SRX is a means rather than an end (our end is more mechanical), I’m hoping we can adapt a relatively inexpensive way to control an SRX via CAN. Arduino would be the preferred tool, as we have several Leonardo clones already in hand, but learning another infrastructure if needed is certainly acceptable.

A search for CAN bus shields turned up a number of shields with DB-15 ports to interface to vehicles. While this may be adaptable to our needs, it was not clear from a high-level read of their capabilities. I also found a number of really low cost devices which seemed to want to interface to something through IR, which didn’t seem like the right answer.

Does anyone have an inexpensive (<$100, or at least < $200) way (both hardware and software) to control a Talon SRX (in encoder mode) which includes both driving at a specified speed and driving (a single encoder) to a “click count”?

Old cRIOs from neighboring teams could do it, maybe.
The Arduino has some built-in PID libraries, if you want to go really cheap, but if you do go that route you wouldn’t be using CAN and would probably need the Arduino Due for the processing power.

Have you asked Omar? He is usually very helpful.

cRIOs introduce the same issue as RoboRIOs for this purpose - I’m looking for something else.

Edit: I considered using arduino-controlled PID, but I am concerned that this would not translate into a “proven FRC-capable solution” if it were to come up in future years. I’d rather solve this with basic programming of an SRX.

No, I haven’t asked him specifically, but I did spend a few minutes browsing ctr-electronics.

The HERO is probably your best bet unless you want to be re-implementing/porting all of the software for communicating with the Talon: http://www.ctr-electronics.com/hro.html

If you’re wanting to control over CAN, be wary of the security token put in the CAN bus every 100 msec (I believe that’s still a thing). I don’t believe it’s part of the standard CAN protocol, so you may have to install the non-FRC firmware on the Talon (I assume that’s one of the differences in the firmware). Someone who knows more about it should comment if this is the case.

Not that I really want to, but is there an inexpensive C# programming environment?

Thanks for the reminder that FIRST always has a watchdog! I knew this, but hadn’t considered it in this context.

Microsoft Visual Studio is free for personal use and supports C# (amongst others):

https://www.visualstudio.com/vs-2015-product-editions

There is an arduino CAN library http://www.chiefdelphi.com/forums/showthread.php?t=145564

Your project is still shrouded in mystery, so my suggestions may not be that applicable. Here are my tinkering $.02.

  1. The cheapest stuff is what you already have.
  2. SRX are quite nice, but it is not hard to do PID on almost anything, and you’ll learn and understand it better if you can see the response plots and understand what the control terms do.
  3. A key part of engineering is transferring from a scale prototype to a full implementation. Or from one domain to another. You don’t have to meet all constraints at once, especially if this is risky, so using a laptop and building a big one with the tools you have may be the quickest way to prove it works.

Then take what you learned and grow/shrink speed it up, make it cheaper, etc.

Yes, you can skip these steps, but many times, the optimization and lack of iteration drives you off course and gets in the way of other discoveries.

By the way, CTR provides non-FRC firmware that has no tokenization for safety.

Greg McKaskle

I wasn’t intending to be mysterious. The PID controller would drive a (non-parallel) four-bar linkage similar to one I described in this post, though with a lever arm rather than a linear slide.

Is there a reason one couldn’t use these IC to service the CAN requirement:
http://www.microchip.com/design-centers/can/peripheral-products

I’d be interested into doing this. I previously had some of this working with the Parallax Propeller but my code base for it is just a mess right now.

Hey All, Some answers below…

Does anyone have an inexpensive (<$100, or at least < $200) way (both hardware and software) to control a Talon SRX (in encoder mode) which includes both driving at a specified speed and driving (a single encoder) to a “click count”?

We get this question a lot through our support email. This is one of the main reasons why we made the HERO development board.

It’s a C# based NETMF board that allows you to write/debug C# robot code (works with the free Visual Studio IDE/Debugger). This is where we add features to our CAN actuators first, test them, then port what makes sense to the FRC system.

Our C# library is open source so you can use it as a reference for porting the Talon library to whatever.

Also, if you are married to another hardware platform (familiarly, preference, whatever) you should consider looking at HERO anyway as a tool to field-upgrade/set-IDs, and to get your robot moving immediately. Then you can begin your porting effort by studying our library.

If you happen to be at Worlds this week, check out our demos at our booth. We’ll have at least one robot using HERO and Talons.

Not that I really want to, but is there an inexpensive C# programming environment?

Visual Studio Community is free, see HERO User’s Guide for installation steps.

…be wary of the security token put in the CAN bus every 100 msec (I believe that’s still a thing). …

We have FRC and nonFRC firmware. FRC firmware requires a roboRIO that safely tells us that we can enable, nonFRC does not need the roboRIO to enable.
The firmware file is on our site, use a HERO or roboRIO to field-upgrade your Talons.

A search for CAN bus shields turned up a number of shields

I’ve had a few customers do this. Typically they prove out what they want to do using HERO, then do a minimal port to Arduino/RaspPi/whatever. This is particularly helpful if you don’t have a lot of flash on your platform.

I’ve also had a few customers just send high level commands to a HERO, which in turn updates the Talons (over UART or similar). See HERO User’s Manual for serial example.

Omar, if we’re not married to the idea of using Talons (cost/ more features than we need) how well would the Hero work for general purpose robot platform controller using, say Spark ESCs or for even lower load motors Vex Controller 29s.

How difficult would it be to get Jaguars working through Hero on the CanBus? Does anybody know if the Jaguar firmware exists? We have a bunch of those sitting around. It would be great to have a test bed that connected them to a x-box controller.

I see there are 3 PWM outputs on the board. I suppose that would do about the same.

Omar, if we’re not married to the idea of using Talons…

There is a ‘P’ Gadgeteer port that is PWM-hardware capable so anything is possible, but it is not supported in software yet. The priority for HERO is to better support Talon SRX, but in future I’m sure it will branch out to other things as we add more peripheral software support (I personally can’t wait to see an IoT application).

How difficult would it be to get Jaguars working through Hero on the CanBus?

That’s a interesting question, the CAN driver API in HERO is very similar to the CAN driver API we [NI/CTRE/WPILIB/FIRST] hashed out for RIO. So I bet a smart student/mentor could port over the CANJaguar java class to C#, and just replace the RIO CAN calls with HERO CAN calls. Java would be best as it is closest to C#.

BUT you must put the nonFRC firmware into the Jags. That will require using BDC-COMM (and possible a serial connection). Or 2CAN if you have one lying around :slight_smile:

Closing out my last comment on this old thread…

PWM Speed Controller class is now available in HERO SDK Beta Installer 4.4.0.25 (.zip)
http://www.ctr-electronics.com/control-system/hro.html#product_tabs_technical_resources

IDK if It could be any help but I got can jaguars running on arduino, follow the link in my signature.

The Zebracorns recently got one of our old robots converted to using Talon SRXs and a HERO board thanks to a generous donation by CTRE. We will be posting a paper about the process as soon as we can (we’re in the middle of moving our lab right now).

Needless to say, the HERO board is an amazing tool for teams for this exact reason and it has us talking about how we can use it for more prototyping in the future.

I bought some SPARKs for this project several months ago, leaving the encoder counting to the arduino, but thanks.