Pages: [1]   Go Down
Author Topic: Mini Turret Project Continues  (Read 1866 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 2
Posts: 34
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, cool! The new forum is up and I can post my updates here!

So, I finally got some missing parts, and now it looks more like a completed turret. So, to save some time, here is the link to the project page:

http://myblogduino.blogspot.com/

Hope you like how it looks. I will write up a simple demo program to show it slewing soon.
Logged

UK
Offline Offline
God Member
*****
Karma: 13
Posts: 903
Twitter: @simonmonk2
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks solid!

So, what are you going to attach to the business end? Laser? BBGun? Flamethrower?
Logged

--
My New Arduino Book: http://www.arduinobook.com

Vejen, Denmark
Offline Offline
Edison Member
*
Karma: 9
Posts: 1178
RAWR! ^,..,^
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Looking cool!!! Only thing I would have done different, is the way the tilt works. I would have used some bearings to hold it, and then with the servo on the back instead, so the bearings would hold the load, and the servo only doing the tilting.



Going to make this on a bigger scale some day, when some of all my current projects are done. smiley Want it to be strong enough to hold a real video camera with optical zoom and auto focus and all, and then make it remote controllable. Maybe even with a little pc on, so it can be put up somewhere, with a USB modem on, and then have a wireless 3G internet connection to it, both streaming audio and video back, plus allowing for pan/tilt.
Logged

captain-slow.dk | non contagious!

0
Offline Offline
Newbie
*
Karma: 2
Posts: 34
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is the assembled turret with a short demo to test the range of motion.

Logged

Vejen, Denmark
Offline Offline
Edison Member
*
Karma: 9
Posts: 1178
RAWR! ^,..,^
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is the assembled turret with a short demo to test the range of motion.
Why not have it so middle position is horisontal?
Logged

captain-slow.dk | non contagious!

0
Offline Offline
Newbie
*
Karma: 2
Posts: 34
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, I get what you mean, but for me, it is horizontal. The sensors are horizontal at the 90deg position.
Logged

Rural Arizona
Offline Offline
Edison Member
*
Karma: 7
Posts: 1711
Incorrigible tinkerer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Maybe even with a little pc on
You should check out the Vivotek VS3100 series video servers as an alternative to PCs.  They're cheap, reliable,  and compact: you can put one right up on the pole with a camera to simplify cabling.  The one big drawback is that they depend on an Activexploit plug-in for viewing, so there's no Linux support  smiley-mad

I really wanted to use a Linux-based server on a couple of the projects I've worked on recently, but the open-source video codecs just can't get the same level of compression as the commercial ones,  so we had to drop the idea to stay within our bandwidth limits  smiley-sad
Logged

0
Offline Offline
Newbie
*
Karma: 2
Posts: 34
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So, I haven't made my other 2 sensors yet, so I thought about what I could do in the mean time.
Here is a simple little program for a single servo and a single IR sensor.
The servo sweeps to predetermined points, reads the values, and then calculates which direction gave the strongest reading (lowest number to Arduino) and then slews to that point for a few seconds.
Then starts over. I figure this can be modified to use as a range finder, or something similar. You will just have to change it to suit your needs.
You can open up the serial monitor to see the values populating.

Quote

#include <Servo.h>

/*******************************************************
Simple little program to sweep and scan with a single
sensor by Mr_Manny

********************************************************
*                define connections                    *
*******************************************************/

Servo myservo;     // create servo object to control a servo
int Sensorpin= 0;  // IR sensor pin
int Servopin = 11; // servo pin

/*******************************************************
*                define variables                      *
*******************************************************/

int scanPos[] = {0, 30, 60, 90, 120, 150, 180}; // Rotation for scans
int scanVal[7];
int i = 0;  
int M = 0;
int newVal = 0;
int Low = 1024;    //1023 is the darkest value
int Pos = 0;
/*******************************************************
*                set up section                        *
*******************************************************/

void setup()
{
  Serial.begin(9600);  // start serial communication
  myservo.attach(Servopin);  // servo pin
  myservo.write(90);  // initial start position
  delay(2000);
  }

/********************************************************
*                   start loop                          *
********************************************************/

void loop()

{
//*******************************************************
  while (i < 7 )
  
  {
  myservo.write(scanPos);
  delay(500);
  newVal = analogRead(Sensorpin);
  scanVal= analogRead(Sensorpin);
  Serial.print("Servo Pos=");Serial.print(scanPos);Serial.print("  Value=");Serial.println(scanVal);
  i++;  
  }
//*******************************************************
  {
   for (int M=0; M<7; M++)  // For IR Sensors 1023 is dark
   {                        // so I need the LOWEST value
     if (scanVal[M] < Low)
     {
       Low = scanVal[M];
       Pos = M;
     }
  }
  }
//*******************************************************
{
  delay(2000);
  Serial.print("Final Pos= ");Serial.println(Pos);
  myservo.write(scanPos[Pos]);  // Now I write the final position
  delay(5000);
}
//*******************************************************
{
  i = 0;      // This is how I reset the loop
  Low = 1024;
}
//*******************************************************
}


« Last Edit: February 11, 2011, 01:37:58 am by Mr_Manny » Logged

Pages: [1]   Go Up
Jump to: