image35

My DIY Camera Slider

Code for the Arduino UNO

/*

stepper motor Rail Pan Tilt camera controller

by Markus Fuller 2020 www.markusfuller.com

using 1 Arduino UNO 3x nema17 stepper motors and 3x EasyDrivers from www.schmalzhaus.com

Library - AccelStepper by Mike McCauley:

*/

#include <AccelStepper.h>

#include <MultiStepper.h>

#define PanX A0  // Pan X pin

#define TiltY A1  // Tilt Y pin

#define Rail A2  // Slider potentiometer

#define inOutPot A3  // In and Out speed potentiometer

#define PanStop 10 // to stop pan cable tangling

#define Button 12  // Set Button

#define EndStop 11

#define RedLED 8  // RGB Led Red

#define GreenLED 9 // RGB Led Green

#define blueLED 13 // RGB Led blue

// Set stepper motor pins on Arduino as type, Step, and Direction,

AccelStepper stepper1(1, 7, 6);

AccelStepper stepper2(1, 5, 4);

AccelStepper stepper3(1, 3, 2);

MultiStepper StepperControl;

long gotoposition[3]; // stores the A and B position for every stepper motor

int PanPos = 0;

int TiltYPos = 0;

int RailPos = 0;

int currentSpeed = 100;

int inOutSpeed = 100;

int XInPoint = 0;

int YInPoint = 0;

int ZInPoint = 0;

int XOutPoint = 0;

int YOutPoint = 0;

int ZOutPoint = 0;

int InandOut = 0;

void setup() {

stepper1.setMaxSpeed(3000);

stepper1.setSpeed(300);

stepper2.setMaxSpeed(1500);

stepper2.setSpeed(75);

stepper3.setMaxSpeed(1500);

stepper3.setSpeed(75);

pinMode(PanStop, INPUT_PULLUP); //faultstop to help prevent pan cable tangling

pinMode(Button, INPUT_PULLUP); //setswitch which is also activate button

pinMode(EndStop, INPUT_PULLUP); //endstop microswitch

pinMode(RedLED, OUTPUT); //red led

pinMode(GreenLED, OUTPUT); //green led

pinMode(blueLED, OUTPUT); //blue led

StepperControl.addStepper(stepper1);

StepperControl.addStepper(stepper2);

StepperControl.addStepper(stepper3);

// Move the slider to the Home position when first turned on

while (digitalRead(EndStop) != 0) {

stepper1.setSpeed(1500);

stepper1.runSpeed();

stepper1.setCurrentPosition(0); // When EndStop is activated this sets position as step 0

}

delay(30);

// Moves back slightly from the rail endstop

while (stepper1.currentPosition() != -1500) {

stepper1.setSpeed(-1500);

stepper1.run();

// This section below for Pan centre control

}

// Moves the pan head anticlockwise until microswitch is activated

while (digitalRead(PanStop) != 0) {

stepper3.setSpeed(-400);

stepper3.runSpeed();

stepper3.setCurrentPosition(0); // When Pan is centred set position to 0 steps

}

delay(30);

// Moves pan clockwise untilfacing forward, this may need to be changed depending on how many teeth between stepper and pan wheel

while (stepper3.currentPosition() != 1070) { 

stepper3.setSpeed(400); 

stepper3.run();

// End of section above

digitalWrite(blueLED, HIGH); // blue led turns on

}

}

