Thanks: 0
Likes: 0
Needs Pictures: 0
Picture(s) thanks: 0
Results 1 to 7 of 7
Thread: Arduino uno R3 etc
-
1st November 2014, 09:46 PM #1Product designer retired
- Join Date
- Nov 2006
- Location
- Heidelberg, Victoria
- Age
- 79
- Posts
- 2,251
Arduino uno R3 etc
Looks like I'm getting nowhere with my camera slider project, so I'll try another approach.
I wish to utilise an Ardinuo uno R3 board in conjunction with an Adafruit stepper motor shield.
Any members have experience in this field?
Ken
-
1st November 2014 09:46 PM # ADSGoogle Adsense Advertisement
- Join Date
- Always
- Location
- Advertising world
- Age
- 2010
- Posts
- Many
-
4th November 2014, 09:58 PM #2
I would suggest searching Google and You tube, I am doing a similar project for mounting my camera to do focus stacking macro shots. There was heaps of info out there. You need to be looking in the Arduino forums for the answers as most cnc machines use a full size PC.
https://www.google.com.au/?gws_rd=ss...+camera+slider
here is one of them that I just found and like
https://www.inventables.com/projects...r#instructions
Regards
Warrick
-
5th November 2014, 12:16 PM #3Senior Member
- Join Date
- Nov 2008
- Location
- somewhere
- Posts
- 152
have you looked at:
https://learn.adafruit.com/adafruit-...stepper-motors
personally I'd just plug it together and try and get the stepper turning. once you've it turning in the directions you want, it should be pretty simple from there.
-
30th December 2014, 12:52 AM #4Product designer retired
- Join Date
- Nov 2006
- Location
- Heidelberg, Victoria
- Age
- 79
- Posts
- 2,251
Limit switch problem
To reiterate, I'm attempting to make a camera slider (one axis of a cnc machine) so to speak.
Basically a linear track with a carriage, belt driven with a stepper motor. At each end of the track will be a limit switch.
I have all the Arduino code sorted except for a problem with the limit switches.
Basically when the carriage hits the limit switch, the motor stops and I can't think how to code the motor to go in reverse whilst the limit switch is depressed.
How do you fellas overcome this problem?
I'm thinking along the lines of when the limit switch is depressed, have the Arduino stop the motor, then back off a tad off the limit switch, then stop until the reverse button is pressed.
I'm scratching my head over this and would appreciate some Arduino code help.
Ken
-
30th December 2014, 07:42 AM #5
Hi Ken,
Without seeing your code it's a little difficult to exactly help but here goes anyway.
You will have a few inputs to the Arduino (limit switch left, limit switch right, reversing switch) and a control output (motor).
The Arduino typically continuously polls, so a pseudo code suggestion is:
void loop(void) {
int switch = /* read switch state - 1 = move right; -1= move left; 0 = stop */*/
int limit_right = /* read limit switch right */
int limit_left = /* read limit switch left */
If (( switch == 1 )&&( ! limit_right )) {
/* motor move to right */
} else if (( switch == -1 )&&( ! limit_left )) {
/* motor move to left */
} else {
/* stop motor */
}
}
-son of nine fingers
-
30th December 2014, 02:49 PM #6Senior Member
- Join Date
- Dec 2007
- Location
- Melbourne
- Posts
- 105
Ken,
Generally the Stepper Shields have a direction pin that selects whether the stepper rotates CW or CCW. If it is the Adafruit Motor Shield that uses the TB6612FNG chip then this will be the case. It is then just a matter of using the Adafruit library to drive the stepper in a particular direction. The limit switch input could then be used to toggle the direction. I don't live too far away - happy to drop over and take a look if you wish.
Grant
-
30th December 2014, 04:40 PM #7Product designer retired
- Join Date
- Nov 2006
- Location
- Heidelberg, Victoria
- Age
- 79
- Posts
- 2,251
Using Easy Driver Board
Hi Grant,
I'm almost there with this project, but sometimes I wonder whether it would have been easier to just wire it up the old fashioned way, not as cool though.
Brief description of operation
Using an Arduino board, control a stepper motor to belt drive a carriage along a linear track until it hits the end stop limit switch. Motor stops and awaits reverse push button.
Reverse the motor until it hits the other end. Speed is controllable.
I'm going to use the Easy Driver Board, designed by Brian Schmalz, and use his excellent code, example 5. I have the Adafruit stepper motor board as well just to cover all bases. Can't help buying stuff.
http://www.schmalzhaus.com/EasyDrive...rExamples.html
I've read many examples of code for stepper motors and find Brian's very easy to follow. In addition to his example, I'm adding two limit switches, one at each end of the track.
I think the nicest track is supplied by OpenBuilds http://openbuildspartstore.com/ They seem to have everything and not far away.
I've yet to mock this up, maybe this arvo.
Thanks for your offer to drop in, if I get stuck, I'll give you a yell.
Ken
ps, thanks NineFingers, wonder how you came up with that name? Don't ask?
Similar Threads
-
Remote control by Arduino
By pmcgee in forum WOODWORK - GENERALReplies: 2Last Post: 10th October 2014, 09:29 AM