Offline
Newbie
Karma: 0
Posts: 8
|
 |
« on: September 04, 2012, 04:16:31 am » |
Hey all, I have what is easily described as a lazy Suzan that is driven direct by a stepper motor. Now I have the stepper running just fine, simple code moving 18 deg (10 steps) waiting 10 second and going again ad infinitum. Now when audrino powere off for the night the stepper loses hold. Keeping hold on at all times not an option. When I start again the next day I would like to be able to use either an optical sensor or hall effect, to find exact zero ( start position) buy rotating " lazy Suzan" until the sensor trips. What would be the best sensor to use, how would it be best to program? Can "until" statements be used? Any who thanks all for any help, suggestions, criticisms ect Ps the project is an automatic case annealer for rifle brass aka http://www.bench-source.com/id81.html
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #1 on: September 04, 2012, 04:39:57 am » |
C doesn't have an "until", but it does have a "while"
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Offline
Sr. Member
Karma: 0
Posts: 427
"In this house, we obey the Laws of Thermodynamics" Homer J. Simpson
|
 |
« Reply #2 on: September 04, 2012, 05:43:12 am » |
That looks like a very neat bit of kit. As mentioned C has a "while" construct so you can just keep stepping the motor slowly while the device is not at the start position. Do you need to do this though, can you not just start the machine from a random position? I am imagining the machine rotates the cartridges continuously through the flames, but perhaps it stops them in the flames hence you need to locate them.
Would a cam operating a microswitch be accurate enough for you. The machine holds ten cartridges so you could have a cam with ten "highs" mounted on the shaft to operate a single fixed microswitch. This would mean the machine would start at the next cartridge. With two switches you could step fast till the first is triggered then more slowly till the second is hit.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #3 on: September 04, 2012, 05:46:09 am » |
If you intend using a magnet/Hall effect switch, and the device is running hot, you may need to pay attention to the Curie point of the magnet
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Seattle, WA USA
Online
Brattain Member
Karma: 314
Posts: 35518
Seattle, WA USA
|
 |
« Reply #4 on: September 04, 2012, 05:51:14 am » |
Why not just use some kind of physical limit switch to define HOME. On start up, rotate the device until the limit switch is triggered. Then, you are home.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« Reply #5 on: September 04, 2012, 06:20:25 am » |
Radman; the turntable stops at the station so the case can be rotated within the holl it's sitting in so must be able to stop on target.
PaulS; a micro switch with a small dimple in line with home would work nicely but it can't trigger early and if you get over run then what? Could be fixed With radmans 2 switch and single stepp till the next is triggered.
Have some thinking to do.... Lol keep any more ideas comming!
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Online
Brattain Member
Karma: 314
Posts: 35518
Seattle, WA USA
|
 |
« Reply #6 on: September 04, 2012, 06:22:33 am » |
PaulS; a micro switch with a small dimple in line with home would work nicely but it can't trigger early and if you get over run then what? I'm not sure I see the problem. Read the switch. If it isn't pressed, you aren't home. Step once. Read the switch. Repeat until you are home.
|
|
|
|
|
Logged
|
|
|
|
|
Norfolk UK
Offline
Edison Member
Karma: 23
Posts: 1320
|
 |
« Reply #7 on: September 04, 2012, 06:32:40 am » |
If you use some form of microswitch/beam break that detects an inserted cartridge then a simple do rotate till cartridge delay loop will only stop at positions that have cartridges in so no delay heating fresh air.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 0
Posts: 427
"In this house, we obey the Laws of Thermodynamics" Homer J. Simpson
|
 |
« Reply #8 on: September 04, 2012, 07:13:17 am » |
I'm not sure I see the problem. There is 36deg between cartridges. If the stepper is stepped slowly it will take a while to increment round. On the other hand if the stepper is stepped quickly then the inertia of the lazy Suzan may cause it to make the motor slip if you try to come to a dead stop. The Suzan does not look very massive so a lot depends on the strength of the motor. However in my (limited) experience of stepper motors they behave in a very reproducable way. The code could accelerate the rotation up to a maximum then decelerate down when a microswitch triggers and I bet you you would hit the spot every time - at least to the mechanical accuracy of when the switch triggers. My first idea of two switches may be overkill. the turntable stops at the station so the case can be rotated - neat, I understand how it works now.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 5
Posts: 387
|
 |
« Reply #9 on: September 04, 2012, 08:13:56 am » |
Maybe overkill, but I`m thinking optical encoder strip or wheel from an old printer. Or make your own...
|
|
|
|
|
Logged
|
|
|
|
|
South Texas
Offline
God Member
Karma: 8
Posts: 976
|
 |
« Reply #10 on: September 04, 2012, 10:43:49 am » |
2 switches. Step at high speed until the first one breaks, and then step slowly to the second.
1 switch with a large target. Step rapidly until the switch breaks, reverse slow until the switch makes, and then forward again slow until the switch breaks.
|
|
|
|
|
Logged
|
|
|
|
|
|