SparkFun Forums 

Where electronics enthusiasts find answers.

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!
By satacoy
It's a bit difficult to measure, as the wires go into the motor, and I don't have great access to the other end. It would be an interesting number to see. I'm sure the thinner wires are providing more resistance, I just don't know how much, yet.

Any ideas on why having more resistance would cause things to behave more properly? That's the part I'm struggling with.
By lyndon
I assumed your motor driver allowed you to control the current sent to the motor.

My guess is that with the correct wiring your motor is consuming a huge amount of current at startup and the voltage of the batteries is drooping. If the voltage droops, then the controller can no longer drive the output FETs into full saturation, so they are acting as voltage-controlled resistors and dropping a lot of power and getting hot.

Here's an experiment you can run: start the motors up with the thin jumpers that are making it work "correctly." Once the motor is up to speed, short out those jumpers with the beefier wires. If it continues to run smoothly, you have a power supply problem. If it begins to bog down and the controller FETs get hot again, measure the voltage at the batteries. I'll bet dollars to donuts that the voltage will be well below what you expect.
By satacoy
Thanks for the guess. I'll give this a shot tonight.

I've seen this kind of issue in the past when using crappy batteries. In this case I'm using batteries that are advertised as producing 80 amps continuous, and I have two in parallel. I should be drawing well below that in this no-load situation. But, as I continue to pull my hair out, I'm willing to try anything.

I'm also planning on soldering up some beefier jumper wires to see if the gauge of the wire makes any difference. That's pretty similar to what you're suggesting, although I like the idea of eliminating the thinner wires after things are OK.
By satacoy
Oops, when I mentioned that "it's a bit difficult to measure", I was actually replying to Codlink's reply, didn't see your post sneak in there.

I ran a battery of tests tonight. I did measure the voltage at the battery as the motor spun up. They started at about 24.05 volts, and never dropped below 24.00. Thinking about it a bit, I should have used the "minimum" setting on the meter, in case the voltage was dropping very quickly, then equalizing. I'll try that next time. Again, I'm pretty confidant that the batteries can handle the ~10 amp draw all day long without sweating.

I tried the suggested experiment. I started with the thin jumpers on, let the motor spin up, then used a much beefier jumper to connect the two. There was a slight change in sound coming from the motor, but nothing significant. I tried doing the full spin up/down cycle with the beefier cables, and they too sound much better than directly connecting the motor to the controller. The thin set of cables is probably 20 gauge or smaller, the beefier cables are 12 gauge. While there's a slight difference when testing with either set, they both offer much better behavior than the direct connection method.

I busted out the hand-me-down oscilloscope, and measured the output at both the motor and each leg of the hbridge. I've been waiting years to put this thing to use.

The output at the motor looked like this. The left image is without the motor attached, the right is with the motor attached to the controller.


The measurement at the legs of the FETs were more interesting. The top two images show what the switching waveform of the leg looks like. The left picture is again without the motor, the second picture is with the motor on. The motor is definitely throwing some interference of some sort in there, but it's not too significant.

The bottom two pictures are the waveform when the leg should have been fully on or off (It looks like I took the picture on different legs, but you get the idea). The left image is with the motor attached directly to the controller. It's a very noisy signal, it should be a flat line. The right image is with the thin cables attached. It's much cleaner.


I also tried several different PWM-ing frequencies. I tried much lower (1 khz), which kept the board cool, but was very loud, up to 16khz, which was less noisy, but heated up the FETs seriously, and still didn't sound "right". I typically run at 8 khz, which is what the previous skateboard used with no issue with the same motor (but different controller).

I'll keep troubleshooting the board, it does seem like something is fundamentally wrong with it.

By satacoy
After a bit more trial and error, including replacing a few more parts of the motor controller, I tracked the problem down to interference between the signal cable and the motor brushes. Due to the physical layout of the skateboard, the signal cable snakes right near the end housing of the motor, right where the four brushes are. Moving this cable away from the motor makes things run much more smoothly.

I should have known better. Brushed motors are notoriously noisy. This motor has suppression capacitors pre-installed, so I didn't think much of it. However, it's obviously not enough in this case.

Any suggestions on how to best shield the cable? I can reroute if necessary, but that will cause it to run near the chain and pulley. I can just see it getting sucked into the drive mechanism, so I'd like to avoid that if possible. Will something as trivial as tinfoil work, or do I need to get more science-y?

By lyndon
What signal is it interfering with?
It might not be electrical noise. With the amount of current that motor is using, the magnetic fields may very well be inducing a current into the signal line; only way you're likely to improve things if that's the case is by moving the wires.

If it really is just noise, then shielded cable isn't expensive.
By satacoy
What I'm calling the "signal cable" is the cable that runs from the micro-controller to the motor controller. It's a ten wire ribbon cable, several of the wires are held either high or low, and two of them are PWM'd at 8khz. I was guessing that the motor was interfering with the PWM signal which controls the switching of the MOSFETs.

If it's a magnetic field, it'll be rough to avoid, as the cable has to run past the motor regardless of how I route it. It'll either have to go by the front or the rear of the motor.

I'll play around with placement. I'll try a shielded cable too, if I can figure out how to get the right 10 pin connector attached. My rough understanding of shielded cables is that the shield is grounded. Is that correct? Or is the shielding just a metallic material?
By lyndon
Following up on my last post this guy is pretty knowledgeable about motor controllers and current line of thinking is to ground digital shields at both ends and analog control shields at one end. His post is pretty interesting.
By satacoy
Thanks for the post, his post sure sounded in line with the situation I'm in. Someone on the OSMC forum had also suggest grounding both ends of the shielding.

I'm following a suggestion from there, and am going to try shielded CAT6 cable first. I'll snip the jacks off the end, split out the twisted pair, solder to my connectors, and see if I can attach the shielding to ground. I suspect the cable will be a bit ugly, since the 10 pin connectors I'm using (not using all lines) crimp onto a ribbon cable.
By lyndon
I hope that fixes the problem. I'm on the Practical Machinist board pretty much every day and MotionGuru has tons of industrial experience.

I was looking at your board page. How much does the motor heat up under load? The 6:1 reduction ratio is a lot less than I would have expected to see. I have some smaller motors and tires for an off road robot that I keep planning to start on "any day now" so it was interesting to see that I might not need the huge reduction to keep the motor at a happy speed.
By satacoy
I wish I could easily use a higher reduction, but to get much more you'd have to do a two stage reduction. At some point the sprocket on the wheel gets larger than the wheel itself.

The motor doesn't get hot, it will warm slightly after 15 minutes of screwing around on the skateboard. I think I can get away with all that due to the motor being overkill for the application. I don't think I've ever hit the 50% mark in terms of throttle.

There's an interesting torque/current calculator here that may help you out a bit. I honestly didn't use it when building the original skateboard, I just went with my gut that the motor was enough. The "Amps to spin wheels" describes how many amps the motor would pull if it was to break traction, not just roll.
By satacoy
I rewired the microcontroller and motor controller with a length of shielded Cat6 cable. It made all the difference in the world, things run as smooth as silk now.

Now that that mystery is behind me, I'll get back to the last few items (there always seems to be a few more to take care of). Hopefully I'll be riding this thing soon.