Off season Motor Controller Arduino stuff

As some of you know I am working on a material tester to find out what plastic can do (amongst a bunch of other projects with the team). One shortage we have is inexpensive motor controllers for non FIRST projects. The tester needs at least 3 with all the fun stuff like encoder feedback and current control besides the speed control, breaking limit switches. So initially I was going to run that off of a mega with an UNO running the LCD touch screen The touch screen thing is done.

Now due to the need for low cost motor controller that can control a CIM with an upper limit governed at 30-40 Amps I have decided to redo some of the stuff and go full ardino on it I got some Nanos lying around and ordered a bunch more

So about $4 each. Each one can control 2 H-bridge drivers so 2 motors (or 1)


again about $4 with Shipping

a .005 ohm resistor to measure current applified by an op-amp supplying the arduino with some current feed back. So add a fuse and a pc board and a couple of other small discrete components and for < $20 we will control 2 Cims (or 1 for <15) They will connect to a Controller (can be Roborio or Romi or Arduino or any other I2C capable device . Should be ok as most distances are short

Now the Hbridges need a Fan as the Heatsink mounting is not optimal especially if run for longer times at 30 Amps or More. So for now a 50mm fan seems to be sufficient for most applications but more testing will be done.

The software will accept - lets say G-Code inspired commands like for example

M2001 M0 F30

Will set the controllers M0 (or M1) max current to 30 Amps.

There will be commands

Read Current Amps.
Set Speed (0-255 with direction)
Set Speed Encolder (based on encoder with direction)
Get Encoder Position
Reset Encolder Position
Get Limit Switch status
Set Break
Define Limit Switch Behavior.
Set Acceleration (current based)
Set Acceleration (speed based)

Well thats all for now - but then a lot can be done with changing the software. As its an arduino there is the possibility to plug in via its USB port and change the firmware.

A lot of this stuff has been bench tested so now its time to start putting it together and see if we can get it to work as a complete package.

And of course everything will get mounted to something 3d Printed.

After thought. Would that be legal as custom electronics or not? Kinda roll your own Talon SRX. Not that we intend to do that atm we got sufficient Talons for the competition bot. But an interesting question (at least to me)


I recall there being a rule that custom circuits may not interfere with the path of current to motors. So, no, it wouldn’t be FRC legal, but I applaud your efforts in developing low-cost solutions for off-robot use.

1 Like

R56 restricts what modifications to the motor controller+motor wiring can be made, however it has allowances for voltage and current monitoring:

CUSTOM CIRCUITS shall not directly alter the power pathways between the ROBOT battery, PDP, motor controllers, relays (per R29-B), motors and actuators (per R27), pneumatic solenoid valves, or other elements of the ROBOT control system (items explicitly mentioned in R66). Custom high impedance voltage monitoring or low impedance current monitoring circuitry connected to the ROBOT’S electrical system is acceptable, if the effect on the ROBOT outputs is inconsequential.

R29 defines what Motor Controllers, Relays, and Solenoids we can use.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.