We are using a Talon SRX to drive a VEX BAG Motor. The application is a spindle motor for a small CNC device driven by an Arduino Mega2560 and a TinyG. The Talon SRX is connected to the Arduino via one of its GPIO lines that delivers the PWM signal. The Talon is connected directly to the BAG motor.
We are driving the Talon via the PWM interface which works fine. However, when we drive the motor at 10000 RPM we are seeing noise on the Talon input that is approx. 15 kHz, that occasionally stalls the motor.
The noise is 6 ns pulses that occur every 64 us. They are scattered throughout the PWM signal while the motor is running but occasionally “clump together” enough to stall the motor. It takes a string of a dozen or more to cause a stall. Fewer don’t seem to have an effect. (I have captures from a Saleae Logic Analyzer if anyone is interested.)
If I disconnect the motor from the Talon and run the PWM signal, it is clean, no noise. We connected a Victor SP in place of the Talon and there was also no noise. So the combination of the Talon and BAG motor results in the disruptive noise.
We would use the Victor except we need to run the motors at 24V and the Victor will only go up to 16V.
I can inject noise into the Talon PWM signal by sending a train of 20-30 1us pulses every 64us and get the same stall effect. So I am pretty sure that these 15kHz pulses are the cause of our stalls.
Does anyone know where are they coming from? Are they related to the Talon’s 15kHz chop rate? If so, how do I get rid of them? If I can’t, is there an alternative to the Talon and Victor that will run at 24V with the same PWM interface?
We could switch to CAN but we are at the end of the project and do not want to make the changes at this time that would be needed to switch.
Have you tried lowering the PWM frequency coming from the Arduino to something lower? 15kHz is pretty overkill.
Unrelated: why Bag motor over 775pro or a beefier DC motor?
Are the Talon and Arduino powered by the same power supply? If they are, and adding a resistor across the Talon’s inputs doesn’t work, you may need to isolate the Arduino power supply and use an optocoupler to communicate. Also, you may want to look at shortening your signal wires and running them far away from motor and power wires. Inductive loads like motors cause noise - that’s a fact of life - the trick is minimizing it as much as possible.
Sounds like you do have some noise issues in the analog domain. Be cautious interpreting the results of a logic analyzer in this case - the pulses on the trace will likely not be interpreted the same way within the SRX (depends on the PWM input hardware’s analog signal properties). If you have a scope handy, see if you can capture the corresponding problematic pulse pattern to see what the noise is actually shaped like… Part of me is curious if there’s beat frequency between the PWM, SRX Output, and motor speed frequencies… haven’t tried the math though.
Anyway, to reduce the noise, some strategically placed filter caps might help - possibly across the motor input ports? I’ve seen it done on cheaper electronics, could help to smooth out the noise from the communicator in the motor. If the noise is of a much higher frequency than your PWM signal, filtering the output of the arduino may be possible as well. A stronger pull-down on the arduino’s PWM output might also help (the idea would be to keep the “off” digital voltage closer to zero to prevent your phantom pulses, but I’m not sure how well this would work in practice).
Most likely commutation noise from the motor, maybe interacting with the chop frequency of the Talon. What you need is some filtering. You don’t have to abide FRC rules, so here’s Pololu’s non-FRC legal advice.
TL;DR: Also add a 1k ohm resistor from the signal wire to the ground/common wire on your PWM cable.
Also noise like this is often inductively coupled onto the PWM wire. Which is to say the motor leads and signal wire act like a transformer. Twisting the motor leads, power leads, AND the PWM leads (signal and ground/common here) reduces the loop size and makes a much less efficient transformer between the two, which can help.
Also, also, you can add a shunt resistor at either end of the Talon’s PWM wire. Inductively coupled noise shows up as an induced current. If that current is getting pushed into a high resistance input, small current = large voltage change. A shunt resistor reduces the resistance of the signal circuit. Effectively, this pulls more current from the Arduino, while the coupled current stays the same, reducing the magnitude of the coupled current’s effect. The Arduino can easily source 5mA from an output, so a 1k ohm resistor should be safe. 500 ohms would also be safe, though it’d start affecting the voltage level of the output.
EDIT:Also, I knew I’d be late to this party, I’m assuming the extra details are helpful and/or interesting.
Yes. I understand using the Logic Analyzer vs Scope. The Saleae gives me the ability to capture long runs (5 minutes) of data that I can’t with the scope. Unfortunately it interprets the data as purely digital. I am confident of the 15kHz frequency nature given how often it occurs in the data. We did put a scope on it but the stalls are infrequent enough to be impossible to catch. In general the signal looks ok. You can see the occasional spikes but nothing you wouldn’t expect to see with the motors running. This morning I ran for a couple of hours with no stalls. Then later, I got several stalls in the course of 10-15 minutes.
The input impedance of the various FRC Motor Controllers varies dramatically.
For example, the DMC60 input draws only 140 micro amps when connected through a 330 ohm series resistor to a regulated 5VDC supply. The Vic888 draws almost 10 milli amps. There are pros and cons to high and low impedance; depends on what you’re doing.
I hope to run some tests later this month to evaluate the compatibility of several different servo testers with the FRC-legal Motor Controllers.
That’s fascinating. The Vic888 is the result of years of FRC-centric iteration, so I think the 10mA draw is very intentional there for just this reason. The DMC60 looks like a Victor SR clone, I wonder if the SR and SRX have similar impedances? The SRX should have a pretty high impedance to operate well on the CAN bus, so maybe that translates into high impedance in PWM mode as well?
If you happen to have a nice digital scope, you might be able to trigger based on output voltage to the motor (trigger when it’s at zero for more than a certain period of time, and just save the last couple microseconds of data). It’s a lot of if’s, though…
Ozrien, what minimum current are you talking about?
Ether and I are talking about the current draw on the signal line, which depends on the impedance of the digital input circuitry. A low current draw here would mean high impedance and possibly more sensitivity to noise from induced currents.
You are correct, an oscilloscope is a much better tool for looking at the noise.
We are getting a new PCB in today and when we change that out it will be a good time to inspect all of the wiring and especially the grounding as you suggest. To be honest it is a bit of a rat’s nest all laid out on a workbench right now.
the specs for the Roborio say that their PWM is 6 volts which, I’m assuming, is what the Talon expects. The Arduino GPIO is at 5 volts (assuming you’re using the Uno). Has that caused you any issues?