Pan/Tilt servos update-need some help

sbscott

Senior Member
An older post in the Misc completed project area..I posted there but am not sure these areas are very active..

I am trying to set up an web cam that I can control via PICAXE.

I have the Pan/Tilt servos and have set them up on a 08/M as described in the post. I am using an 18X to send commands to the 08 but am not getting consistent results. I used the code that was posted in the thread and it seems to be working.. Can someone give me a little sample code that I can use to test this setup?

The discussion talked about sending key strokes to the 08. I am not sure how to send the commands from the editor?

Thanks.
 

xtech007

Senior Member
I was wondering...

HUmmm.
I was wondering why you did not use servopos in the code to control servos ?
my plans for a future project was to make an Pam and till housing for a security camera. maybe I can learn from your experience..
:rolleyes:
 

lbenson

Senior Member
I think servopos is a new command and was not available when I wrote the program. I may be wrong about that, but in any case I was and am in newbie mode with regard to servos, and just wanted a fairly simple way to pan and tilt with keyboard commands.
 

hippy

Ex-Staff (retired)
SERVOPOS may not have been available at the time.

SERVO generally works acceptably if not frequently executed, it's only when too frequent updates start to mess with the 20ms frame timing that problems can occur.

Using PULSOUT and PAUSE 20 as in lbenson's example will give a change of position synchronised to the servo frame timing and allow frequent stepping without worring about how the SERVOPOS synchronises with the background timing when servos are active.

This PULSOUT method is also used with PULSIN in other applications to pass on received servo signals because it automatically synchronises the generated servo frame timing to that recieved.

The most appropriate mechanism to use depends on what's wanted and what actually works best with a particular hardware configuration.
 

sbscott

Senior Member
lbenson/Hippy, thanks, as usual! I used the SERVO command and it works perfectly. Now for the control..

Let me step back. I want to be able to access a web cam remotely but, not having any experience with Lineux, I don't think I can handle the efforts lbenson made with his web cam.
The approach I am considering, though somewhat convoluted, is to use Radmin's remote control software to activate the web cam over the internet and use some kind of audio generation from the remotely controlled PC that the 08M detects to move the pan/tilt to where I want it to view. The only sticky part is getting through my router over the internet. I have tried using Hamachi (www.hamachi.cc/download.php) virtual VPN to get through the router and it works.

I will work on the audio using COUNT (I guess) to determine what frequency is being generated and how to move the camera accordingly.
I would appreciate and thoughts on the above.
 

lbenson

Senior Member
That is an interesting approach, but as you say, convoluted. An alternative for over-the-web control would be to use a SimpleLan module connected to a 28X1 (or, drool, 20X2--sadly not yet available) and send commands through the SimpleLan web page interface. The 28X1 could pass commands on to the 08M, or could control the servos directly.

Personally, I feel that the Linux route--small and fanless like the NSLU2 running openWrt or the new Sheevaplug--provides much more flexibility for not that much greater cost. Then add all the picaxes you want, preferably wireless. The advantage, if the location is remote, is that you can update the Linux software over the web. With the PICAXE Linux compiler, you might be able to program a picaxe remotely. Now that would be a new trick.
 

sbscott

Senior Member
First things first. I need to spend time understanding how the servo command works with these servos. Then to work on the READADC for input to them.. in some fashion, audio, light, etc.

I have a side question however. I have a set of 4X20 LCD screens I use for PICAXE monitoring. I know that I can generate output to these units at 9600 baud but have been having problems doing this...anyone got some obvious code for an 18X? A SEROUT t4800, ("hello") works fine. But, 9600? I have tried to reset the freq. to 8MHz but does not seem to work..

Thanks.
 
Top