PDA

View Full Version : Camera slider



neksmerj
28th October 2014, 03:20 PM
Ah, the joys of being a dad. My son is an avid storm chaser/photographer and asked me if I could make a slider. "A what?" A slider.

It's a piece of track say 2m long with a carriage supporting a camera that runs along it, motor driven. "Of course I can".

What I envisage is a length of extruded aluminium track, say lipped channel, with an internal sliding nylon block. The block will be fitted with a camera mount and be drilled and tapped to accommodate a nylon lead screw driven by a wiper motor at one end. Still with me?

It seems 12mm nylon allthread is available from Blackwoods. Not sure about the lipped channel yet, but reckon something about 75mm wide x 25mm deep would be ideal.

The 12v wiper motor would need to be powered by a battery, and be capable of variable speed. Not sure how I would do this.

Any ideas would be appreciated.

Ken

KBs PensNmore
28th October 2014, 03:48 PM
Hi Ken, I use to make slides for fridges,outboard motors, drawers etc. Made a kitchen unit for a trailer that had 190kg sitting on the end of it. What I used was similar to 50X25mm Lysaght channel with roller bearings inside on a frame that allowed the item to come out. Is that the type of thing you are after? Any chance of a pic or sketch?
Kryn

Master Splinter
28th October 2014, 04:34 PM
I'd be hesitant about using 12mm nylon allthread if it's two meters long, for two reasons - 1) If it's from Blackwoods, I can imagine what they'll want for it, and 2) A length of two meters might run into whipping problems, not to mention twisting and snapping under high torque.

I'd use metal all thread with a nylon female fitting (made from a convenient plastic chopping board), similar to the way some CNC routers use allthread and nylon.

You also might be able to use skateboard wheels inside the channel as you can get these (with bearings) pretty cheaply off ebay.

As for drive, a 12 volt motor with reduction gearbox and a PWM speed control can both be found fairly cheaply on ebay. Or see if it works with a cheap cordless drill...you could find a 12 volt one with a clapped out battery fairly cheaply and convert it to a cord that plugs into a car lighter socket or battery clips.

rusel
28th October 2014, 04:43 PM
Hi Ken
Have made one of these for a pro photographer, the brief was similar to your but need much more control for the speed for 4m was from 2 days to 1 minute(manly to reset the trolley).
Used a stepper motor which had a winch drum on it that ran on a cord that was connected to each end of the rail. Could also put a stop on the cord mid way which stopped the motor by hitting a switch.
The tracks are usually round pipe about 1m long and have a step down pipe to connect them together, look like a railway track. The wheels have a hollow groove that runs on the pipe.
Your ideas sound good just need to see how much control you need and it can not vibrate or rattle.

Will watch with interest

Russell

maggs
28th October 2014, 04:44 PM
You might want to checkout some v-slot extrusion and v-bearing carriages. You could use GT2 timing belt, stepper motor and drive it with an arduino/ramps board. This type of system can provide fast and smooth movement that I'm guessing would be appropriate for filming.

Examples of the extrusion can be found here.
http://openbuildspartstore.com/v-slot/?sort=bestselling

Steve

neksmerj
28th October 2014, 05:38 PM
Thanks Magg, that product looks fantastic, what an elegant solution, but, where do you get the stuff from?

There doesn't appear to be an outlet listed, unless I'm going blind.

Ken

maggs
28th October 2014, 05:44 PM
Thanks Magg, that product looks fantastic, what an elegant solution, but, where do you get the stuff from?

There doesn't appear to be an outlet listed, unless I'm going blind.

Ken

You can buy direct from that on-line store but it's in the USA. Freight shouldn't be too bad for 2m lengths and there's not much weight. I don't know if it's available in Oz, probably not.
I haven't seen the product in the flesh but it sure looks the goods. I'm thinking of getting some for some projects in the future plus I just want to play with it. It allows you to build complex assemblies with just a saw and drill.

steve

