Test CIM motor without RoboRIO

Is there a way to test the CIM without roboRIO? I was thinking about using a separate PWM controller, it would use the motor without programming and specific FRC motor controllers, just mechanical adjustments.

yeah, this is just to create a new mode to test, I’m not gonna use this in an official competition.

We have a switch with battery in and anderson out leads that turns a CIM on without any control other than on and off. But a PWM tester will probably work better with the controller hooked to a battery and then PWM out.

1 Like

The best way long term is to disassemble an old 12 volt drill, remove the motor, and then put connectors on the output. Then you can use it to supply variable speeds. You can find more info by searching here.

11 Likes

We use a PWM signal generator
You connect it to the PWM signal inputs on a motor controller and it allows fine control of a motor without code. This one has two PWM outputs so you can control two motor controllers with one input (they will be the same output, so if you want two different speeds, you will need to get two of these).

1 Like

We built a box that has a battery a couple of motor controllers and PWM generators with Anderson connections for the motors. You can get a PWM generators from RC hobby stores or Google.

We use PWM generators for brushless motors.

You can also get PWM shields for Arduino.

1 Like

Doesn’t the Arduino have native PWM support?

Yes. But it doesn’t natively use PWM cables, and it’s specific pins that are capable of supplying it.

as far as I can remember, my first year dealing with the current version Spark Max you can actually connect them to the CIM motor and connect the spark max to a computer or laptop for testing
this should help SPARK MAX Operating Modes - REV ION Brushless

2 Likes

Cool!
But to control a motor, I will need to connect Spark Max directly to the battery with the USB Cable, right? Because USB isn’t 12v and I don’t know if it works.

For 12V you could easily hook the spark max to the PDP run a battery from that, still a bit much but doesnt require roborio

1 Like

We were using the below generators with victor sp’s and were running into issues. It appeared we could configure the frequency and the duty cycle on the unit. After connecting it to a PDP it would only spin the motor very slowly from duty cycle values 0-5%. From 5-100% it would not power the motor. Any idea why this could be? I lnked the units we used below

DROK Frequency Generator, DC 3.3V-30V 5-30mA 1Hz-150kHz Adjustable Output PWM Pulse Duty Cycle Square Wave Function Signal Generator Module https://a.co/d/dGD7JkY

The duty cycles that speed controllers take aren’t what you’d expect. PWM Motor Controllers in Depth — FIRST Robotics Competition documentation

We have had success driving TalonSRX, VictorSPX and SparkMax all from Arduino Mega and Arduino Uno. Ground comes from the Arduino and the Signal is any of the PWM indicated pins. The 5V is unUsed as there are only two wires used in PWM mode (on TalonSRX and VictorSPX you use the CAN wires as PWM). The Motor Controllers provide their own 5V.

If you use Servo and Write microseconds rather than the usual way of analog Write you can control them. Per the TalonSRX manual.

After a PWM connector is installed, the Talon SRX will readily interface with the NI roboRIO and many other microcontrollers. The PWM signal used to control the Talon SRX must be between 1-2ms in duration with a center (neutral) pulse of 1.5ms and a period between 2.9-100ms.

If OP wants to see how cheap they can go, we bought these 3 for $8.99 and they work great with our old Talon. Each one has 3 channels and took our PWM cables.
PWM generator

2 Likes

PWM is used in two in two contexts that lead to a little confusion.

PMW used for the output of the motor controllers which changes the duty cycle of output to mimic a voltage controller.

So you adjust the duty cycle to get the desired

A PMW control signal has its roots in hobby RC servo controllers. The radio control were transited by analog transmitters and multiple PWM signals were multiplexed on one analog channel. A little too much detail. Anyway. The individual PWM signal has a variable on width that defines the command (in FRC terms 1MS=-1,(-100%), 1.5MS=0 (0%) and 2MS=1(100%). For the controller to stay enabled the signal has to be transmitted within a certain time period, not at a particular frequency.

So with a square wave generator you will have to adjust the Frequency and duty cycle to get the desired on time for the desired command. Better to get a PMW generator specifically for control. Sometimes called servo testers

2 Likes

We used to use a cheap blue PWM controller from Amazon, but the output was sensitive to noise and would cause the Spark Max to jitter. Not recommended.

I recently found a much better off-the-shelf PWM device from goBILDA called the Servo Commander.
image

https://www.servocity.com/servo-commander/

Combine it with their Voltage regulator (remove the jumper for 5V):
image

https://www.servocity.com/6a-bec-voltage-regulator-6-24v-input-5v-6v-8-4v-12v-output-xt30-connectors/

Use their Anderson Powerpole to XT30 connector cable:
https://www.servocity.com/anderson-powerpole-to-female-xt30-adaptor/

And then, send the second PWM output in the reverse direction (so on rotating shooter wheels - one motor goes one way and the other is reverse):
image

https://www.servocity.com/servo-travel-reverser/

Then you are done!
Completely off the shelf too, and nice smooth performance.
Remember, set the knob in the middle (for OFF = no rotation) when turning the power on.

Here it is being tested before mounting:

Enjoy!

3 Likes

We have 2 of these https://www.amazon.com/ICQUANZX-Controller-DC10-55V-Forward-Reverse/dp/B081YYG5MG/ref=sr_1_39_sspa?crid=3167MNRNDR4CR&keywords=12+volt+motor+speed+controller&qid=1707397364&sprefix=12+volt+motor%2Caps%2C97&sr=8-39-spons&sp_csd=d2lkZ2V0TmFtZT1zcF9tdGY&psc=1

We added an Anderson Plug to connect to a Battery and connectors for the motors

1 Like

A USB car charger can do that swap for you, or if you want to do it even less expensively, a chip like this.

1 Like

The USB will power the electronics to set up or flash the controller. You need 12V on the main power to actual run a motor.

The output to the pwm is actually 5 Volts and not 12. At least from the Rio.

Hi @Jim_Burgett,

Can you share with me the setup you’re using in order to connect the speed controller to the battery, please? What is the fuse plugged to and what is the fuse current value?

Thank you