Author Topic: Using microcontroller to output 0 to 5k Ohm analog signal for motor control  (Read 4583 times)

0 Members and 1 Guest are viewing this topic.

Offline DaaniiTopic starter

  • Robot Overlord
  • ****
  • Posts: 138
  • Helpful? 3
I want to use a microcontroller to output a 0 to 5k Ohm analog signal as a throttle signal for a motor controller.  The motor controller is an ALLtrax AXE-4834 that drives a large golf cart-type motor.  The motor controller also allows, alternatively, a 0 to 5 Volt signal for the throttle. 

Not your typical robot application, I know, but I wonder if anyone can help me figure out a way to get an analog signal out of a microcontroller.  Analog signals are easy to get in, but hard to get out.  The digital to analog converters I can find seem to be expensive overkill, but maybe that's the only solution. 

I saw somewhere a recommendation to use a resistor and capacitor to make a crude low-pass filter that can be hooked up to a microcontroller's pulse width modulator output and used as an analog output.  But the recommender did not offer any details, and I could not figure out how to do that. 

Any ideas?  Thanks. 

Offline Joker94

  • Supreme Robot
  • *****
  • Posts: 1,119
  • Helpful? 26
I have never heard of that sort of signal, So you are talking about a resistance signal in an analouge form being sent from the MCU.

I don't understand.

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
    • RazorConcepts
If it helps there are inexpensive digital potentiometers out there that can change the resistance between two points digitally.

Offline DaaniiTopic starter

  • Robot Overlord
  • ****
  • Posts: 138
  • Helpful? 3
So you are talking about a resistance signal in an analouge form being sent from the MCU.

Yes, that's right.  A golf cart has a throttle mechanically linked to a 0 to 5k Ohm potentiometer.  The potentiometer is connected to a motor controller and provides the throttle signal.  I want to put a microcontroller between the throttle and the motor controller.   Then I can digitally process the throttle signal. 

If it helps there are inexpensive digital potentiometers out there that can change the resistance between two points digitally.

That's a good idea.  I think that might work.  Thanks. 

Offline Joker94

  • Supreme Robot
  • *****
  • Posts: 1,119
  • Helpful? 26
the potentiometers sound like the way to go

Offline Finnik

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 4
Just a question, could it be that the potentiometer is set up in a voltage divider circuit, thus providing a variable voltage to the motor controller? I think this is the situation because analogue  signals are based on voltages. You are not able to "send" a resistance signal because resistance is a physical property of an object, although you may be able to change the resistance using one of those digital potentiometers mentioned earlier.

Outputting an analogue voltage using a uC indeed requires a digital-to-analogue converter. I don't know where you've been looking, but this doesn't seem like expensive overkill to me:
http://www.sparkfun.com/commerce/product_info.php?products_id=8736

I've also gotten DAC chips from TI as samples, so you could try that.
Think outside the box... inside is to crowded.

Offline DaaniiTopic starter

  • Robot Overlord
  • ****
  • Posts: 138
  • Helpful? 3
I don't know where you've been looking . . .

I've clearly been looking in all the wrong places.  Thanks for the link to the reasonably-priced digital to analog converter.  That looks like a good solution.  I have looked into the digital potentiometers, and they will work too.  Two very good ideas to solve a problem that had me stumped. 

Just a question, could it be that the potentiometer is set up in a voltage divider circuit, thus providing a variable voltage to the motor controller? I think this is the situation because analogue  signals are based on voltages. You are not able to "send" a resistance signal because resistance is a physical property of an object, although you may be able to change the resistance using one of those digital potentiometers mentioned earlier.

I don't know how the motor controller works inside, but I suspect you are right.  That is, I suspect the resistance is used to generate a variable voltage inside the motor controller.  In fact, with the motor controller I am using you can modify the controller to accept a voltage signal of 0 to 5 Volts instead of varying the resistance.