Go Down

Topic: New 28BYJ-48 library (Read 17 times) previous topic - next topic

sbright33

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
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

zoomkat

So what is your question?
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

sbright33

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?
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

zoomkat


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.  :smiley-roll:
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

sbright33

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?
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Go Up