Author Topic: Digital Pot  (Read 408 times)

0 Members and 1 Guest are viewing this topic.

Offline RubyTopic starter

  • Jr. Member
  • **
  • Posts: 18
  • Helpful? 0
Digital Pot
« on: May 15, 2013, 11:57:50 AM »
Hi all. I want to control servo motor with AD5206 digital pot but i don't know how to do it. How can i control the pot from pc via usb?
Thanks.

Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: Digital Pot
« Reply #1 on: May 15, 2013, 04:23:53 PM »
To control digi-pot from PC via USB You need to use microcontroller with UART feature.

First Google search result for "ad5206 tutorial" was Controlling a Digital Potentiometer Using SPI.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline RubyTopic starter

  • Jr. Member
  • **
  • Posts: 18
  • Helpful? 0
Re: Digital Pot
« Reply #2 on: May 15, 2013, 11:17:10 PM »
Hi. Thanks for reply but I don't want to use Arduino. Is it possible without it?

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,275
  • Helpful? 79
Re: Digital Pot
« Reply #3 on: May 15, 2013, 11:41:39 PM »
You are going about it the wrong way!

The servo you are trying to control wants a pulse train at 20-60 Hz with a pulse width of between 1000 and 2000 microseconds. This is a standard hobby servo.

The circuit you're linking to uses a digital potentiometer plus a 555 timer to generate that pulse train. That's one way of doing it, but it's a pretty dumb way of doing it IMO. You would then have to find a way to control the digital potentiometer from USB, which means some kind of interfacing circuitry or board. The Arduino is one board that interfaces between USB and various electric signals, but there are others.

It's going to be cheaper and more reliable to do it from a microcontroller. Simply disable interrupts, pull the output high, wait for the right number of cycles, pull the output low, and enable interrupts, then sleep until next time. An Arduino could do it if you want a plug-and-play board. An Atmega8u2 or better microcontroller could do it if you want to wire something up on a breadboard. A good example would be the Atmega32u4 breakout board from mattairtech.com -- I use that for many things, and it's great! I write the code using the LUFA library for AVR microcontrollers, and drive it using the libusb library on the computer.

If you don't want to go that way, you can buy something that's pre-made that speaks USB on one end, and speaks servo on the other end. The ideal plug-and-play solution would be the Micro Maestro from Pololu: it speaks USB on one side, and speaks servo pulse trains on the other side, controlling up to 6 servos.

If none of these solutions work for you, then you have to be a little more clear about what your requirements ACTUALLY are, and why these particular solutions don't fulfill those requirements. You have to realize that you're very unlikely to be able to speak USB without some kind of microcontroller involved, though.


 


Get Your Ad Here