Need Help! Drive a 1.8 degree stepper at 1 RPM - Page 3


Page 3 of 11 FirstFirst 123456 ... LastLast
Results 41 to 60 of 206

Thread: Drive a 1.8 degree stepper at 1 RPM

  1. #41
    Gold Member doorknob's Avatar
    Join Date
    Jan 2010
    Location
    USA
    Posts
    2141
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by ceefna View Post
    I have yet to source the drive thread, from that I can work out the pulse time but from a few calculations I have done I will need a pulse every 0.0001xxx ish seconds. I this possible? I mean to be so accurate.
    Generating an accurately-timed step pulse once every 100 us should not be difficult.



  2. #42
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2392
    Downloads
    0
    Uploads
    0

    Default

    I have much simpler Linistepper code in C, which will probably suit you better and be easier to modify and make accurate.

    There are a number of free PIC C compilers, my favorite would be MikroC which has a free version that will do up to 2k PIC ROm size (ideal for the Linistepper PIC).



  3. #43
    Registered
    Join Date
    Sep 2011
    Location
    uk
    Posts
    119
    Downloads
    0
    Uploads
    0

    Default

    Hi guys, first off I have taken the plunge and ordered a linistepper kit today. I think that will be the best way to make my project, 18 microsteps will be perfect.

    Romanlini, when you say "C" is that your harddrive? if so can I have a copy please?
    I will also check out MikroC and the Kitsrus programmers.

    Doorknob, I have uploaded a close up of the oscilloscope so you can see all the settings, it did also come with 2 10x probes.
    http://img33.imageshack.us/img33/999/dsc02420u.jpg

    Also is there an easier number to end up with for the stepper pulse i.e. a number that divides down the best or is any number easily achieved?
    I say this because the length of the arms I make denote the step pulse so what I am saying is will it be easier to make the mount to a particular step pulse as apposed to making a pulse to suit the mount?
    Hope that last bit made sense!

    Ceefna



  4. #44
    Registered
    Join Date
    Sep 2011
    Location
    uk
    Posts
    119
    Downloads
    0
    Uploads
    0

    Default

    RomanLini, just realised "C" means MikroC..........Duh

    You have got your work cut out with me!


    Ceefna



  5. #45
    Gold Member doorknob's Avatar
    Join Date
    Jan 2010
    Location
    USA
    Posts
    2141
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by ceefna View Post
    Doorknob, I have uploaded a close up of the oscilloscope so you can see all the settings, it did also come with 2 10x probes.
    http://img33.imageshack.us/img33/999/dsc02420u.jpg


    Based on the closeup photo, I'm confident that you will be able to do an adequate job using that scope. It would be nicer if the horizontal timebase control were to have one or two more clicks to it at the high-speed end of the range, and I don't see any obvious way to trigger a single sweep, but nevertheless I think that you'll do just fine with it.

    I will leave the preferred pulse length question to others, because I don't know what the available timing resolution of the PIC in the linistepper is, nor do I know what fractional percentage of timing error you are willing to tolerate. I suppose that you could try doing an upper and lower bound calculation or two to give you a range to work within.



  6. #46
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    24221
    Downloads
    0
    Uploads
    0

    Default

    'C' is a higher level language than assembler, many find C the easy way to go, I migrated from assembly language programming in the old Intel 8085 and on, so I am comfortable with it.
    Romans Linistepper .asm file is in assembler source code.
    This you would assemble with the free MPLAB assembler.
    Al.

    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.


  7. #47
    Registered
    Join Date
    Sep 2011
    Location
    uk
    Posts
    119
    Downloads
    0
    Uploads
    0

    Default

    Hi guys,
    Quote Originally Posted by RomanLini View Post
    I have much simpler Linistepper code in C, which will probably suit you better and be easier to modify and make accurate.
    I have installed MikroC but I could really do with this file to have a look at to try to work out the programme process.
    If RomanLini could point me in the direction of the file that would be great.

    Been looking for a programmer and spotted these:-
    eBay - The UK's Online Marketplace
    I know it is cheap but will it be ok for my needs?

    Also I have worked out my timing for the linistepper:-
    300mm arm = 1884.9555mm circumference
    using a 0.50mm fine pitch rod = 3769.911 to 1 drive ratio
    86164.1 sidereal seconds per day divided by 3769.911 drive ratio = 22.8557 seconds per stepper revolution = 0.3809 RPM

    22.8557 divided by 3600 steps = 0.006349 seconds per step

    So thats my final pulse speed, once I understand programming it's all but done.

    Thanks to everybody for your time.

    Ceefna



  8. #48
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    24221
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by ceefna View Post
    Been looking for a programmer and spotted these:-
    I know it is cheap but will it be ok for my needs?
    Ceefna
    It looks fairly similar in performance and price as the Kitrus, it would have been nice to see a couple of screen shots though.
    Al.

    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.


  9. #49
    Gold Member doorknob's Avatar
    Join Date
    Jan 2010
    Location
    USA
    Posts
    2141
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by ceefna View Post
    Been looking for a programmer and spotted these:-
    eBay - The UK's Online Marketplace
    I know it is cheap but will it be ok for my needs?
    I am not familiar with that specific programmer, however other ICSP programmers that I have used have been pretty simple and inexpensive circuits, and so I wouldn't worry about its low price.

    Quote Originally Posted by ceefna View Post

    Also I have worked out my timing for the linistepper:-
    300mm arm = 1884.9555mm circumference
    using a 0.50mm fine pitch rod = 3769.911 to 1 drive ratio
    86164.1 sidereal seconds per day divided by 3769.911 drive ratio = 22.8557 seconds per stepper revolution = 0.3809 RPM

    22.8557 divided by 3600 steps = 0.006349 seconds per step

    So thats my final pulse speed, once I understand programming it's all but done.
    It doesn't really affect the math for figuring out your pulse timing, but instead of 0.3809 RPM, isn't 22.8557 seconds per stepper revolution actually more like 2.625 RPM? (just a reciprocal problem)

    Anyways, with your final calculation of a bit over 6 milliseconds per step pulse, I expect that you should be able to generate that timing very precisely.



  10. #50
    Registered
    Join Date
    Sep 2011
    Location
    uk
    Posts
    119
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by doorknob View Post
    It doesn't really affect the math for figuring out your pulse timing, but instead of 0.3809 RPM, isn't 22.8557 seconds per stepper revolution actually more like 2.625 RPM? (just a reciprocal problem)
    Doorknob you are spot on with 2.625, not 0.3809 RPM.
    I have ordered the programmer from Ebay, does anybody know what model PIC the Linistepper kit ships with?

    Ceefna



  11. #51
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    24221
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by ceefna View Post
    does anybody know what model PIC the Linistepper kit ships with?

    Ceefna
    The latest source code file shows 16F628A.
    The PDF manual is on the PicMicro site.
    Al.

    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.


  12. #52
    Registered James Newton's Avatar
    Join Date
    May 2005
    Location
    USA
    Posts
    1397
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by Al_The_Man View Post
    The latest source code file shows 16F628A.
    That is correct: The 16F628A. You may wish to have a spare chip or two and you might want the debugging adapter module and a programmer that supports it.

    From: PIC16F628A

    Code:
    Part #     	Adapter      	Development Tool
    PG164130	AC162053++	PICkit 3 In-Circuit Debugger
    DV164035	AC162053++	MPLAB ICD 3 In-Circuit Debugger
    DV244005	AC162053++	MPLAB REAL ICE PROBE KIT
    DV164005	AC162053++	MPLAB ICD 2 MODULE
    And... the learning curve is going to be a wee steep here so... hang with it!



  13. #53
    Registered
    Join Date
    Sep 2011
    Location
    uk
    Posts
    119
    Downloads
    0
    Uploads
    0

    Default

    Thanks for the info on the PIC guys.

    The learning curve is not steep it's vertical!
    Could really do with some simple C code to modify the timer on.

    Ceefna



  14. #54
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2392
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by ceefna View Post
    ...
    Romanlini, when you say "C" is that your harddrive? if so can I have a copy please?
    ...
    Man that's a hoot! That should be a quote.

    I do have a copy in C and in C:\ for that matter.

    OK, sorry for teasing, the source file is attached. I thought James also had a copy of the simplified C version of the Lini source code as it was from December last year? If not James, please grab it from this attachment.

    Quote Originally Posted by ceefna View Post
    ...
    Also is there an easier number to end up with for the stepper pulse i.e. a number that divides down the best or is any number easily achieved?
    I say this because the length of the arms I make denote the step pulse so what I am saying is will it be easier to make the mount to a particular step pulse as apposed to making a pulse to suit the mount?
    ...
    OK, I would not sweat the exact ratio of the mechanical construction, ie pulses to scope rotations. Just make it any way you like so you can optimise for looks or good leverage gearing etc.

    Once you are doing software in C you can dial in any speed ratio you like to a very high degree of precision. So do the mech first, then just change the magic numbers in software to suit the mech.

    Generating precise pulse frequencies from any PIC xtal frequency is a favorite hobby area of mine, even an "area of expertise" if that doesn't sound arrogant. I have a section of my web page devoted to methods for doing just that, you can see it here;
    http://www.romanblack.com/one_sec.htm

    One thing, you should buy a xtal for your Linistepper kit to give xtal locked step generation as the Lini comes standard with a ceramic resonator that is slightly less precise than a xtal. Any common xtal; 10, 16 or 20 MHz will be fine and a couple of 22pF ceramic caps.

    Once you commit to xtal frequency and a mechanical design I can easily give you a Bresenham formula to produce exact rotation/hour for your telescope.

    (EDIT) Sorry it looks like the forum won't allow me to attach a .C file, I have quickly hosted it here;
    http://www.romanblack.com/LiniV2_temp/LINI_V2C.C
    I will leave it there indefinitely.



  15. #55
    Registered
    Join Date
    Sep 2011
    Location
    uk
    Posts
    119
    Downloads
    0
    Uploads
    0

    Default

    RonanLini, you have made me laugh again at my ignorance! Even told my wife but she didn't think it was as funny as us. Thanks for the file I will see if it makes any sense to me. I have got my brother onboard to try and help me. He has done a lot of C code stuff with povray etc.

    Your "area of expertise" is just what I need, I have just ordered some 20MHz xtals and am going to stick to my 22.8557 divided by 3600 steps = 0.006349 seconds per step formula.

    Ceefna



  16. #56
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2392
    Downloads
    0
    Uploads
    0

    Default

    Cool. Can you explain the mechanical setup, ie the gears etc, and exact speed needed?

    The Lini C code uses 1200 microsteps per stepper motor rotation, so basically I just need to know the exact motor speed you need (not a rounded down number).



  17. #57
    Registered
    Join Date
    Sep 2011
    Location
    uk
    Posts
    119
    Downloads
    0
    Uploads
    0

    Default

    Hi RomanLini, I have knocked up a picture of what i want to make with some text of my calculations:-
    http://img33.imageshack.us/img33/1295/cameramount.jpg
    The drive rod will only be about 200mm long so I don't have to worry about it following the virtual circle of the gear, this will give me about 2 hours tracking. Most pictures will be a maximum of 5 mins so 2 hours will be plenty. What would be great would be some sort of rewind button to quickly rewind to the start position, is this possible?
    I did all my original calculations on 3600 steps as this would give me 3x better arcsecond resolution but I see the code is for 1200 steps so I have recalculated.
    I have also ordered some 20MHz xtal's for the Linistepper.
    If you need any more information or see a problem with my math please let me know.

    Thanks so much for your help.

    Ceefna



  18. #58
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    24221
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by ceefna View Post
    What would be great would be some sort of rewind button to quickly rewind to the start position, is this possible?
    Ceefna
    I would think an outer travel limit switch into a spare input and set up an interrupt that when it occurs either reverse back so many pulses to start or wait until home limit switch is seen?
    This is if the pulses are not practical to count on the way out?
    What about a manual reset and/or return button at any other time?
    This could be a button parallel to the extreme limit button, the input would perform double function.
    Al.

    Last edited by Al_The_Man; 10-15-2011 at 12:04 PM.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.


  19. #59
    Registered
    Join Date
    Sep 2011
    Location
    uk
    Posts
    119
    Downloads
    0
    Uploads
    0

    Default

    Hi Al, thats what I was thinking, if it was possible to count steps then there would be no need for a max limit switch.
    Then a return button/switch to rewind the motor back to zero, just done a quick calk and the limit of travel would be about 376900 steps, is this number useable?

    Also is it as hard to write the code to do a fast rewind as it is for a slow forward speed( i hope not!)
    If I had a power issue (flat battery etc)half way along the screw then the counting back to zero would not work?I take it the PIC's don't save data when powered off? Maybe as you suggested to have a maximum and minimum travel microswitches linked to a rewind switch.

    Ceefna



  20. #60
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    24221
    Downloads
    0
    Uploads
    0

    Default

    A switch may be the way to go, if steps were lost, low battery etc, the PIC would not know.
    Fast reverse should not be a problem.
    Another thought, steppers are nice in one way that they do not require feedback, but they are power wasters as they consume power even when at rest, so in a portable application you should have a drive disable output that turns off the drive whenever the system is inactive.
    Al.

    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.


Page 3 of 11 FirstFirst 123456 ... LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Drive a 1.8 degree stepper at 1 RPM

Drive a 1.8 degree stepper at 1 RPM