void loop() {

// this will cancel out the rail movement if you try and travel beyond safe limits

while (digitalRead(EndStop) == 0 || stepper1.currentPosition() < -40500) {}

if (digitalRead (Button) == 0) {

delay(1000); // hold switch for 1 second to reset all values then LED turns Blue

if (digitalRead (Button) == 0) {

InandOut = 4;

}

switch (InandOut) {

case 0:  // Set the A position

InandOut = 1;

XInPoint = stepper1.currentPosition(); // Set the IN position for steppers 1

YInPoint = stepper2.currentPosition(); // Set the IN position for steppers 2

ZInPoint = stepper3.currentPosition(); // Set the IN position for steppers 3

digitalWrite(blueLED, LOW); // MSF blue led goes out

digitalWrite(RedLED, HIGH); // Light up inLed

break;

case 1: // Set the B position

InandOut = 2;

XOutPoint = stepper1.currentPosition(); // Set the B positions for steppers

YOutPoint = stepper2.currentPosition();

ZOutPoint = stepper3.currentPosition();

digitalWrite(RedLED, LOW); // red Led goes off then Green Led Illuminates stating ready to run

digitalWrite(GreenLED, HIGH);

break;

case 2: // Move to A position / go to next part case 3

InandOut = 3;

inOutSpeed = analogRead(inOutPot);

// Place the A position into the Array

gotoposition[0] = XInPoint;

gotoposition[1] = YInPoint;

gotoposition[2] = ZInPoint;

stepper1.setMaxSpeed(inOutSpeed);

stepper2.setMaxSpeed(inOutSpeed);

stepper3.setMaxSpeed(inOutSpeed);

StepperControl.moveTo(gotoposition);

StepperControl.runSpeedToPosition();

delay(200);

break;

case 3: // Move to B position and returns go back to case 2 above

InandOut = 2;

inOutSpeed = analogRead(inOutPot);

// Place the B position into the Array

gotoposition[0] = XOutPoint;

gotoposition[1] = YOutPoint;

gotoposition[2] = ZOutPoint;

stepper1.setMaxSpeed(inOutSpeed);

stepper2.setMaxSpeed(inOutSpeed);

stepper3.setMaxSpeed(inOutSpeed);

StepperControl.moveTo(gotoposition);

StepperControl.runSpeedToPosition();

delay(200);

break;

case 4: // If Set button is held longer than one second go back to the beginning case 0 above

InandOut = 0;

digitalWrite(RedLED, LOW);

digitalWrite(GreenLED, LOW);

digitalWrite(blueLED, HIGH);

delay(1000);

break;

}

}

// PanX - Pan movement XPos

PanPos = analogRead(PanX);

// if Pan Pot is moved left, move stepper 2 pan anticlockwise

if (PanPos > 600) {

//stepper2.setSpeed(currentSpeed);

PanPos = map(PanPos, 600, 1024, 0, 200);

stepper2.setSpeed(PanPos); // Increase speed

}

// if PanPot is moved right, move stepper 2 pan clockwise

else if (PanPos < 400) {

//stepper2.setSpeed(-currentSpeed);

PanPos = map(PanPos, 400, 0, 0, 200);

stepper2.setSpeed(-PanPos); // Increase speed

}

// if PanPot is centred then there is no movement

else {

stepper2.setSpeed(0);

}

//Tilt Y - Tilt movement

TiltYPos = analogRead(TiltY);

if (TiltYPos > 600) {

//stepper3.setSpeed(currentSpeed);

TiltYPos = map(TiltYPos, 600, 1024, 0, 200);

stepper3.setSpeed(TiltYPos); // Increase speed

}

else if (TiltYPos < 400) {

//stepper3.setSpeed(-currentSpeed);

TiltYPos = map(TiltYPos, 400, 0, 0, 200); // Try changing this to lower value to slow tilt stepper

stepper3.setSpeed(-TiltYPos); // Increase speed

// If TiltPot is centred then there is no movement

}

else {

stepper3.setSpeed(0);

}

// RAIL potentiometer

RailPos = analogRead(Rail);

// If potentiometer is turned left then the Gantry moves towards the control unit

if (RailPos > 600) {

RailPos = map(RailPos, 600, 1024, 0, 3000);

stepper1.setSpeed(-RailPos); // Increase speed

}

// If potentiometer is turned right then the Gantry moves away from the control unit

else if (RailPos < 400 ) {

RailPos = map(RailPos, 400, 0, 0, 3000);

stepper1.setSpeed(RailPos); // Increase speed

// If potentiometer is centred then there is no movement

}  

else {

stepper1.setSpeed(0);

}

// run the camera slider

stepper1.runSpeed();

stepper2.runSpeed();

stepper3.runSpeed();

}

The circuit diagram will be uploaded shortly

The circuit diagram will be uploaded as soon as possible. 

Analog Wave Twister

Eurorack project

This is a simple to make project that will take 2 audio or CV inputs and allow you to attenuvert the 2 signals plus add or reduce gain. Though it seems to work better with CV rather than Audio.

There is a Difference circuit that will take the signal from A and B and give you some interesting voltage signal patterns, The A&B inputs can be swopped by the switch, The signal also has an inverted output and if no jacks are inserted then the unit is readily connected to the +-Bias of the A&B inputs section.

There is also a Summing circuit that will add A&B together, Again if no jacks are inserted into the Sum-A and Sum-B they are automatically connected to +-Bias A&B. as with the Difference circuit there is also an inverted version available.

both the Difference circuit and Summing circuit have level adjust for the inputs.


 This unit is rather large for a Eurorack module and takes up too much HP (horizontal pitch) but I just wanted to make it just to see if it could be useful, Maybe I will make a much smaller version on revision 2. 

Click for Schematics

Click for Schematics