Offline
Edison Member
Karma: 4
Posts: 1126
If you're not living on the Edge, you're taking up too much space!
|
 |
« on: January 27, 2012, 01:26:47 pm » |
Here is a brief summary of the code. It can spin a full size DSLR on it's shaft without bearings at 30RPM! Ramping up and slowing down to prevent bouncing. It can measure torque to detect an abnormal load or error. It works without blocking or waiting or interrupts. Enhanced performance using 12v without warming up the motor. And much more! Sounds like an advert, but it's all for Free. Hardware is $4.
Variables: bcw 1 is clockwise 0 is ccw deg100 9000 is 90 deg rpm100 1000 is 10 rpm, 100 is sec hand rph100 hour 100 is like minute hand on clock percslow 10 is 10% slow at end of move steppos 90.0*STEPERDEG is 90 deg steps same xinrev 0,2,3,4,8x in 360 deg revo # revolutions const float STEPERDEG=float(64)*64/360;
These are ordered just like in the code: void unramp (boolean bcw, long deg100, int rpm100, int percslow) void unramp1 faster void moveto (int steppos) void movetodir (boolean bcw, int steppos)
void midspeedcool_12v (boolean bcw, long steps) void ramp (boolean bcw, int rpm100) void revRestart (boolean bcw, long revo, int rpm100, int xinrev) void rev (boolean bcw, long revo)
void degrpmslowCool4 (boolean bcw, long deg100, int rph100) void degrpmslowCool4_nowait int calloften() void degrpm_nowait (boolean bcw, long deg100, int rpm100) int calloften_micro (boolean bcw)
void degrpmslowCool (boolean bcw, long deg100, int rph100) void degrpmslowHot void degrpmslow2
void degrpmEZ (boolean bcw, long deg100, int rpm100) void degrpm void degrpm8 void move (boolean bcw)
1 line description for each function above: unramp stops bounce at end of move unramp1 faster absolute position in degrees shortest direction absolute choose direction
12v only 1/2 speed speed up over 90 deg restarts x in 360 rev obsolete?
most efficient mAh slow no wait fast no wait look at d in loop
cool 4 step hot 4 step mid 4 step
8 step 5 lines simple fast ramp, measure torque 8 step 5 lines +err 2.00deg move delay(10) microstep speed limit 17RPM relative move 1 step
ccwss() measures torque and halts program if spike to prevent damage just hook motor winding to analog pin 0
|
|
|
|
|
Logged
|
If you fall... I'll be there for you! -Floor
Skype Brighteyes3333 (262) 696-9619
|
|
|
|
0
Online
Tesla Member
Karma: 50
Posts: 6531
Arduino rocks
|
 |
« Reply #1 on: January 27, 2012, 01:29:22 pm » |
So what is your question?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 4
Posts: 1126
If you're not living on the Edge, you're taking up too much space!
|
 |
« Reply #2 on: January 27, 2012, 01:46:30 pm » |
Does anyone want this? Will you test it more? How about a single function to detect extra torque and slow down keeping speed to a maximum without stalling? If I was purely offering it for others I should put it in a different category?
|
|
|
|
|
Logged
|
If you fall... I'll be there for you! -Floor
Skype Brighteyes3333 (262) 696-9619
|
|
|
|
0
Online
Tesla Member
Karma: 50
Posts: 6531
Arduino rocks
|
 |
« Reply #3 on: January 27, 2012, 01:59:37 pm » |
Does anyone want this? Will you test it more? How about a single function to detect extra torque and slow down keeping speed to a maximum without stalling? If I was purely offering it for others I should put it in a different category?
You have provided no more than a series of vague statements. Nothing there to test. 
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 4
Posts: 1126
If you're not living on the Edge, you're taking up too much space!
|
 |
« Reply #4 on: January 27, 2012, 02:16:19 pm » |
Well of course. I'm working on some new functions and testing myself. I wasn't sure if anyone was interested. I've posted most of the code before, but here are a few enhancements. I wanted to organize it (above) so it's easier to understand without looking inside the functions themselves. There is no need to unless you're curious like me. There are only 1 or 2 global variables you might need, and no additional functions to call to setup. Can you think of any additional functionality I've missed?
|
|
|
|
|
Logged
|
If you fall... I'll be there for you! -Floor
Skype Brighteyes3333 (262) 696-9619
|
|
|
|
Belgium
Offline
Full Member
Karma: 0
Posts: 219
|
 |
« Reply #5 on: January 28, 2012, 06:42:04 am » |
I'm interested in this, I have 2 of these little motors. Can't believe they have enough power to spin a DSLR. Please make a video of it 
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 4
Posts: 1126
If you're not living on the Edge, you're taking up too much space!
|
 |