Avery
28th October 2014, 06:23 PM
maybe something from here?

http://www.smallparts.com.au/store/categories/


Search for "v rail" to start - there are lots of other categories that might be of use to you - bearings ,motors etc.

Good luck!

snowyskiesau
28th October 2014, 07:55 PM
A good option for this sort of thing is Makerslide. It's available locally from this eBay (http://www.ebay.com.au/itm/Makerslide-Rail-1200-2800mm-Linear-Bearing-for-ORD-Bot-Hadron-and-ShapeOko-Mill-/131173001718?pt=AU_Building_Materials&var=&hash=item1e8a8529f6) seller. They don't sell all of the plates, bearings, wheels etc that you'll need but you can get these from Inventables (https://www.inventables.com/technologies?utf8=%E2%9C%93&criteria=makerslide) in the US. Inventables also sell Makerslide but won't ship sections longer than 1000mm as USPS won't handle that length and couriers are too expensive.

Inventables are good to deal with, I've gotten lots of bits and pieces from them for 3D printer building.

Lots of information on Makerslide at the site of the inventor (http://www.buildlog.net/),

A search for camera mount and Makerslide will turn up a few example designs, both manual and automated.(https://www.inventables.com/projects/simple-camera-slider for example)
A belt drive (GT2 belt) would be the easiest to implement. Small stepper motor and a small computer such as an Arduino or Raspberry Pi

neksmerj
28th October 2014, 08:08 PM
That inventables site has some great stuff on it including a camera slider.

Q1. What power motor would I need, nema 17 or larger?

Q2. What sort of speed controller would I need with forward and reverse and run from a 12v battery for field work?

Electronics is not my strong point.

Thanks for all the input so far.......

Ken

snowyskiesau
28th October 2014, 08:28 PM
A NEMA 17 will be more than enough for this project - unless it's a very heavy camera.
In this blog post (http://www.buildlog.net/blog/2011/12/makerslide-camera-slider-control-program/), Bart talks about using a NEMA 14. lower power consumption and quieter.

If you go Arduino for the controller, it will require 5V but the stepper driver will run from 12V.

The program linked in the article assumes a computer to drive it. A standalone controller with and LCD would also be an option depending on how much you want to spend.

neksmerj
28th October 2014, 10:08 PM
Arduino, what's that all about. I presume it's some sort of controller. Does it come ready made or as a kit, and how is it programmed?

Ken the dummy

Sir Stinkalot
28th October 2014, 10:20 PM
There have been some fancy examples shown already. This is another option (more so the track):


http://youtu.be/-bcWUGmwM6g?list=PLZqh4Qx3PPHl5EkKxxRIxJ1Ahcs9Si39d

snowyskiesau
28th October 2014, 10:23 PM
Arduino, what's that all about. I presume it's some sort of controller. Does it come ready made or as a kit, and how is it programmed?

Ken the dummy

It's a small, cheap, easy to program, open source board that is ideal for controllers. Lots of add on boards (called shields) for all manner of functions - including motion control and time lapse for cameras (http://www.minie.airiclenz.com/about-the-miniengine/)

Intro to Arduino (http://arduino.cc/en/Guide/Introduction)

pippin88
28th October 2014, 10:23 PM
Agree with using existing linear motion components and using a belt drive.

neksmerj
28th October 2014, 11:26 PM
After a lot of searching, I finally managed to find an Australian distributor for Openbuilds parts.

http://www.makerstore.com.au/

Ken

snowyskiesau
29th October 2014, 12:57 AM
After a lot of searching, I finally managed to find an Australian distributor for Openbuilds parts.

http://www.makerstore.com.au/

Ken

Maximum length of V-slot extrusion is 1500mm, Weren't you after a 2 metre length?

BaronJ
29th October 2014, 03:53 AM
This looks like its going to develop into a very interesting thread :) So I'm watching with anticipation :):):)

bollie7
29th October 2014, 10:31 AM
Another possibly cheap source of track is to try and get an old drafting machine if you can get one cheap. They have nice tracks and carriages with adjustable ball race wheels in them. Std board mounted machines are usually only around 1200 long though.

bollie7

neksmerj
29th October 2014, 01:26 PM
Looks like there is a bit of interest in this subject, good to see.

A bit of info on the term Arduino may be found here http://en.wikipedia.org/wiki/Arduino

I've written to the Maker Store requesting they put together a basic slider kit, am awaiting their reply.

Ken

snowyskiesau
29th October 2014, 01:37 PM
Another local site that stocks the v-slot extrusions:

http://openlab.com.au/shop

Here's a build video for a simple slider. This would work fine for a 1.5 or 2 metre slider.

http://www.youtube.com/watch?feature=player_embedded&v=-DBmbtBd6bg

Blahhh
29th October 2014, 02:28 PM
After a lot of searching, I finally managed to find an Australian distributor for Openbuilds parts.

http://www.makerstore.com.au/

Ken

Hi guys, my name is Steve and I am from Maker Store.

I saw Ken's post here and I actually had on my to-do list a kit a camera slider.

Ken has sent me an email with some suggestions. I will go over it and then post back here a BOM (and a Sketchup file if I have time).

If anyone has any questions please let me know - steven at makerstore.com.au

neksmerj
29th October 2014, 07:39 PM
Hi Steven from Maker Store. Well you just never know who looks at this forum, your input will be most welcome.

Looks like your store has some fantastic bits and pieces, especially for the hobbyist.

Please suggest which Audino board and shields would be suitable to drive a Nema 17 stepper motor from a 12v battery for field use.

Ken

Blahhh
29th October 2014, 07:42 PM
Hi,

As promised:


Part

SKU
Qty
Cost
Subtotal
Notes


V-Slot 2040
LR-2040-S-1500
1
$24.15
$24.15



V-Slot Actuator End Mount
PLATE-ACTUATOR
2
$12.00
$24.00



GT2 (2mm) Aluminum Timing Pulley 20
BELT-GT2-TP20
1
$9.85
$9.85



Smooth Idler Pulley Kit
WHEEL-PULLEY-KIT
1
$6.05
$6.05



GT2 (2mm) Timing Belt (per meter)
BELT-GT2-1M
3
$9.60
$28.80



Belt Crimp Clamp
BELT-CLAMP
2
$2.15
$4.30



M5 Low Profile Screws - 6mm
SCREWS-M5-LP-6
1
$5.50
$5.50
Pack of 25


Slide In Tee Nuts (25 Pack)
HARD-SI-TNUT-PACK25
1
$5.49
$5.49
Pack of 25


Mini V Plate
PLATE-MINIV
1
$14.55
$14.55



Mini V Wheel Kit
WHEEL-MINIV-KIT
4
$4.40
$17.60



NEMA 17 Stepper

1
$20.00
$20.00
Special Order


M3 Socket Screws

4
$4.00
$16.00
Special Order






$176.29





329476

There are another couple of way to do it (and bring down the cost), but the above is the most elegant.

I will post more about this on the store blog tomorrow along with the Sketchup files.

There is a lot more stock arriving soon, so if there is enough interest I can put a kit together and work on a better price.

Cheers,
Steve

neksmerj
29th October 2014, 10:14 PM
Thanks Steve for your input.

All that's left is controlling the stepper motor, do you get involved with that side of things?

I'm beginning to think that using a stepper motor, is not the way to go. Apparently they pull more than 1 amp, even when at rest.

This may flatten a 12v battery pretty quickly.

Ken

KBs PensNmore
29th October 2014, 10:25 PM
Hi Ken, someone the CNC forum may help with details on power requirements.
Kryn

neksmerj
30th October 2014, 02:12 PM
I've put a thread over on the cnc machinery forum since this project has become more and more sophisticated now involving digital electronics.

If a moderator wants to swing the entire post over to the cnc machinery forum, please do so, but I prefer it here where my friends are.

The mass of the camera will be up to 2kg with a variable travel speed range of 1mm per sec to 20mm per sec.

Ken

Master Splinter
3rd November 2014, 05:54 PM
It seems that no matter what you want to do, someone's already done it....

http://www.youtube.com/watch?v=SyE8_X951eI&list=PLZqh4Qx3PPHl5EkKxxRIxJ1Ahcs9Si39d

neksmerj
3rd November 2014, 09:41 PM
MS, your suggestion is far too complicated for me, trust a woodie to find something like this, +- 20mm, "that's close enough".

I've managed to find an Australia distributor for the Arduino uno R3 board and the Adafruit stepper motor shield.

Core Electronics in NSW https://www.facebook.com/CoreElectronics

There's a heap of Chinese knockoffs on eBay, such a pity.

I've still had no interest in my project in the Computer forum or the CNC machinery forum. I have plenty of patience.

Ken

pippin88
3rd November 2014, 09:50 PM
Ken,

The arduino official forums are full of helpful people.

What you want to achieve has been done many times before and google should turn up some tutorials I'd say.

Arduino is an open source project. I'm glad I can get a microcontroller for $5 shipped (pro mini). It makes for great projects.

snowyskiesau
3rd November 2014, 10:11 PM
Nothing wrong with the Chinese Arduinos. I have several ranging from Uno to Due.
Don't forget that the design is open source so anyone can make them.

If all you need to do is control a stepper, then a Pro mini as mentioned by pippin88 may be enough. I have several from Anarduino (http://www.anarduino.com/mini/) in the US,

pippin88
3rd November 2014, 10:22 PM
Geoff, thanks for the anarduino link. Pretty cheap, and good shipping. Will keep them in mind if I need a wireless project.

neksmerj
3rd November 2014, 11:21 PM
Pippin88 and Snowyskiesau, very interesting re the Arduino pro mini. Have either of you gentlemen used the mini to drive a stepper motor?

I have just ordered a nema 17 stepper .4A per phase, 200 steps bipolar. This is motor I would like to drive using a 12v battery.

Ken

snowyskiesau
3rd November 2014, 11:30 PM
I've a 3D printer that is Arduino based and uses steppers but hardware and software designed by someone else.

I did come across this article (http://www.photocs.net/arduino-stepper-code-basic) about stop motion with an Arduino. It's a tutorial on the code and how it all works, might be a good place to start.
For a complete slider controller solution, there's this one http://www.minie.airiclenz.com/about-the-miniengine/

neksmerj
4th November 2014, 12:04 AM
Thanks SS, that looks like a great article, something to do tomorrow instead of wasting money trying to pick the Melbourne Cup winner.

May I ask what on earth can you make with a 3D printer that's actually useful?

Most of the stuff I've seen looks like a pile of pixelated plastic that would break easily.

Ken

epineh
4th November 2014, 09:10 PM
Let me add my 2c, firstly regarding printed parts, attached are a couple of photos showing bearing mounts that I drew up and a mate printed for me with his printer, funnily enough for my 3D printer build, pretty sweet, just tap the bearing in, which is quite a tight fit, and bolt it in to the machine, what more could you ask for ?

As for the slider (which a 3D printer could make a lot of parts for by the way) I can see two options that I would pursue, either use a simple pulse generator, something like this : http://www.ebay.com/itm/181096913621

This could be mounted into some sort of enclosure (possibly 3d printed...sorry couldn't resist) and connect the output to a standard stepper drive, like a Gecko G251. Pro's would be simplicity and cost, Con's would be control, or lack of, speed would be adjusted by eye, which may be good enough for your needs, or maybe not.

Or...

Use some kind of Arduino, PIC, or any of the million other flavours of microcontroller to provide more intelligent control to provide the pulses to the stepper driver (again I would stick with a G251) Pro's would be exact control, still not too epensive in the scheme of things, Con's would be you need to program the thing, or con somebody else into doing it for you.

Another option that might be the simplest is to use a DC motor and a PWM generator ( I m sure somebody has already mentioned this in one of the threads) simply geared down and speed control by turning a volume type knob. the ebay Pulse generator I already linked would work for this. Again the thing needs to be adapted by somebody.

Good luck.

Russell.

neksmerj
4th November 2014, 10:36 PM
Thanks epineh for the link to the 555 timer module. Couldn't go wrong for that price.

Funnily enough today I spent researching circuits involving the 555 timer and a decade counter to drive a stepper motor. Google turned up many simple circuits.

Certainly looks like a viable way to go without the hassle of programming.

I chose the Arduino and Adafruit combination simply because it looked really cute, and if I could get a handle on the programming, I could use it for something else when my son looses interest in the camera slider.

Out of interest, how long did it take to print the bearing blocks? How does that compare time wise to turning them and milling the holes?

Ken

epineh
4th November 2014, 11:42 PM
The basis of this project has actually surfaced a few times in different guises, positioning fence for a router table, or circular saw... hard stop for a guillotine, sawmill travel and so on, basically all needing to move one axis to a certain position accurately and with minimal hardware.

It is on my to do l list, but I need some other projects finished first, same old story, lol.

From memory I think the blocks took about 15-20 minutes each to print, I was a bit sceptical about printers myself until I saw what my mate was doing, and I can see a lot of other uses for one, which is why I am building one for myself. First project will be to make custom encoder mounts for my milling machine servo's, basically otherwise I would need a chunk of 80mm aluminium turned down, and mounting holes drilled, amongst other things, I would guess at least a days work for somebody who knows their stuff and has a lathe to make three mounts, I don't have a lathe nor do I know much about using one, lol.

Also the printer does the work, I am free to drink coffee, beer have a nap etc :)

Cheers.

Russell.

snowyskiesau
8th November 2014, 09:23 PM
I'm working on something other than a camera slider but here's some bits and pieces that could be used for one.

Shown is an Arduino Mega (http://www.ebay.com.au/itm/ATmega2560-16AU-Board-Free-USB-Cable-ARDUINOs-IDE-MEGA-2560-A070-/161174603305?pt=AU_B_I_Electrical_Test_Equipment&hash=item2586c14629) which is compatible with but more powerful that the Uno.
With it is a stepper motor controller (http://3dtek.xyz/products/grbl-compatible-cnc-controller?variant=820642131) I've just assembled. It's shown with 2 stepper drivers (http://3dtek.xyz/products/stepper-driver-board) ( the small white boards) but can take 4 drivers if required. These particular drivers can handle a steady 1.5 Amps with a peak of up to 2.2 Amps if a suitable heatsink/fan is used.

I've also thrown in an image of a piece of Makerslide with a carriage fitted. This particular bit is 1 metre long but you can get it in lengths of up to 2,8 metres.

Total cost for the electronics is around $42. Makerslide is ~$25 per metre , add another $15 for the carriage and wheels.

neksmerj
8th November 2014, 10:29 PM
Hi Snowy,

I'll follow your project with great interest. What are you working on?

Have you got a handle on programming the Arduino, I'm struggling to get past first base.

It's all double dutch to me, probably have more luck deciphering Egyption hieroglyphics .

Ken

snowyskiesau
8th November 2014, 10:45 PM
It's for a small CNC router called the Shapeoko (http://www.shapeoko.com/).
Rather than buy the bits, i thought I'd make as much as I can.
Next task is to route out the metal plates on the CNC router at the local hackerspace (https://hobarthackerspace.org.au/).
I already have the Makerslide and the various belts and pulleys, nuts, bolts etc.

neksmerj
11th November 2014, 08:03 PM
A few days ago, I ordered an Arduino compatible uno R3 board from Core Electronics, and it turned up this morning. Wow, that was almost as quick as going to the shop.

My godfather, I had no idea they were so small, you almost need a magnifying glass to see some of the components.

The genuine article cost around the $25-30 mark, I paid half of that. The quality appears excellent.

There is an excellent Arduino tutorial that walks you thru many basic examples getting more complex as you go.

I've just run the example "blink" to test out the board, and all seems fine.

It took a little while to install the Arduino software and locate the drivers, about 20 minutes.

Reckon I'm gunna have some fun if I can interpret the sketches (programs)

Ken

neksmerj
28th December 2014, 02:13 PM
For those of you champing at the bit wondering how my camera slider project is progressing, it's not. No, that's not quite true.

As an update I have an Arduino compatible uno R3 board, an Easy Driver board, a mini breadboard and a bunch of leads, leds, etc and a nema17 stepper motor.

The Easy Driver board was dream't up in collaboration with Brian Schmalz, and it's Brian to thank for the stepper motor sketch No.5 here.
http://www.schmalzhaus.com/EasyDriver/Examples/EasyDriverExamples.html

Basically it's a sketch to drive a stepper motor forward with stop and reverse, plus speed. It's all there except for one thing, limit switches.

What I'm attempting to make is basically a linear actuator, stepper driven with a timing belt. At each end of the aluminium track will be a limit switch, and herein lies my problem.

As soon as the carriage hits the limit switch, the motor is instructed to stop, and whilst it's sitting on the limit switch arm, the motor can't be reversed.

If anyone can solve this problem with Arduino code, beers will be involved.

I've had a lot of help from Brian Schmalz, but currently he is on leave and I dare not interrupt his lying on the beach, pina colada's in hand.

Sadly I've had little joy from the Electronics forum and the CNC forum.

All the smart fellas seem to be here, except me!

Ken

snowyskiesau
28th December 2014, 04:10 PM
How are you implementing limit switches? The sketch you linked to doesn't mention them.
In CNC code it's common to sense the limit switch and then reverse the motor until the switch opens and that's the home position.

neksmerj
28th December 2014, 04:48 PM
Hi Snowyskyiesau,

Correct, there are no limit switches in tutorial No.5 that I linked to.

Snowy, I was thinking along the same lines as you, ie, hit the limit switch, then back off a tad and stop. I don't know how to code this.

If you have time, I'd appreciate you having a look at tutorial No.5, maybe print it out, and describe what lines of code you'd pop in there to do the above.

This is doing my head in, and I thought having an Arduino would be fun.

I haven't actually wired all this up yet, that's my next step.

I did read somewhere that hitting the Arduino reset button overcomes the problem of the closed limit switch. Can't see it myself.

Ken

edit

Here is an explanation from Brian Schmalz on how the button sequence works, in particular "stop"

I'm assuming you're referring to the Example 5 code from this page: http://www.schmalzhaus.com/EasyDriver/Examples/EasyDriverExamples.html (http://www.schmalzhaus.com/EasyDriver/Examples/EasyDriverExamples.html)

Each time through the loop, we create a value called current_speed, which is sent into the setSpeed() call to set the new speed for the stepper motor. To make the motor stop, we simply set current_speed to zero. To calculate the value of current_speed, we read the analog input, scale it, then multiply it by the variable called sign. If sign is +1, then our current_speed will be in a forward direction. If sign is -1, then current_speed will be negative and will make the motor go in a reverse direction. But if sign is zero, then current_speed will always be zero, and that will stop the motor.

Does that help?

If all you want to do is have two (or more) switches actually stop your motor, this should be very simple to do. Simply add code to read the new switch inputs, and set sign = 0 any time any of them is pushed. That will stop the motor.

And a very merry Christmas to you too!

*Brian

Home www.schmalzhaus.com (http://www.schmalzhaus.com/)
Work www.logicpd.com (http://www.logicpd.com/)

Michael G
28th December 2014, 05:52 PM
The way I've done it for normal (DC) motors is have a limit switch that cuts the power when it hits the stop but bridge that with a diode so that reverse current can still run.
On reflection, probably doesn't help much with a stepper motor (but makes me feel that I have made a contribution :U)

Michael

RayG
28th December 2014, 08:27 PM
Hi Ken,

I had a quick look at the code you linked to, and can give you a push in the right direction... I think it should look something like this

digitalRead(x) returns the state of digital input x,



#define x_positive_limit 12 // whatever pin numbers you wire the switches to
#define x_negative_limit 13

// somewhere in setup add the input pin configuration.
pinMode(x_positive_limit, INPUT_PULLUP);
pinMode(x_negative_limit, INPUT_PULLUP);


// somewhere in the main loop... insert something like the following

if (Sign==+1)
{
// we are moving in positive direction
if (digitalRead(x_positive_limit)==LOW)
{
// whatever you want to happen at +limit
//
}
}
if (Sign==-1)
{
// we are moving in negative direction
if (digitalRead(x_positive_limit)==LOW)
{
// whatever you want to happen at -limit
//
}
}



Ray

neksmerj
28th December 2014, 10:01 PM
Hi Ray,

Thanks for your input, I sort of think I know what you are getting at, keeping in mind I know nothing about writing code.

What I want to happen is this......when the right limit switch is hit, stop the motor and ready it to go in the other direction when the left direction button is pressed,
and similarly, when the left limit switch is hit, stop the motor and ready it to go in the opposite direction when the right button is pressed.

Does this make sense?

Dill bury Ken

RayG
28th December 2014, 11:01 PM
Hi Ken,

Try this... I've padded it out with the housekeeping and run loop.




// Ken's camera slider
//

#include <AccelStepper.h>

// Define a stepper and the pins it will use
AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5

#define x_positive_limit 6 // change to whatever pin numbers you wire the switches to
#define x_negative_limit 7
#define left_button 8
#define right_button 9



void setup()
{
// Change these to suit your stepper if you want
stepper.setMaxSpeed(100);
stepper.setAcceleration(20);
stepper.setSpeed(10);
Sign=+1;
//
pinMode(x_positive_limit, INPUT_PULLUP);
pinMode(x_negative_limit, INPUT_PULLUP);
pinMode(left_button, INPUT_PULLUP);
pinMode(right_button, INPUT_PULLUP);
}

// start up at slowish constant speed in +ve direction, until it hits a limit switch. If it's already at the limit switch, it will just
// wait for button press.

void loop()
{

if (Sign==+1)
{
// we are moving in positive direction
if (digitalRead(x_positive_limit)==LOW)
{
Sign=0;
// whatever you want to happen at +limit
while (digitalRead(right_button==HIGH)
{
// Wait here for right button after hitting +ve limit switch
// right hand button makes servo move right to left (-ve)
}
stepper.setSpeed(30); // speed for travel in -ve direction
Sign=-1;
}
}
if (Sign==-1)
{
// we are moving in negative direction
if (digitalRead(x_positive_limit)==LOW)
{
Sign=0;
// whatever you want to happen at -limit
while (digitalRead(left_button==HIGH)
{
// Wait here for left button after hitting -ve limit switch
// left hand button makes servo move left to right (+ve)
}
stepper.setSpeed(40); // speed for travel in +ve direction
Sign=+1;
}
}
stepper.runSpeed();
}



Ray

neksmerj
29th December 2014, 01:11 PM
Ray, I'm sure there will be a lot of us, me included, who are unfamiliar with code for the Arduino.

Is there any chance you could describe your code and what it does, line by line, in plain English for us dills.

May I ask what you use your Arduino board for? CNCing?

It seems these little bundles of joy can do anything, only limited by one's imagination.

Ken

RayG
29th December 2014, 08:20 PM
Hi Ken,

I don't use arduino stuff at all... but it's just c programming, which is what I do with embedded systems.

Have a search on-line for c programming tutorials, there are lots to choose from. For CNC I use linux emc2.

Ray

neksmerj
29th December 2014, 09:30 PM
Thanks Ray, I had hoped you were into the Arduino, never mind.

Learning a new language at my age would prove difficult, I have enough trouble just trying to learn all about my iPhone.

Is C++ similar to C?

Ken

RayG
29th December 2014, 09:36 PM
Is C++ similar to C?

Ken

No, just stick with C.

I have done arduino type programming, but not all that seriously.

Ray

nine fingers
30th December 2014, 08:47 AM
Ken, See reply woodworking-CNC machines. NF.

PDW
30th December 2014, 10:56 AM
Thanks Ray, I had hoped you were into the Arduino, never mind.

Learning a new language at my age would prove difficult, I have enough trouble just trying to learn all about my iPhone.

Is C++ similar to C?

Ken

C++ is enhanced C. Java is enhanced C++. C# is Microsoft's dummy-spit response to losing a court case against their bastardisation of Java.

All one big incestuous family really.....

That code is pretty simple and highly readable as-is. I'm not trying to be a smarty but you really need to understand it, or get someone else to do all the programming for you and just accept the end result. I realise that I say this from the POV of nearly 40 years programming, but still - I've found that with software, you either spend the time to learn, or not. You can't half-do it. This is why I've never gotten around to learning Solidworks or similar - time investment is too great for my needs.

PDW

soundman
30th December 2014, 01:21 PM
On the matter of limits switches.
depending on the design of the transport and control system they may not be required.

Many printer mechanisms, do not have limit switches.

When the machine initilaises, it drives to one of the stops......as long as the motor and the carrage will stand being driven into the stop.....it will be fine.
the control system then registers the stop as zero and drives in relation to that....counting steps or character spaces from there.

If you are running a stepper motor drive that is only a variable speed drive and has no step counting this will not work.


Another thaught is.....if this is a simple camera track that only travels a single pass at the nominated speed.......things may be different.

you may only need stops or limit switches to prevent overdrive......so no particular smarts are required.

In fact.....the whole thing could be way simpler.

All that is needed is a gear motor and a PWM motor controller..or maybe even a voltage regulator.

No micro, no processing and no programming required.



I find it fascinating that the current generation of designers look to microprocessors and 3d printers before they look at simple straight forward engineering.

I know that there is a lot that can be done with these cheap micros and 3d printers are a great thing.

but all this sort of thing has been done in the past with very simple old school methods.

cheers

DSEL74
30th December 2014, 02:26 PM
I haven't read through the full thread so my appologise if this has already been covered. But those types of aluminium extrusions are used extensively in the exhibition industry. You will be able to get 6m lengths if required.

One of the brands is Octonorm and is represented here, places like Expohire use it etc.

http://www.octanorm.com.au/Pages/Products/ProductBrowser2.aspx?dep=VMS

grunto
30th December 2014, 03:32 PM
Ken,

I have replied to your thread on the CNC page. I have now read through the thread here and I think what you are trying to do is not too hard with either the Adafruit Motor Shield or the Easy Driver board - this assumes I understand what you are trying to do.

1. Drive the stepper in a given direction. Continue to do so until you detect the limit switch changing state (i.e going from open to closed).

2. Change the direction of the stepper motor (via the Adafruit library in you are using their motor shield) and step a given number of steps to back off from the limit switch (or alternatively back off until the limit changes state?).

I have done a lot of Arduino stuff although I tend to use the Arduino to prototype a system and then build a board to that has all the necessary components (i.e the micro and all the interface circuitry).

An Arduino Pro Mini is basically a minimal Arduino Uno (i.e doesn't have the USB/Serial interface on the board and uses a SMT micro which actually has more I/O than the DIL micro on the Uno). Once your work out how to get connect the separate USB/Serial interface (which only cost about $5) you will find the Pro Mini a great way to go (and they can be had for under $3).

Grant