Controlling a Servo with ONLY a PC Audio Card and Flowstone
Posted: Mon Apr 29, 2013 8:21 pm
Hello. I've been working on a little project for a while that hasn't gotten anywhere recently. I first started it with Synthedit and asked a lot of question on the synthedit website but now I've decided that it's probably more appropriate to ask over here on the flowstone website.
Basically what I'm trying to do is use my ordinary pc sound card to send the correct PWM signal to an ordinary servo controller.. the kind you'd find on an RC car. the one i'm using is a Turnigy TG9e 9g / 1.5kg / 0.10sec Eco Micro Servo. I got this one because it's super cheap. like £2.50 each. It's highly rated and it's not digital. It's tiny. The reason I've ventured into this odd experiment was because of handful of videos on Youtube that show people using their audio card signal to move the servo left and right. No other hardware required. You basically send the servo a .9 to 2.0ms pulse at 40 to 50HZ. Well, I've designed the software and with a lot of help from people on the synthedit website, I've put together something that should work.
But as of now, I don't seem to be able to control it. Usually when I send the signal it does nothing at all. once in a while, I've gotten it to respond but it's vibrating and shaking really badly and although it moves from left to right when I tell it to, it's just a mess. Other times it will just swing directly to one direction and stop when it reaches the end of it's trajectory. then nothing. the servo runs on 4.8 volts, but i'm giving it 4.5 but I dont' think that would be the reason. I put in 5 volts and it did the same. the power supply is clean because it's a battery pack.
when I look at the waveform in my software, it looks exactly like the waveforms generated with other software.. I've even tried using a program called Daqarta which someone else on the internet used to generated the 50HZ pulse. I followed their technique and it didn't produce the same results.
is it possible that it's just the servo I chose to use? Someone else on the net who used a sound card displayed a small schematic for a tiny two transistor amp that would bump the frequency to "drive" the servo. I'm using the amp module in flowstone to drive it. is that only going to create distortion on the output? Perhaps a EQ filter would be appropriate here to help filter out unwanted signals. I also read somewhere that the frequency of the soundcard output has to be properly divided by the pulse signal but it was way over my head. I have the sound card set to 48khz output but setting it to 44khz hasn't made any different and when I set it even higher it made no difference.
I've also used two different computers. my main desktop and also tried it with my laptop. no real difference in the output.
I thought that before I go and buy another servo I would ask for some advice here in case someone might have a good idea. I've reached the point where I'll sit here for a good 7 hours just trying things and get no where..
I've been working on this for ages and spent a long time creating the software and now I'm at a standstill. Any help would be greatly appreciated. I'd really like to get my project finished.
take it easy,
Grant
Basically what I'm trying to do is use my ordinary pc sound card to send the correct PWM signal to an ordinary servo controller.. the kind you'd find on an RC car. the one i'm using is a Turnigy TG9e 9g / 1.5kg / 0.10sec Eco Micro Servo. I got this one because it's super cheap. like £2.50 each. It's highly rated and it's not digital. It's tiny. The reason I've ventured into this odd experiment was because of handful of videos on Youtube that show people using their audio card signal to move the servo left and right. No other hardware required. You basically send the servo a .9 to 2.0ms pulse at 40 to 50HZ. Well, I've designed the software and with a lot of help from people on the synthedit website, I've put together something that should work.
But as of now, I don't seem to be able to control it. Usually when I send the signal it does nothing at all. once in a while, I've gotten it to respond but it's vibrating and shaking really badly and although it moves from left to right when I tell it to, it's just a mess. Other times it will just swing directly to one direction and stop when it reaches the end of it's trajectory. then nothing. the servo runs on 4.8 volts, but i'm giving it 4.5 but I dont' think that would be the reason. I put in 5 volts and it did the same. the power supply is clean because it's a battery pack.
when I look at the waveform in my software, it looks exactly like the waveforms generated with other software.. I've even tried using a program called Daqarta which someone else on the internet used to generated the 50HZ pulse. I followed their technique and it didn't produce the same results.
is it possible that it's just the servo I chose to use? Someone else on the net who used a sound card displayed a small schematic for a tiny two transistor amp that would bump the frequency to "drive" the servo. I'm using the amp module in flowstone to drive it. is that only going to create distortion on the output? Perhaps a EQ filter would be appropriate here to help filter out unwanted signals. I also read somewhere that the frequency of the soundcard output has to be properly divided by the pulse signal but it was way over my head. I have the sound card set to 48khz output but setting it to 44khz hasn't made any different and when I set it even higher it made no difference.
I've also used two different computers. my main desktop and also tried it with my laptop. no real difference in the output.
I thought that before I go and buy another servo I would ask for some advice here in case someone might have a good idea. I've reached the point where I'll sit here for a good 7 hours just trying things and get no where..
I've been working on this for ages and spent a long time creating the software and now I'm at a standstill. Any help would be greatly appreciated. I'd really like to get my project finished.
take it easy,
Grant