Hi all,
I think I’ve been through all the material before bringing this up; it’s my first post so I guess we’ll see.
Project
I’m creating a automated mount that rotates a smartphone around it’s optical center to capture images that can be stitched into a spherical panorama or “virtual tour”. To do this I’m tilting and panning using RC Servos that are controlled with an Arduino Micro. I’m using a 360 servo for panning and because of the torque needed to rotate the smartphone to horizontal, I am using the HD 1501MG. It actually has enough torque to raise a 7in tablet as well.
After dealing with lots of little problems, everything is working fine except for the Tilt Servo.
Problem
To capture the zenith (straight up) and nadir (straight down) I need the 1501G to rotate through 180deg. Out of the box it seems that it only does about 160deg. In rotating the spindle, there clearly is enough rotation between the mechanical stops so it looks like I should be able to change the pulse width to get the extra 30 deg. \
No luck here.
The Arduino’s servo.h file by default has a 544 microsecond minimum and a 2400 microsecond maximum pulse width.
I created at test sketch to see what would work and whenever I increase the maximum pulse width the result is that the servo’s angular range actually decreases by about 30 deg and beyond that angle any effort to increase it is “ignored”.
Code
In the code I’ve put the default variables in red:
#include <Servo.h>
int shutter = 2;
int shutter_delay = 100;
Servo tilt_servo;
Servo pan_servo;
int tilt_pos = 240;
int tilt_min = 0;
int tilt_max = 300;
int tilt_step = 10;
int tilt_delay = 700;
int tilt_move_step = 1;
int tilt_move_delay = 1;
void setup()
{
pinMode(shutter, OUTPUT);
digitalWrite(shutter, LOW);
tilt_servo.attach(10<font color="#FF0000">, 544, 2400</font>);
tilt_servo.write(tilt_pos);
}
void loop () {}
To summarize
I’m trying to understand whether:
The 1501MG is actually capable of 180 degrees
If it is, whether the Arduino’s servo.h is capable of controlling it
If both are true, suggestions how I’m screwing it up and can fix it :-/
Thanks in advance.