Embedded WebServers
  Press release Persbericht     Nieuw     Projects     BromSmurf Development     Testing     About Bromsmurf     Download     Links     WEBsite, Birds view  
Weatherstation
Experimental www
Experimental local
NETcam www
NETcam local
System Internals
Camera Control
Network development system
Common:
Home

Camera Control

Pan&Tilt system, prototype II

The Pan&Tilt setup for NetCamera. This is the final prototype for the time being. It runs on a PIC16F876 and connectors are available to program and configuere the system.

Source code in C

Here you find some of the code that is used in this project: Sample sourcecode

Pan&Tilt system, engine detail

Here you can see the setup for the X and Y engines The engines have a power line and a pulsewith input. Pulses range from 1 ms to 2 ms in 1 us steps. An internal circuit matches the engine angle to the suppied pulse.

Pan & Tilt system

View of the camera pan & tilt. Standard servo motors are used to drive the camera horizontaly and vertically. For first tests a Basic Stamp BS2 and a breadboard are used (not shown). Later a PIC16F876 will do the job.

Prototype 1b, overview

Top view Here you can see the camera, some of the pan & tilt, the new blue box and the electronics prototype (Basic Stamp).

Prototype 1b

Pan&Tilt mounted on its box. The blue box will hold electronics and batteries for the servo motors.

Sample sourcecode

Below essential pieces of code needed to control the servomotors are shown. With this information and knowledge of microcontrollers and this type of servo it should not be too difficult to design your own specific application.

The program is entirely written in C.

void hold_x(void)
{// keeps x-motor in position while y rums
int16 k=0;

k=Xlast;

output_high(pin_B5);

us_pulse(k);

output_low(pin_B5);
}

void us_pulse(int16 k)
{// generate exact delay for the pulses
while(k>=256)
{
k-=256;
delay_us(255);
}
delay_us(k);
}
void moveto_pan(int16 x1,int8 delay)
{// move x-motor
int16 i=0,k=0;

if(Xlast<x1)
{
for(i=Xlast;i<x1;i++)
{// turn left
k=i;
Xlast=i;

output_high(pin_B5);

us_pulse(k);

output_low(pin_B5);
hold_y();
delay_ms(delay);

}
}
else
{
for(i=Xlast;i>x1;i--)
{// turn right
k=i;
Xlast=i;

output_high(pin_B5);

us_pulse(k);

output_low(pin_B5);
hold_y();
delay_ms(delay);

}
}
}