Need Help! Drive a 1.8 degree stepper at 1 RPM


Page 1 of 11 1234 ... LastLast
Results 1 to 20 of 206

Thread: Drive a 1.8 degree stepper at 1 RPM

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

    Default Drive a 1.8 degree stepper at 1 RPM

    Hi all, my first post and I am more than a little confused.

    I have a 1.8 degree step uni-polar motor that I need to turn at exactly 1 RPM. I have wired the motor as a 4 wire Bi-polar motor.

    I have worked out that there are 200 steps per revolution and 60 seconds in a min so 200/60=3.3Hz
    But when I drive the motor at (what I think is 3.3Hz!) it turns way too slow(maybe 1/10 RPM) What is wrong?
    Here is a bit more info on how I am driving the motor

    I have made an Astable ocillator circuit with a 555 timer chip, see link
    LM555 Timer Circuits

    From the calculator on the page I have worked the resistance and capacitor needed to give me the 3.3Hz pulse.

    The step is then fed to a stepper motor driver( see link )
    EasyDriver Stepper Motor Driver

    The only way I can get close to 1 RPM is to drive the motor at about (what I think is!) 25Hz but I need it to be spot on.
    Where am I going wrong?

    Am so confused any help would be great.
    Thanks for your time.

    Ceefna

    Similar Threads:


  2. #2
    Gold Member
    Join Date
    Mar 2003
    Location
    United States
    Posts
    2839
    Downloads
    0
    Uploads
    0

    Default

    Your 'spot-on' frequency is probably 26.666Hz. I think your drive seems to be set to 8 microsteps. This turns your motor into a 1,600 step motor and 1,600 divided by 60 is 26.666Hz.

    Mariss



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

    Default

    Hi thanks for the quick reply, Just timed the motor at 3.3Hz and it took about 6 mins to do a revolution so it looks like you are spot on, 6 times too slow.
    Will try it at 26.666Hz and let you know if it fixes the problem.

    Thanks

    Ceefna



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

    Default

    Hi again, at 26.653Hz (closest I can get with the resistors I have) the motor does one revolution in 57 seconds but surly it should be going too slow not too fast.

    This is a hybrid stepper does this matter?
    In the 555 timer link i posted I have used the calculator and got resistor 1 at 214K resistor 2 at 163.7K and a 0.1uf cap giving 26.653Hz so it should be a bit slow not fast.
    Do you think this is just tollerances in electronic components?
    any ideas?
    Ceefna



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

    Default

    555 timer circuits are not usually very precise. Component tolerances and drift can easily give you a frequency that differs from the ideal calculation.

    I'm not certain what type of capacitor you are using, however typical capacitor tolerances could easily be greater than 10% for certain types.

    As for the resistor values, have you actually measured them or are you using standard values?

    If you really need a more stable and precise clock source, you may wish to investigate the possibility of using a crystal-controlled oscillator with a divider circuit (and perhaps even a temperature-controlled or compensated crystal oscillator) as your primary frequency standard).



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

    Default

    H, the capacitor I am using is a tantalum bead capacitor. I have just checked the specs and it has a 20% tolerance! I have been measuring the resistors with a multimeter so I am sure they are ok to 2 decimal places.
    I would love to be able to use a crystal-controlled oscillator with a divider circuit how hard would this be to build? would i easily be able to get the desired 26.666Hz frequency?
    Thanks so much for all your input.

    Ceefna



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

    Default

    There are many different approaches to generating a 26.666 Hz signal based on a crystal oscillator, and offhand I'm not sure which would be the simplest way.

    Presumably you could start with a fairly common 32 kHz crystal that is usually used as the timebase for a digital clock (for example: Crystal 32kHz - SparkFun Electronics) and use some combination of programmable counter ICs to divide by 1229 to come up with 26.662 Hz. Depending on the circuit capacitance, temperature, and other factors, the crystal might not run at precisely 32,768 Hz, so for example if it were able to run at a slightly different frequency, such as 32,772 Hz instead, then that division ratio would give you 26.665 Hz, and so on.

    But there's probably a better way to get there than simply setting up an integer division of the starting frequency. For example, the period of a waveform corresponding to 26.666 Hz is 37.5 ms (if I have done my math correctly), or half of that would be approx. 18.75 ms. (if you wanted to achieve a 50% duty cycle, which is probably not necessary for your application).

    Inexpensive microcontrollers (for example, PICs) with a crystal-controlled timebase of perhaps 4 MHz (or maybe with a common NTSC TV timebase crystal frequency of 3.579545 MHz) ought to be able to give you timer resolutions on the order of microseconds or even better (disclaimer: I haven't worked with a PIC for five years, and I haven't verified my assertion, but I believe that I'm in the right ballpark). So the microcontroller should be able to generate 26.666 Hz to a high degree of accuracy.

    (I just remembered that you're in the UK, so NTSC timebase crystals may not be as common there as they are here, but you should be able to get something similar easily enough.)

    Maybe I'm overlooking an even simpler way to get there, though...



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

    Default

    Of course you could also simply use variable resistance values to trim your 555 circuit, if the frequency drift will stay within your requirements.



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

    Default

    Many thanks for the reply doorknob, as I have consumed more than one vodka this evening most of your math has gone straight over my head! As you say Pal is the standard here. I had thought about using a trim pot to get the desired timing with the 555 but I really need this to be very accurate so I think my best option is to research the crystal/divider.
    As this is completely alien to me am learning as I go.

    What I am trying to make is a portable long exposure camera mount. Next yeam I am traveling to the Himalayas and would love the chance to take some once in a lifetime pictures. The conditions in the UK for this thing are poor so if I could build a timer that would pulse the stepper to exactly 1 RPM then with the correct 1436.1 to 1 gearing that would sidereal track perfectly. I know this has little to do with CNC but you guys can control your motors far more precisely than I need.

    Thanks so much for your time.

    Ceefna



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

    Default

    It certainly sounds like an interesting idea. Many years ago (1993 IIRC) I built a crude panoramic digital camera that used a stepper motor to control its rotation, but the camera was stationary for each slit scan photo, and so precision drive was not a requirement.

    Are you going to use a polar mount for the camera, then?

    I'm reasonably certain that some modern telescope drives use a crystal-controlled time base.

    Just curious - what level of angular misalignment can you tolerate?



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

    Default

    Glad you are interested in my project.The mount will be polar aligned then any misalignment can be removed by drift alignment( as long as it is tracking at sidereal rate( 1436.1 mins to the day as apposed to 1440 mins in 24 hours) once I get the motor turning at exactly 1 RPM then the rest of the gearing is 14 to 55. 12 to 48. 12 to 48. 14 to 80 then 12 to 48. Lots of gears but ratios multiplied together give you 1463 to 1.

    I have already built an eq fork mount with the motors from a GOTO mount which works perfectly with my 12" telescope but this would be a pain to get in my hand luggage for India!
    Just hope you can help me with the know to drive a stepper, the rest of the build is easy.

    Ceefna



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

    Default

    I expect that I can help you put something together that will meet your requirements. I'm thinking that the microcontroller approach will be simpler than the programmable integer divider approach that I mentioned.

    Do you have any experience programming microcontrollers (or are you interested in learning)? It doesn't have to be a PIC - something like an Arduino should work as well, and since you can get an already-built-up board you wouldn't have to wire it up from scratch. (I have an Arduino board, although I have not yet worked with it, but it should be fairly straightforward to program it.)

    Also, do you need to control anything else along with the motor, or can you dedicate the microcontroller to driving the stepper? And, what kind of controls might you want to have over its operation (or is a simple on/off all that you need)?

    BTW, I'm curious about the fork mount that you put together. Did you make it from aluminum or steel or plywood or something else? Do you have a picture or a pointer to some plans?

    This is somewhat off topic, but I have a very ambitious long-term plan to build an aluminum, servo-operated, gimballed, two-axis azimuth/elevation fork mount for a small telescope (80mm refractor) that would have an attached digital video camera. My eventual goal is to be able to rapidly slew the telescope in two axes (from horizon to horizon, if necessary) under computer control, so that the telescope and camera can track moving objects in the sky such as birds, aircraft, fireball meteors, satellites, UFOs, and the like. So I'm on the lookout for practical plans for DIY fork assemblies, if you have any suggestions.



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

    Default

    Quote Originally Posted by doorknob View Post
    I expect that I can help you put something together that will meet your requirements. I'm thinking that the microcontroller approach will be simpler than the programmable integer divider approach that I mentioned.

    Do you have any experience programming microcontrollers (or are you interested in learning)? It doesn't have to be a PIC - something like an Arduino should work as well, and since you can get an already-built-up board you wouldn't have to wire it up from scratch. (I have an Arduino board, although I have not yet worked with it, but it should be fairly straightforward to program it.)

    Also, do you need to control anything else along with the motor, or can you dedicate the microcontroller to driving the stepper? And, what kind of controls might you want to have over its operation (or is a simple on/off all that you need)?

    BTW, I'm curious about the fork mount that you put together. Did you make it from aluminum or steel or plywood or something else? Do you have a picture or a pointer to some plans?

    This is somewhat off topic, but I have a very ambitious long-term plan to build an aluminum, servo-operated, gimballed, two-axis azimuth/elevation fork mount for a small telescope (80mm refractor) that would have an attached digital video camera. My eventual goal is to be able to rapidly slew the telescope in two axes (from horizon to horizon, if necessary) under computer control, so that the telescope and camera can track moving objects in the sky such as birds, aircraft, fireball meteors, satellites, UFOs, and the like. So I'm on the lookout for practical plans for DIY fork assemblies, if you have any suggestions.
    I have uploaded a few pictures of the mount I built
    http://img94.imageshack.us/img94/3650/dsc02352e.jpg
    http://img828.imageshack.us/img828/7973/dsc02354z.jpg
    http://img845.imageshack.us/img845/2143/dsc02342f.jpg

    I didn't build from plans as the concept of the mechanical side of it is simple and as I was fitting the motors from an old GOTO mount there was little electronics involved.
    I am a motor mechanic by trade so a lot of the parts are motor related( I even anodized the aluminium myself)
    If I can help in any way just ask.

    I have no experiance in programming microcontrollers but I would love to learn. My electronics knowledge is basic but I learn fast. I do not need to control anything else just the stepper, a simple on/off and something that runs on 12v and is not power hungry as this needs to be compact so I would prefer not to carry a huge battery with me.

    If it is possible to drive the motor at any speed would it be possible to run the motor at 24x less than 1 RPM? As then I would be able to do away with the first set of gear reductions. Not exactly 24x less I would have to work out the exact speed required.

    Ceefna



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

    Default

    The mount looks very interesting. Is the fork constructed of square cross-section tubular steel, welded at the corners, or of something else?

    I like the anodizing that you did - I've been gathering the parts and materials to set up a small anodizing line in my garage, but it has been a low priority so I only have part of what I need to get.


    Quote Originally Posted by ceefna View Post
    If it is possible to drive the motor at any speed would it be possible to run the motor at 24x less than 1 RPM? As then I would be able to do away with the first set of gear reductions. Not exactly 24x less I would have to work out the exact speed required.
    Slowing down the drive should be no problem at all. Most people worry about speeding up the motor, which raises other issues, but your application differs from typical CNC applications in that respect (which is "a good thing" - you can get good torque at low stepping speeds).

    Just curious - have you given any thought to the step size that will be appropriate for your application or have you just gone with the maximum microstepping mode? It looks like you have hooked up your driver for 1/8 microstepping, which should give a smooth step-to-step transition, but I was just wondering whether or not single-stepping the motor would give movement that was too jerky in terms of arcseconds of movement or whatever per step (after gearing it down - I haven't done the math with your gear ratio). The choice of which stepping mode to use will also affect the timebase requirements.

    As far as a microcontroller, about a year ago I bought an Arduino Duemilanove board: Arduino Main Board - SparkFun Electronics. That board is no longer available from SparkFun, but should be available from other vendors. SparkFun replaced it with the Uno model which should work just as well: Arduino Uno - SparkFun Electronics

    The Arduino is overkill for your application, but it should be easy to find one and easy to work with. Maybe someone else will chime in with a suggestion for a $5 board that will do just as well for 1/6 of the price.

    I've been meaning to get around to working with my Arduino, so maybe this will give me an incentive to hook it up. It's probably a good idea for you to wait before jumping in and buying an Arduino though, both to give me a chance to experiment with mine, and to let other folks suggest a better option.



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

    Default

    The main fork is made from 50x50x3mm box section steel. I use steel over aluminium as I do not have the facility to weld aluminium and the weight wasn't a concern I thought the heavier the better to reduce vibration etc.

    I built my own 25 Amp variable current power supply which is currently only working at 5 Amps (my car battery was flat and I blew a few of the voltage regulators boosting the battery!)

    I am not sure why the driver is running in 1/8 step mode as all I did was connect it to a 5 volt regulator/ and 12 volt for the motor input then connected the 555 timer to the step input. Are they meant to micro step as standard? This setup will suit me very well as the step is barely visible and will vastly reduce vibration.

    I am finding it quite baffling how to work out the step frequency I need:-
    There are 86164.1 seconds in a sidereal day
    My final reduction is a 60 to 1 worm gear
    So I think that's 86164.1/60=1436.0683333 seconds to 1 revolution of the motor??? or
    23.93447 mins per revolution of the motor, is it possible to drive the motor this slow? and will the output from the final reduction be "jerky"?

    Also are the micro processors easily re-programmed if I need to correct any errors?

    This is starting to give me a bit of a headache, always the case when trying to understand things I have never used.

    Ceefna



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

    Default

    more maths headaches!
    so with 1600 steps per revolution/seconds per revolution that is:-
    1600/1436.068333=0.8975 seconds per step.
    As this is less than 1 second per step am I right in thinking that the output at the final reduction of 60 to 1 would be enough to iron out any of the steps?

    Ceefna



  17. #17
    Gold Member
    Join Date
    Mar 2003
    Location
    United States
    Posts
    2839
    Downloads
    0
    Uploads
    0

    Default

    1) It will be 'jerky' in the sense the motion will be incremental rather than continuous. This is unlikely to be a problem because 1,600 steps per revolution divided by a 60:1 gearbox gives 96,000 steps per one revolution of the gearbox output shaft.

    Each step will turn the gearbox output shaft 0.00375 degrees which is 13.5 arc-seconds. Since it's a telescope and you are an astronomer, you are more fit than I to judge if this is sufficiently fine resolution. 13 arc-seconds is the approximate angular diameter of Mercury as it makes a solar transit.

    2) Your 555 timer is completely inadequate. Given what you are trying to do, the step pulse frequency has to be many orders of magnitude more accurate. That means you must use a crystal controlled oscillator, and at that point, it may as well be a crystal controlled microprocessor (almost all are).

    Besides doing a whole bunch of cool microprocessor stuff, most MCUs have special purpose registers called 'counter-timers'. You can load a timer with a value (some big number) which it counts down from, outputs a step pulse and automatically reloads itself with the same value to repeat the process. This gives you exquisite control over the time interval between step pulses. This only takes a few lines of program code.

    3) Yes, almost all MCU can be re-programmed tens of thousands of times. You don't have to have anxiety about what happens if your code doesn't work the first time. You reprogram it again and again until it works.

    4) The best deal going is nearly every MCU manufacturer sells development system hardware (a fully worked-out printed circuit containing their MCU), development software (the stuff you need to program the miserable thing) and more tutorials than you can shake a stick at for ridiculously low prices (sometimes $29). There is no reason a development board like that cannot be pressed into service to do what you need.

    5) You mentioned "math headaches". Toughen-up a little bit.:-) There will be a lot more headaches learning how to program an MCU using a development system but effort will be worthwhile. Once you master it, it will give you the skills necessary to turn other ideas have in the future into reality.

    Learning is hard. Learning something new to me always feels like an icy cold shower but I sure feel good after I have acquired a new skill. Try microchip.com and find their cheapest development system.

    Mariss



  18. #18
    Registered
    Join Date
    May 2009
    Location
    Canada
    Posts
    39
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by doorknob View Post
    Of course you could also simply use variable resistance values to trim your 555 circuit, if the frequency drift will stay within your requirements.
    Another very old trick to get exactly the resistance value you require, standard or totally non-standard would be doing resistor shaving.

    What the heck is that you ask?

    Here's a interesting link for ya.....

    How to make custom resistors

    Also sometimes call resistor filing.



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

    Default

    Thanks Mariss for your information, from the gearing I am going to use the tracing rate should be spot on but I will still get periodic errors from the geartrain but this is unavoidable.

    I have had a look at microchip.com but as i am in the UK I have found a couple of suppliers who sell the Aruduino Uno/Nano for $17 and $23 respectively. Would something like these suit my needs?

    Is there any reference table I can follow for working out the number that the counter counts down from? I will have to search for programming guides.

    Thanks for the resistor info, that is bound to become useful in the future but by the replies I have had so far I think I need to go the micro processor route.

    Ceefna



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

    Default

    I have a simple little kit that uses a PIC to produce pulses for a stepper controller. It currently takes the pulse rate from a pot, but I could easily modify it to produce pulses at a specific rate. If your interested, buy the kit and let me know what the exact rate of pulses is and I'll modify the code to produce that for you.
    massmind.ecomorder.com/techref/ecomprice.asp?p=416016
    Keep in mind, you need the kit, AND the PCB which is separate. Total cost would be something like $13. You may have to wait a week or so for me to get around to modifying the code. I'm thinking the pot would still be there so you can "slew" at faster rates and change direction, but it would have a "dead" area where the pulse rate would lock in to your specific desired rate. As long as you keep the knob in that area, the rate would be exact.

    Having said that, the Arduino is also a great solution, if you are willing to learn to do the programming yourself.



Page 1 of 11 1234 ... 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