Author
Topic: R/C Wheelchair PWM to Analog (Read 5744 times)

I am preparing to start a new project and was looking for some pointers before I get to far in my design. The concept is your standard R/C wheelchair. I have found much information on the conversion to R/C, but they all involve the purchase of a new motor controller. I have a functioning Merits chair with its PG controller, and I am having a hard time just throwing this perfectly good controller away and starting with something new. The question I have involves the attached spec sheet for the controllers joystick. I would like some suggestions for a component (pre-made or DIY) that would receive the signal from the R/C receiver and take the place of the chairs joystick for input to the chairs controller. I am new to circuit design, but would like to learn and this is my opportunity.

Would a programmable chip be the best bet or discrete components? I would like to do this as efficiently as possible, both in terms of cost and circuit design. If anyone knows of something that exists, or an example I can learn from, I would be very grateful. Thanks. Anxiously awaiting your suggestions.

SmAsH,Thanks for the reply. I was hoping to go servo free.How I see it in my mind:

R/C Receiver Output (PWM?)--->Input of new circuit (conversion to required voltage per joystick spec sheet)--->Circuit output to controllers input (taking the place of the actual Joystick)

Conceptually it seems pretty simple (If you know what your doing), but I am pretty new to this. From what I have read this is just Digital to Analog conversion. What I am wondering is what components would address this in the most efficient way (smallest form factor, fewest number of components, ....).

This would be a 'Tank Steering' setup, from what I have read would require mixing of the 2 channels. I plan to accomplish this via the R/C Transmitter with built in mixing. If I understand this correctly it will allow me to control the chair via 2 channels on the transmitter, but only 1 stick. If I am not understanding correctly please let me know. Thanks.

So the motor controller takes an analogue voltage in from the joystick. The way i would approach this problem would be to use a microcontroller (PIC or AVR) to analyse the input of the R/C controller and then output the corresponding analogue voltage (which i guess is what you are hinting at...). The problem with this is that creating analogue outputs is notoriously difficult. There are a few methods - PWM with a smoothing RC circuit, R-2R resistor ladders, or using a digital-to-analogue IC are amongst the most common. You could take a look at those.

Another possibility is to just input a PWM signal straight into the motor controller, without prior conversion to a steady DC voltage. This depends on the electronics of the motor controller... It should work though. If that will work, then you could use a microcontroller to convert the PWM from the R/C receiver into a suitable corresponding PWM for the motor controller.

Another approach would be to look at the controller - if it has a stage where it converts the joystick's analogue output into a PWM, you could bypass the MCU on the controller with some clever soldering.

Or you could use Smash's idea and just connect the joystick mechanically to some servos controlled by the r/c receiver. This would require almost zero electronics skills, and more mechanical skills. Actually i think i'd use this idea... its so easy

Hope that helps

EDIT: just re-read it... the wording is terrible Feel free to ask me to explain in more depth

I plan to look into the controller later today. I was hoping that I could interface the controller in the least intrusive way possible. In theory I would only need to connect to it via the connector the joystick uses. This seems like such a simple concept and so many people are attempting this in some way, I would think a product would exist to accomplish this. I would love to tear everything apart and use the Sabertooth 2X25, but the controller is fine, it does the mixing, is tuned for motors, incorporates the charging interface, provides diagnostics, and interfaces with the electric brakes. Yes the Sabertooth would address the R/C interface issue, but would also create new issues that would need to be addressed. I guess I would like to work on a solution that would apply not only to my project, but benefit others as well.

If a 'Universal' interface circuit were designed it could apply to a variety of controllers. I have read of controllers that operate on the same concept, but the required signal voltage is 12Vdc as opposed to the 5Vdc for this controller. Could the circuit be designed so these values could be easily changed?

I will also look into the direct PWM you suggested. I guess I am just trying to approach this while keeping the big picture in mind and not just this particular project. As for the mechanical approach, I know I could easily accomplish this, but I really wanted to avoid the bubblegum and band-aid approach.

as hazzer said you could probably create some kind of analogue voltage that would just replace the joystick... do you know where the wires from the joystick pots go to? if it only uses one wire to read voltage it will be easier for this method.

The RC signal is actually a PPM signal. It sends a 1-2 ms pulse every 20ms. The length of that pulse determines the value of the RC (PPM) signal. So you have to measure the length of the pulse with a microcontroller every 20ms.

