View Full Version : PWM Testing Equipment
Jim Wilks
11-04-2013, 09:24
One item of electrical testing we seem to be at a real disadvantage with is our ability to test PWM signals.
I've been there all too often blindly swapping PWM cables and motor controllers in order to get to the bottom of a problem that all too often is not electrical.
I've seen postings here on how to build your own Arduino based PWM generator, but building DIY test equipment is not the route I'd like to go.
What I'm really looking for is a test box that:
1) can accept any PWM signal and display what it is receiving
2) generate a PWM signal based on some "hand control" input
Does anyone have any idea if such a thing exists and if so, where to get it?
1) can accept any PWM signal and display what it is receiving
2) generate a PWM signal based on some "hand control" input
Does anyone have any idea if such a thing exists and if so, where to get it?
If you have an old junker laptop (or desktop PC), you can do both.
#1 You can use a free program like Audacity as a simple oscilloscope. Connect the PWM signal to the "line in" input of the sound card. Use a simple resistor voltage divider to reduce the signal voltage to 1 volt.
#2 Read this paper (http://www.chiefdelphi.com/media/papers/2702). It shows how to generate PWM signals with an old computer.
electroken
11-04-2013, 11:54
We use the small circuit linked below to generate motor controller PWM signals. At the moment it works with Talons and Victors. The timing would need a tweak to run a Jaguar.
The potentiometer is mounted on a joystick with a spring return to center. We like that arrangement because the motor always returns to OFF when the stick is released.
The code is in PIC assembler and anyone who wants it can have it.
https://docs.google.com/file/d/0B6MH9DJZhx_9NGpEX0YweFdzdGc/edit?usp=sharing
MrForbes
11-04-2013, 12:00
maybe something like this?
http://www.hobbyking.com/hobbyking/store/__4573__GWS_Servo_Tester_MT_1_w_Manual_Auto_select .html
Joe Ross
11-04-2013, 12:01
What I'm really looking for is a test box that:
1) can accept any PWM signal and display what it is receiving
2) generate a PWM signal based on some "hand control" input
There's lots of devices that can do #2. In hobby circles, they are called servo testers. If you don't want to dedicate a computer like Ether's suggestion, you can buy or easily make one. Here's one made by a mentor of 987: http://robotlogic.com/product_servotester.html. You can also make one using 2 555 timers. Here's a schematic http://www.seattlerobotics.org/encoder/200210/servoex/ServoExcerciser.htm. You can also easily make one with a microcontroller, like an arduino.
We needed to do this to test our shooter prototype. We had one team start working on an arduino to do it, while another team started working on a 555 timer version. In the end, the Arduino team won, by several hours, but now we have two.
It would not be hard to make a microcontroller read a PWM signal and display the value. I haven't seen any off the shelf solutions that do it, however. Here's one example of doing it on an arduino. http://diydrones.com/profiles/blog/show?id=705844:BlogPost:38418
I realize you already mentioned that you've seen Arduino samples on how to make a PWM generator, but just for reference, we made one following the example at
https://sites.google.com/site/0123icdesign/arduino_jaguar
and it works splendidly. Having a test harness with something simple like a power gauge indicator for PWM lines would be really worthwhile in on the spot diagnosis, maybe we'll look into making one this year.
I realize you already mentioned that you've seen Arduino samples on how to make a PWM generator, but just for reference, we made one following the example at
https://sites.google.com/site/0123icdesign/arduino_jaguar
and it works splendidly. Having a test harness with something simple like a power gauge indicator for PWM lines would be really worthwhile in on the spot diagnosis, maybe we'll look into making one this year.
I have an Arduino based tester like what you described in prototype mode right now. When I get further I will try to post something. But I may be wasting some time on one aspect of it by including both powered and un-powered PWM outputs. I know that the digital side car has jumpers to allow you to power the center pins for driving both servo's motor controllers. Does anyone know what the common motor controllers we use do with that center pin? Can I just provide power to the center pin all the time, or will that create a problem with some motor controllers? Since the motor controllers are powered separately and that pin is not needed, why would it just not get connected inside the motor controllers?
#1 You can use a free program like Audacity as a simple oscilloscope. Connect the PWM signal to the "line in" input of the sound card. Use a simple resistor voltage divider to reduce the signal voltage to 1 volt.
The above method is admittedly clunkier than a nice compact hand-held unit that gives a digital readout or an LED pass/fail indication, but it does have one advantage: You can see the actual waveform, and you can record the waveform over a period of time.
This means that in addition to measuring the pulse width, you can also:
- see any noise or improper waveform
- see what the period is, and if it is consistent
- see if there are intermittent dropouts
Plus it just might inspire a student or two. I still remember how inspiring it was the first time I built a simple RC circuit and saw the waveform on a glowing green oval CRT screen. It made physics come alive for me.
Does anyone know what the common motor controllers we use do with that center pin? Can I just provide power to the center pin all the time, or will that create a problem with some motor controllers? Since the motor controllers are powered separately and that pin is not needed, why would it just not get connected inside the motor controllers?
It's not even connected (at least according to the Jag schematic).
Joe Ross
11-04-2013, 12:48
It's not even connected (at least according to the Jag schematic).
It's also not connected on the Victor. http://www.vexrobotics.com/vexpro/motor-controllers/217-2769.html
The red wire (center pin) on the 3-wire cable connected to the Victor is an open circuit.
There is no reason to disconnect the red wire in the cable.
The Victor does not source or draw power on the red wire.
MrForbes
11-04-2013, 13:00
Plus it just might inspire a student or two. I still remember how inspiring it was the first time I built a simple RC circuit and saw the waveform on a glowing green oval CRT screen. It made physics come alive for me.
My brother manning the scope, me on the probe.....circa 1974 (I might have us confused, we look alike). We built the scope, using surplus parts, 4 tubes plus the CRT. Non-linear (and dangerous) as heck, but it made wavy green lines!
My brother manning the scope, me on the probe.....circa 1974 (I might have us confused, we look alike).
Love that picture! The hair looks about right for 1974. How did you dig it up so fast? Do you keep it in your wallet :-)
It's not even connected (at least according to the Jag schematic).
Great. That makes it easier to use the standard PWM servo outputs as found on an Arduino development board for the requested capability. The tester I have been working on uses an Arduino Uno for both PWM signal generation and monitoring, along with a few other functions. But I needed to do a lot of extra work to build an interface board for it. If there is no need to have the power pin disconnected, it opens up the possibility of using a development version of the board (with and LCD shield) for the tester. This reduces the amount of custom wiring needed to get to a useful configuration. You would still need to wire a power switch, a few buttons, and one or two potentiometers, but I think it would be a relatively easy tester for most teams to build. As I said, I have a prototype version working, and I will try to provide more information and code after I test it and clean it up a bit more.
Plus it just might inspire a student or two. I still remember how inspiring it was the first time I built a simple RC circuit and saw the waveform on a glowing green oval CRT screen. It made physics come alive for me.
I had a "pong" paddle on my green phosphors. Never got a full game going though. Shifted over to turning a B&W Sony portable TV into a TV Typewriter. I think that beast may still be in the cellar somewhere, much to my wife's justifiable chagrin.
ablatner
12-04-2013, 02:38
For what do you need to test PWM signals? I have never needed to do that as part of any troubleshooting. Usually, PWM problems can be diagnosed otherways: through the dashboard on the driver station, the lights on the motor controllers, etc.
JamesTerm
12-04-2013, 11:22
If you have an old junker laptop (or desktop PC), you can do both.
#1 You can use a free program like Audacity as a simple oscilloscope. Connect the PWM signal to the "line in" input of the sound card. Use a simple resistor voltage divider to reduce the signal voltage to 1 volt.
#2 Read this paper (http://www.chiefdelphi.com/media/papers/2702). It shows how to generate PWM signals with an old computer.
This is great... but old computers are hard to find that still work properly... It would be nice to rig up a newer interface in lieu of the RS-232 (as much as I loved that). Perhaps Ethernet port or USB (e.g. FTDI driver)... that would make it possible to work for the classmate PC. The classmate is small and should have a powerful enough processor to be quite useful. I'll bet there are teams out there that have classmate PC's. ;)
but old computers are hard to find...
If you put the word out that you're interested, they'll come out of the woodwork.
...that still work properly.
Every junker PC that's been given to me (well over a dozen so far) has had no trouble being used for test equipment like this.
It would be nice to rig up a newer interface in lieu of the RS-232 (as much as I loved that). Perhaps Ethernet port or USB (e.g. FTDI driver)... that would make it possible to work for the classmate PC.
RS232 is easy to work with because it has control pins (outputs) that are independent of the serial data lines, and which are easily turned on or off with one register write (2 machine code instructions).
I've not studied the USB or Ethernet* port. Find me a technical document which has detailed instructions how to toggle control pins at the bare-metal level on those and I'll look at it.
*Decades ago, I wrote a letter the editor of Digital News magazine correcting an error in an article they published about the Ethernet collision avoidance/detection/recovery protocol. I got a phone call from the editor asking me if I was involved in any way in the development of the protocol. Unlike a certain politician whom I will not name here, I said no. They published my letter, but appended to it a note that I was not the inventor of the Ethernet.
MrForbes
12-04-2013, 12:04
Every junker PC that's been given to me (well over a dozen so far) has had no trouble being used for test equipment like this.
The dozens I've had mostly all worked when I got them, but time takes it's toll....I recently got rid of about three or four dozen, and at least half of them were dead, usually having issues with disk drives. I'm down to fewer than 50 computers now.
Sadly, this old stuff is going away. It was so nice to be able to do so much with so little "investment".
usually having issues with disk drives.
I've got a couple like that.
If they've got a USB port (and BIOS boot support for it), they don't need a disk drive to run FreeDOS, or even Linux :-)
MrForbes
12-04-2013, 12:22
Most of mine didn't have USB....pre-'96
Most of mine didn't have USB....pre-'96
Yeah, I've got a few of those too, with bad hard drives.
I use a 1.44MB 3.5" diskette, with bootable FreeDOS.
FreeDOS fits on there with space to spare for TP7 and apps. And you can use the memory for a RAMdisk or cache.
MrForbes
12-04-2013, 14:19
The 360k 5.25" floppy drives are dying fast too....
The 360k 5.25" floppy drives are dying fast too....
I've got only one good one left, and a box with 500 old disks :-(
5.25" disks must hold a lot of data. I bet with 2 of them you wouldn't even need a hard drive. :D
If you put the word out that you're interested, they'll come out of the woodwork.
Every junker PC that's been given to me (well over a dozen so far) has had no trouble being used for test equipment like this.
I'll second this. When I was still a teacher a few years ago, I was given a couple Pentium 2s that were "broken". I figured it would be fun for kids to open up and see whats going on. Word got out and I ended up with 6-7 P2/3s just from around the building. I did nothing to these other than load ROBOlab (the RCX LEGO software) and arduino onto whatever windows they had on them. They worked great up until an administrator threw them away. Now I'm extra mad after learning of this great additional use for them. However, I'll just be putting out the word that we're looking for donations again, and I'm confident we will have no problems.
...I was not the inventor of the Ethernet.
Hopefully people think I'm sitting here working hard and the random lol is just because I'm a bit off...
Also, this is the first time I've wondered about the etymology of ethernet???
JamesTerm
12-04-2013, 16:17
I've not studied the USB or Ethernet* port. Find me a technical document which has detailed instructions how to toggle control pins at the bare-metal level on those and I'll look at it.
Hmmmm... perhaps instead of going that route maybe this would work:
http://gridconnect.com/usb-to-serial/usb-to-serial-adapter/rs232-to-usb.html
I've wondered about the etymology of ethernet???
2nd paragraph, first page:
http://ethernethistory.typepad.com/papers/EthernetPaper.pdf
Hmmmm... perhaps instead of going that route maybe this would work:
http://gridconnect.com/usb-to-serial/usb-to-serial-adapter/rs232-to-usb.html
Two things:
1) The $80 price tag kind of defeats the purpose
2) USB does not have any control outputs, just data.
I just got a radio shack version of this velleman kit. (http://www.vellemanusa.com/products/view/?id=526058) USB interface for several I/O options and it mentions PWM output too. The local RS had a sale on it so your availability may vary. RS site doesn't list it but there is a kit that does DC to PWM. (http://www.radioshack.com/product/index.jsp?productId=12327319) It doesn't appear to be available at a store near me. I may risk being on the RS mailing list forever by ordering it online.
Kevin Watson
13-04-2013, 00:10
One item of electrical testing we seem to be at a real disadvantage with is our ability to test PWM signals.
I've been there all too often blindly swapping PWM cables and motor controllers in order to get to the bottom of a problem that all too often is not electrical.
I've seen postings here on how to build your own Arduino based PWM generator, but building DIY test equipment is not the route I'd like to go.
What I'm really looking for is a test box that:
1) can accept any PWM signal and display what it is receiving
2) generate a PWM signal based on some "hand control" input
Does anyone have any idea if such a thing exists and if so, where to get it?
If you've got an old IFI robot controller sitting around and the Microchip C18 build tools, you could modify code I wrote to do both jobs. The code in frc_pwm.zip (http://kevin.org/frc/frc_pwm.zip) will generate a very precise servo PWM signal, and the code found in ifi_ir_sensor.zip (http://kevin.org/frc/ifi_ir_sensor.zip) will show you how to determine the servo pulse width. The code I wrote for the 2004 game (http://kevin.org/frc/2004/frc_tracker.zip) does kinda the same thing.
-Kevin
It's also not connected on the Victor. http://www.vexrobotics.com/vexpro/motor-controllers/217-2769.html
Just heard back from Mike Copioli. Center pin is not connected on Talon either.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.