Remote Controlled Sliding Camera Rail

Final Project for ECE 4180, Georgia Institute of Technology, taught by Dr. James Hamblen


https://os.mbed.com/media/uploads/mikermarza/rail_cut.jpg


Team Members

  • Autumn Caraway
  • Michael Marzano

Projcect Description

The goal of this project was to design and implement a remote controlled sliding camera rail using 2 Mbed microcontrollers that communicated with each other over a wireless serial connection. There were 2 parts to this project, the controller (Autumn Caraway) and the camera rail itself (Michael Marzano).


Parts List

Controller
186

Camera Rail
700


Schematics

Controller
https://os.mbed.com/media/uploads/mikermarza/controller_schematic_3.png

Camera Rail https://os.mbed.com/media/uploads/mikermarza/rail_schematic_4.png



Pin Outs

Controller

mbedjoystickXBeeButton1Button2
GNDGNDGND--
VOUTVCCVCCPINPIN
p16--PIN-
p17---PIN
p18SEL---
p19HORZ---
p20VERT---
p21-RESET--
p27-DOUT--
p28-DIN--

Camera Rail

mbedXBeeH-BridgeMotor
GNDGNDGND-
VOUTVCCVCC, PWMA,
PWMB, STBY
-
p17-BI1-
p18-BI2-
p19-AI2-
p20-AI1-
--A01A (BLK)
--AO2A\ (GRN)
--BO2B\ (BLU)
--BO1B (RED)
p26RESET--
p27DOUT--
P28DIN--


Note: The VM pin on the H-Bridge is a variable power input that is used to drive the output pins. It is rated for 5-15 volts. To get acceptable performance out of the motor, we had to use a 12V power supply to drive the H-Bridge.

Source Code

Controller
The controller uses interrupts and timers to sample inputs from the joystick and pushbuttons, then creates an ASCII command string that is sent out over a serial connection to the camera rail.

Import programSliding_Camera_Controller

Source Code for the controller for a Sliding Camera Rail. Reads in inputs from joysticks and buttons to send commands over a serial port

Camera Rail
The Camera Rail uses the Mbed RTOS to efficiently divide up responsibilities into three threads. The main thread uses the LinStepMtr library to control the motor, the second thread reads the serial port and converts the ACII command string into control states and control flags, and the third thread controls the LED status lights.

Import programSliding_Camera_Rail

Source code for a Sliding Camera Rail that receives commands from a controller over Serial connection to drive a Linear Stepper motor via an H-bridge.

LinStepMtr Library

The LinStepMtr Library is a custom library, written my Michael Marzano, that controls a STEPPERONLINE Nema 17 Bipolar Linear Stepper Motor via an H-Bridge. It provides a convenient API that allows the user to set the motor's speed in RPM, control the motor's direction, and set the motor to rotate for a given number of rotations. This library also includes the ability to set software stops to limit the clockwise (positive) or counterclockwise (negative) movement of the motor.

Import libraryLinear_Stepper_Motor_Nema17

API for a STEPPERONLINE Nema 17 Bipolar Linear Stepper Motor. Provides speed, direction, and revolution control.

Import library

Public Types

enum Direction

Direction Control.

More...
enum Step_Num

Steps of motor for movement * In form A B A' B'.

More...

Public Member Functions

LinStepMtr (PinName A_f, PinName A_r, PinName B_f, PinName B_r)
Create a linear stepper motor object connected to specified DigitalOut pins.
LinStepMtr (PinName A_f, PinName A_r, PinName B_f, PinName B_r, int m_rpm)
Create a linear stepper motor object connected to specified DigitalOut pins.
~LinStepMtr ()
Destructor.
float get_speed ()
Gets the current speed in RPM.
void set_speed (float rpm)
Sets the value of speed in RPM.
double get_rev ()
Gets the number of revolutions since motor was initialized.
void set_min_rev_cnt (double rc)
Sets the value of min_rev_cnt.
void set_max_rev_cnt (double rc)
Sets the value of max_rev_cnt.
double get_min_rev_cnt ()
Gets the value of the current minumum revolution count.
double get_max_rev_cnt ()
Gets the value of the current maximum revolution count.
void RESET_rev_cnts ()
Rests the revolution count limits to max/min of double.
Direction get_dir ()
Gets the current direction.
double rotate ( Direction d, float rev)
NOT SUPORTED - Set the direction.

Video Demo


Please log in to post comments.