you could use an Arduino (avr microcontroller) to interpret the RC signal from your Rx and then translate that into a PWM signal to control a high-powered H-bridge. I went through the same thing, trying to control 2 wheelchair motors (appx. 350watts each) for an RC controlled lawn mower with a tank drive steering setup. I accumulated some code to translate the RC signal into PWM using an Arduino, but have yet to locate a good high-current H-bridge IC that can handle upwards of 20amps. I have decided on using the Sabertooth 2x25 since it will make things so much more simple for $125. But I use this code to play with cheap RC cars from the thrift store using my Arduino and it works very well (with the small > 2a H-bridges that I've tried).

I am starting a similar project (Jazzy Select) and thanks to your tech sheet (i have the same exact controller as described) I'm going to use arduino uno. first analog read to prove the voltages on each channel then configure analog out to the joystick controller. so i keep all the functionality of charger & brakes etc.

basically no cost since i already have all of these components

If we could keep in touch to update each other on this project please do email me. I'll email you asap - i gotta get out of here before they lock the doors.

I agree with those suggesting keeping the original motor controllers. Those things can be pretty expensive for motors this size.

I'd go with the trying to simulate the output from the joystick using some sort of DAC. Reading the pulses from the RC receiver is trivial, the challenge will be getting the voltage output your controller will accept.

Do you know what voltage the pots in the joystick are using? If it's 5V then an analog write from an Arduino might be all you need. There are also dedicated DAC chips that should give a very clean voltage if your controller doesn't like the PWM from the analog write.

Here's an 8-bit DAC that lets you output a voltage twice as high as the voltage it's running on.

Both of these should be relatively easy to control from an Arduino or other microcontroller (my favorite uC is the Propeller). You'll need two DACs to simulate one joystick (since each joystick has two pots).

If your joystick is using 12V, you many need to use an op-amp to increase the voltage range (I think you'd use an op-amp, I'm don't know a lot about them myself).

Do you know how many channels you want use on your RC controller? The number of channels to read and the other tasks your robot needs to perform may effect your choice of microcontroller.

The joystick is not a voltage, it's a resistrance. If you're lucky, you can cut into the wires at the point where the voltage has turned into a resistance, and use a voltage output. (If you use Arduino analog out, remember that that's a PWM and needs significant filtering!)

There are actually a bunch of those, with different resistance, different interface (that one's SPI; there's I2C, step/direction, etc as well) as well as multiple pots in a single package.

Btw: Each time I post a digi-key link in this forum, I get a permission denied, saying my computer has a trojan trying to make a request entity attack. The only reason for this is that the URL that I paste contains "% 2 F" (without the spaces) which is an escaped slash character. Clearly, that's a legit use case, so can someone please turn off that behavior?

Each of the pots acts as a variable voltage divider with the output voltage on the wiper tap.

After reading the datasheet from the top post a bit more it looks like the joystick uses a 5V supply(VS). There's a 1/2 VS tap to compare the two outputs against. The two output pins of the joystick output a voltage of 2.5V (assuming 5V VS) +/- 1.39V. So the output pins' voltage can be from 1.11V up to 4.39V. The datasheet includes a graph of this range.

Hobby servos usually have a 5K ohm pot inside. It turns out this 5K ohm value isn't important and a servo will work just fine with a 10K pot since a servo uses the voltage from the pot's center tap to determine its position. A 10K pot wouldn't work if the resistance were the important characteristic. I'd be very surprised if the chair's controller didn't also use the voltage from the pots wipers' to determine the pot's (joystick's) position.

Of course there's a voltage at some point further down the chain. The joystick itself (the mechanical part) is not a voltage source, though, it's a resistance that implements a voltage divider. If you want to replace the joystick only, you need a controllable resistance. If you are OK with going further down the line in what you replace, clearly you can use a voltage source replacement, at least as long as the impedance of your voltage source is equal to or lesser than what the downstream control circuitry expects.

Regarding using a different resistance in a servo feedback potentiometer, yes, it will "work." Often, if you're close enough, it will even "work well." However, if the resistance of the potentiometer you choose is significantly higher than the design resistance, then the source impedance of that voltage divider will be too high, and the comparator input stage in the servo will not be sufficiently driven, and you will end up with any or all of slow response, excessive noise, or unreliable input. If the resistance of your replacement pot is too low, then the pot will draw more current than needed, and add some heat build-up, although you'd need to go pretty low (< 1k, say) before that would be a real problem, unless there's a very marginal regulator feeding the potentiometer.

I'v found the analog voltage of the P&G drives to be 1.0 to 4.0Vdc with 2.5V as center,if the voltage goes outside of these values the drive will go into Fault mode. also If thedrive is turned on with out the center value(2.5V) it will also go into a fault mode.

Sorry for the late response (I've been seriously busy), but I'll second what Tommy said. I tapped into my joystick and used and Arduino to supply the voltages. http://www.societyofrobots.com/robotforum/index.php?topic=16752.msg117794#msg117794. Two other things I came across: I needed to make sure the Ground from the joystick was also connected to my Arduino ground. Without the common ground, my controller would seem to initialize fine, but as soon as I issued a motor command, it would error out. I also needed to add a low-pass filter (thanks, jwatte) to eliminate some other random faults.

One other important point that I learned. Don't turn your wheelchair motors on before your controller. And turn them off before turning off the controller. When I shut down or reboot my Arduino, the voltage goes low, and the chair controller interprets this as a command to move. The motors run for at least 5 or 10 seconds before it errors out when this happens. Unexpectedly. Just FYI. Be ready for that, just in case.