« Reply #6 on: January 28, 2012, 08:58:27 pm » |
Please test it and tell me what you think? You can spin something as heavy! Just uncomment some of my lines in loop().
|
|
|
|
|
Logged
|
If you fall... I'll be there for you! -Floor
Skype Brighteyes3333 (262) 696-9619
|
|
|
|
Offline
Edison Member
Karma: 4
Posts: 1126
If you're not living on the Edge, you're taking up too much space!
|
 |
« Reply #7 on: January 30, 2012, 12:02:54 pm » |
Did anyone try it yet?
|
|
|
|
|
Logged
|
If you fall... I'll be there for you! -Floor
Skype Brighteyes3333 (262) 696-9619
|
|
|
|
Belgium
Offline
Full Member
Karma: 0
Posts: 219
|
 |
« Reply #8 on: January 30, 2012, 01:08:30 pm » |
Could please post an example sketch using the code # button? I can't figure out the code in the first post.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 4
Posts: 1126
If you're not living on the Edge, you're taking up too much space!
|
 |
« Reply #9 on: January 30, 2012, 01:24:16 pm » |
Download the zip file (attached above). It's not a library yet. Compile the entire file in IDE. Uncomment one of the lines in loop() to test it with your motor.
|
|
|
|
|
Logged
|
If you fall... I'll be there for you! -Floor
Skype Brighteyes3333 (262) 696-9619
|
|
|
|
Denmark
Offline
God Member
Karma: 19
Posts: 671
|
 |
« Reply #10 on: January 30, 2012, 01:45:14 pm » |
Hi Sbright
I have tried it, works very well so far. This is good work, there is often questions about this motor in the forum. And once again i am surprised how smooth this motor runs. And for the torgue, I cant hold it with my fingers.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 4
Posts: 1126
If you're not living on the Edge, you're taking up too much space!
|
 |
« Reply #11 on: January 30, 2012, 02:01:32 pm » |
Finally some feedback! Thank you. I tried to make it simple. The 4 nowait functions might confuse someone. All the functions are calibrated to be accurate according to RPM. The torque is inverse to the RPM past the startup speed. At slow speeds the Hot functions have more torque than the cold ones, especially with a 5v supply. This is at the expense of power consumption. Please ask if you want to know why I did something in the code. Did you try the halt when there's too much load subroutine? You can change it to print the load instead. Did you see you can turn 1.00 deg 360x and it works! Or 1.50 deg 240x. 3.00 deg 30x is 90. Without microstepping. You get the picture.
You can easily remove the floats to make the code size much smaller. You only lose movedeg and err functionality. Only the functions that you use are included in the executable. Some of my sketches are 1.2K in size. I think this will work on ATTINY85 with a few changes.
I was thinking of adding sleep between steps when you're going slow. Anyone want it?
|
|
|
|
« Last Edit: January 30, 2012, 02:27:03 pm by sbright33 »
|
Logged
|
If you fall... I'll be there for you! -Floor
Skype Brighteyes3333 (262) 696-9619
|
|
|
|
Belgium
Offline
Full Member
Karma: 0
Posts: 219
|
 |
« Reply #12 on: January 30, 2012, 02:48:47 pm » |
I just tried it out, had not seen that you posted the .pde file  It does work very well. I've thought about buying a cheap tripod and add a stepper motor to it to make 360 pano's. Might be possible with this little motor? That's quite a bit of code you have written, hats off to you!
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 4
Posts: 1126
If you're not living on the Edge, you're taking up too much space!
|
 |
« Reply #13 on: January 30, 2012, 04:33:05 pm » |
http://www.amazon.com/gp/product/B0000AUR21/ref=cm_cr_mts_prod_imgThis is much better in the real world with big lenses making a GigaPan, it's sturdy. I wrote a simple library for it. You just need a screwdriver to modify it. I removed the internal stops and made a simple one on the outside. You could design a bearing to use with our tiny motors. But I just mounted my T2i on the shaft! Made a wooden base for the motor. It works fine so long as you have a level table or rock to set it on. The Bescor goes 7deg/sec max. Our stepper 30RPM which works out to 180deg/sec or 25x as fast. Too fast to stop blur with a 200mm lens spinning on it. That's why I wrote unramp() to stop and start. With the Bescor I can take a panorama or Gigapan without stopping @300mm. With the stepper I can capture 360 deg in 2 seconds. I've been making endless panoramas, they just keep going and going, round and round... Faster than this, 1/8th the price: http://gigapan.org/cms/shop/epic-pro
|
|
|
|
|
Logged
|
If you fall... I'll be there for you! -Floor
Skype Brighteyes3333 (262) 696-9619
|
|
|
|
Belgium
Offline
Full Member
Karma: 0
Posts: 219
|
 |
« Reply #14 on: January 30, 2012, 04:43:49 pm » |
Haha, many times I have almost ordered a Gigapan. But the local camera shop over here wants 1000€ for the pro version. Which I need for my Nikon D300/700. Never heard of the Bescor, looks like a nice cheap solution. It's on my wanted list, thanks for the info.
|
|
|
|
|
Logged
|
|
|
|
|
|