Pan and Tilt Camera steppers and Arduino

  • 9 years ago
Pan and Tilt Camera steppers and Arduino

100 to 1 geared stepper and extra worm gears to increase torque and reduce speed.

Using Arduino and Motor Shield V1.2 for control via a joystick

The steppers are from eBay :-

DC5V 2-phase 4-wire Gear stepper motor Full Metal Gear Stepper Motor

Arduino Leonardo and Adafruit Motor/Stepper/Servo Shield for Arduino kit - v1.2

These Motor Shield are discontinued but may still be available on eBay or the Adafruit Motor/Stepper/Servo Shield for Arduino v2 Kit - v2.3 could be used with suitable changes to the code

Files:

Pan and Tilt camera Arduino Code:-
"camera_pan_and_tilt_V2.ino"
https://onedrive.live.com/?authkey=%21APbxafdZeEPh8d8&id=root&cid=3DCDB9E6CE514531

USE AFMotor Modified folder with Leonardo by Michael Margolis

Notes:
USE AFMotor Modified
( Modified for the Leonardo by Michael Margolis)

Control both Stepper motors at the same time with different speeds if needed

For use with v1 shields
100-1 metal gear stepper. With further Worm reduction
Tilt, Up and Down 100-1 metal gear stepper.

With further Worm reduction and to increase Torque

Using Maplin Worm Gear, a bit bigger diameter than the one off eBay

But using the same bigger gear wheel off eBay

Using Analogue Joystick for control, with the Joystick button used to slow down movement using a delay.

Step Angle: 18 ° / 100 so after geared moves 0.18 ° per step
20 Steps per 360°
Reduction ratio: 100:1
2000 steps on output shaft after the 100:1 reduction
Actual motor Step Angle: 18 ° / 100 = 20 Steps per 360°

Public domain!

SINGLE - One coil is energized at a time.
DOUBLE - Two coils are energized at a time for more torque.
INTERLEAVE - Alternate between single and double to create a half-step in between. This can result in smoother operation, but because of the extra half-step, the speed is reduced by half too.
MICROSTEP - Adjacent coils are ramped up and down to create a number of 'micro-steps' between each full step. This results in finer resolution and smoother rotation, but with a loss in torque.

Note: Step is a synchronous command and will not return until all steps have completed. For concurrent motion of two motors, you must handle the step timing for both motors and use the "onestep()" function below.

Speed - the speed in RPM

Note: The resulting step speed is based on the 'steps' parameter in the constructor. If this does not match the number of steps for your motor, you actual speed will be off as well.

Adafruit motor shield V1.0

https://learn.adafruit.com/adafruit-motor-shield

AF_Stepper Class Modified for the Leonardo by Michael Margolis

https://learn.adafruit.com/afmotor-library-reference/af-stepper-class

Modified for the Leonardo by Michael Margolis

Basic Analogue Joystick
Ref : http://arduino.cc/en/Tutorial/AnalogInput

Build from:-

AFMotor_MultiStepper.pde
http://www.airspayce.com/mikem/arduino/AccelStepper/AFMotor_MultiStepper_8pde-example.html

IMPORTANT:

Works with all Arduino including Leonardo, Mega using modified

AFMotor for the Leonardo by Michael Margolis

Version 1 of the motor shield

Michael Margolis more information
http://www.oreilly.com/pub/au/4466

and also requires:-

The AccelStepper library for Arduino
http://www.airspayce.com/mikem/arduino/AccelStepper/index.html

Control both Stepper motors at the same time

Also see hackaday which may have some updates:-
https://hackaday.io/project/6077-pan-and-tilt-camera-steppers-and-arduino

Public domain!

.