Re: [Emc-users] off topic: pwm with a stepper driver/motor
Hello Chris, On 7/14/20 12:31 AM, Chris Albertson wrote: On Mon, Jul 13, 2020 at 7:28 PM R C wrote: Interesting, but I already have the motors, and the gears are on their way. What I was really looking for is how to drive the stepper-drivers, he DM542 series ones. Do you have the user manual for the DM542? If not look at the top top half of page 9 here https://www.omc-stepperonline.com/download/DM542T.pdf Actually I do have it, it is very similar to the one you mentioned above. It tells you things like how long you need to hold the "DIR" pin before the next step pulse and the minimum pulse widths. The one I have also needs to have the DIR set 5us before you do anything else I'd make them all larger than needed by about 4X because you are not trying to make these go fast. In fact, a 50% duty cycle square wave works fine. So you'd set the wait after the DIR 20us? and PUL the duty cycle 10us, 5us hi then 5us lo? I set it up so that it is 'variable' in a mem-shared array, so I can change some parameters (for example because of feedback from the encoders, or by 'manually' adjusting it.) while the threads keep running. What you do is in the loop when you set a pin high you store the time for when it must be set low and every time through the loop you do whatever has a time-to-do that is expired. You can juggle N balls at once in one loop this way. What I am doing is use multiple threads, I am writing it in C, and use a separate pthread for each stepper-driver / motor. Once the telescope starts tracking, only one motor/thread will run, the other two are mostly 'idling. '. thanks! that was what I was somewhat looking for, some actuall number I can use that work and go from there. The speed just depends on how much time there is between the duty cycles, at least tat is what I noticed, correct? Would it be better to use a higher number of steps? The manual seems to indicate that I can almost use any setting there with a "1.8 degrees steppermotor", which somewhat surprised me. Ron ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] off topic: pwm with a stepper driver/motor
Hello Gene, On 7/14/20 12:49 AM, Gene Heskett wrote: On Monday 13 July 2020 22:44:37 R C wrote: well, I can calculate what the speed needs to be, also I can actually "observe" it too.. by pointing the telescope at a star and see how much the deviation is. I have encoder to check the actual speed of a shaft. I found some information in a manual/tech-sheet that comes with the drivers, so I am trying to figure out what the best stepping rate is and what the best way of actually sending pulses to the stepper-driver is. I wrote some c-code that runs the motors in pthreads, I just want to know what the best way is. pulse lengths, pause/gap length etc. (basically the best way to use a dm542 (all those steppers are sorta the same I understand) The driver tech-sheet basically says it can do pretty all it's available micro stepping with a 1.8 degree stepper motor, I wonder if that is really true. In theory yes, in practice, no. There is resistor tolerances and all sorts of errors that can creep into a motor being held by the relative balance of the currents thru 2 sets of coils. So while a full switch will move it 1.8 dgreees, or 1.2 with the newer 3 phase models, between magnetics and parts tolerances, half current in each coil might be out of balance as much as 10% in off the shelf stuff. Sometimes its fairly obvious, I have a dm860 driver that when moving a 1600 oz/in motor at a /8 divisor, moves 7 steps rather noisily, and the 8th step cannot be seen or heard. Worked fine on my mill as long as I stayed below 26 ipm. But thats too slow for rigid tapping. A 960oz/in and ac powered driver was subbed, moves that heavy head at nearly 100 ipm, dead smooth. Right, but I can probably get it close by calculating, and then adjust for "tolerances" and feedback from the encoders I have. I also have a dm860, using it in a Sherline mill where I put a bigger stepper motor on the Z-axis. (I replaced all stepper motors and drivers in a Sherline mill and lathe (they came in a Paxton/Patterson enclosure). thanks, Ron Ron On 7/13/20 8:35 PM, Chris Albertson wrote: A fast control loop that drives each motor at a given speed and a second slower control loop that figures out what that speed should be. The second loop typically uses "PID" even if only in fact the "P" is used. That can be used to drive any number of motors all at their correct speeds. On Mon, Jul 13, 2020 at 7:28 PM R C wrote: Interesting, but I already have the motors, and the gears are on their way. What I was really looking for is how to drive the stepper-drivers, he DM542 series ones. Ron On 7/13/20 7:53 PM, cogoman via Emc-users wrote: I recently discovered geared stepper motors. http://www.zyltech.com/nema-17-stepper-motor-geared-planetary-gearb ox-1-7-a-3-1-nm-435-ozin/ I've been happy with zyltech in the past. I bought one of these for evluation, but the specs seem to be great for CNC. Low enough current to work with a stepstick, High enough torque for a fairly powerful machine, and less than 4 mH inductance should let it step pretty fast. 5.18:1 gear ratio should reduce that 4 meter spur gear, but the link below has higher gear ratios that would reduce that spur gear greatly! Backlash could be a problem for CNC, but if you are only going one way, the less precision gearboxes might be fine. https://www.omc-stepperonline.com/geared-stepper-motor/?sort=p.pric e&order=ASC Once you visit the stepperonline web page you know as much about them as I do, but their offerings might be just right for your application. On 7/9/20 2:23 PM, R C wrote: Hello, this is (probably) off topic, been seen that happen. If it is please ignore it. I am building a "motorized" telescope mount (dobsonian) with what is called an equatorial platform, it has 3 axis which I am going to drive with stepper motors. The stepper motors I use with a stepper driver, those common DM542 ones, the stepper motors themselves are 2A and 1.8 degrees per step. What I want to accomplish with the equatorial platform) (it compensates for the rotation of the earth) is that, the start and end position accuracy is not that important, smooth and constant/consistent movement is. for the azimuth/altitude precision is not a really big deal, but you'd want to move these 2 axis somewhat swift. So there are a few factors to decide. I probably want micro stepping, what settings on the driver for pulses per rev, is best to use (or is that just trial and error?) As with PWM itself, I am probably just not too familiar with it. From what I understand, the voltage I use for the motors determines how fast I can go (I am going to use a 48V switching power supply). as for PWM, I can of course change the length of the pulse itself and, independently, change the time between two pulses. What is the relation ship there? WHat does a longer width of the pulse itself do? and what exactly does a longer gap between the pulses do (of course the wid
Re: [Emc-users] Because the hardware store was 4 miles away...
(Off topic, but interesting) On Tue, 14 Jul 2020 at 02:11, Gregg Eshelman via Emc-users wrote: > > Used to be mechanical drive attachments for some lathes to move the cross > slide in and out for cutting threads for taps. Yes, Holbrook used to offer a sub-speed head (clamped to the bed, connected to the spindle, output a speed lower by a factor of 6 on a coaxial secondary spindle nose) and a set of relieving equipment (special top slide , back power shaft, sets of cams) A mesmerising device for other lathes was developed by the model engineering community, the Eureka attachment. https://www.youtube.com/watch?v=U_kqi3dqr50 It almost seems like a shame to do it with CNC now. -- atp "A motorcycle is a bicycle with a pandemonium attachment and is designed for the especial use of mechanical geniuses, daredevils and lunatics." — George Fitch, Atlanta Constitution Newspaper, 1912 ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] off topic: pwm with a stepper driver/motor
Gene is correct when he wrote the precision might be off when micro-stepping. Motors are mechanically built for 1.8 degree steps so that is likely to be accurate but half steps depend on the driver. But what I wanted to add is that when you read the speed vs. torque curve it is for FULL steps. The amount of holding torque is reduced with microsteps. It makes sense too, full steps use full current that is switched between coils just 100% on or 100% off. With microsteps one coild gets perhaps 3/8 of full current and the other gets something like 5/8. So the current is overall reduced. In any case, run the motors at a step rate that causes them to run smoothly without actually stepping. You want to see continuous motion. BTW I'm using a DM542, the same driver you have on this vertical axis test (link below). It has enough power even when doing 1/2 steps to move a 35 pound chunk of steel up and up at a decent rate of speed. machine is obviously not balanced like a telescope The DM542 is set for only 2.0 amps so it is not running at full power. SO you will be fine even with the reduced torque. This is the first time this axis ran. Just some jogs up and down. But listen to the motor, you can't start and stop these stepper motors instantly the velocity ramps up and down. In fact this rate of change is as fast as I can go with this setup and the DM542's 2.0 amp current limit. If you do a fast slew to a target, you need to ramp up the speed then slow down and hit the mark and then pick up the star tracking rate. That second loop controls the speed and the rate of change of that speed. Software was to plan the motion in advance so that it start to slow soon enough not to over shoot https://youtu.be/tlMTksuOuZQ On Mon, Jul 13, 2020 at 11:51 PM Gene Heskett wrote: > > > The driver tech-sheet basically says it can do pretty all it's > > available micro stepping with a 1.8 degree stepper motor, I wonder if > > that is really true. > > > In theory yes, in practice, no. There is resistor tolerances and all > sorts of errors that can creep into a motor being held by the relative > balance of the currents thru 2 sets of coils. -- Chris Albertson Redondo Beach, California ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] off topic: pwm with a stepper driver/motor
Hi Chris, for the go to part I am not "too worried"about that possibly not being too smooth, of course it is the goal to do that, but the point there is to get there. The equatorial tracking indeed needs to be as smooth as possible. With the hearing I have I think I can run the stepper motors smooth without having to do any micro stepping. thanks, Ron On 7/14/20 3:49 AM, Chris Albertson wrote: Gene is correct when he wrote the precision might be off when micro-stepping. Motors are mechanically built for 1.8 degree steps so that is likely to be accurate but half steps depend on the driver. But what I wanted to add is that when you read the speed vs. torque curve it is for FULL steps. The amount of holding torque is reduced with microsteps. It makes sense too, full steps use full current that is switched between coils just 100% on or 100% off. With microsteps one coild gets perhaps 3/8 of full current and the other gets something like 5/8. So the current is overall reduced. In any case, run the motors at a step rate that causes them to run smoothly without actually stepping. You want to see continuous motion. BTW I'm using a DM542, the same driver you have on this vertical axis test (link below). It has enough power even when doing 1/2 steps to move a 35 pound chunk of steel up and up at a decent rate of speed. machine is obviously not balanced like a telescope The DM542 is set for only 2.0 amps so it is not running at full power. SO you will be fine even with the reduced torque. This is the first time this axis ran. Just some jogs up and down. But listen to the motor, you can't start and stop these stepper motors instantly the velocity ramps up and down. In fact this rate of change is as fast as I can go with this setup and the DM542's 2.0 amp current limit. If you do a fast slew to a target, you need to ramp up the speed then slow down and hit the mark and then pick up the star tracking rate. That second loop controls the speed and the rate of change of that speed. Software was to plan the motion in advance so that it start to slow soon enough not to over shoot https://youtu.be/tlMTksuOuZQ On Mon, Jul 13, 2020 at 11:51 PM Gene Heskett wrote: The driver tech-sheet basically says it can do pretty all it's available micro stepping with a 1.8 degree stepper motor, I wonder if that is really true. In theory yes, in practice, no. There is resistor tolerances and all sorts of errors that can creep into a motor being held by the relative balance of the currents thru 2 sets of coils. ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] off topic: pwm with a stepper driver/motor
On 07/14/2020 04:49 AM, Chris Albertson wrote: But what I wanted to add is that when you read the speed vs. torque curve it is for FULL steps. The amount of holding torque is reduced with microsteps. It makes sense too, full steps use full current that is switched between coils just 100% on or 100% off. With microsteps one coild gets perhaps 3/8 of full current and the other gets something like 5/8. So the current is overall reduced. Well, this is only partially true. It is a rare case where the actual standstill holding torque is exceeded by the load. Most often, the motor is stalled while moving. The running torque of a stepper is less (sometimes MUCH less) than the holding torque, and resonances really hurt the running torque. A microstepping drive reduces the resonances, and smart microstepping like Gecko uses adds active damping to absorb the resonant energy. These systems will have much higher running torque than a full-step drive. Jon ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] off topic: pwm with a stepper driver/motor
If you can hear it, it isn't smooth. I'd recommend using the finest micro stepping setting your driver offers, but simply not counting on more than 1/4 of a full step in your resolution accuracy. But just because the motor and drive may not be able to physically achieve positioning accuracy much better than 1/4 step, doesn't mean that having the finer micro step resolution won't significantly contribute to smoother quieter motion. Todd Zuercher P. Graham Dunn Inc. 630 Henry Street Dalton, Ohio 44618 Phone: (330)828-2105ext. 2031 -Original Message- From: R C Sent: Tuesday, July 14, 2020 9:39 AM To: emc-users@lists.sourceforge.net Subject: Re: [Emc-users] off topic: pwm with a stepper driver/motor [EXTERNAL EMAIL] Be sure links are safe. Hi Chris, for the go to part I am not "too worried"about that possibly not being too smooth, of course it is the goal to do that, but the point there is to get there. The equatorial tracking indeed needs to be as smooth as possible. With the hearing I have I think I can run the stepper motors smooth without having to do any micro stepping. thanks, Ron On 7/14/20 3:49 AM, Chris Albertson wrote: > Gene is correct when he wrote the precision might be off when > micro-stepping. > > Motors are mechanically built for 1.8 degree steps so that is likely > to be accurate but half steps depend on the driver. > > But what I wanted to add is that when you read the speed vs. torque > curve it is for FULL steps. The amount of holding torque is reduced with > microsteps. It makes sense too, full steps use full current that is > switched between coils just 100% on or 100% off. With microsteps one > coild gets perhaps 3/8 of full current and the other gets something > like 5/8. So the current is overall reduced. > > In any case, run the motors at a step rate that causes them to run > smoothly without actually stepping. You want to see continuous motion. > > BTW I'm using a DM542, the same driver you have on this vertical axis test > (link below). It has enough power even when doing 1/2 steps to move a 35 > pound chunk of steel up and up at a decent rate of speed. machine is > obviously not balanced like a telescope The DM542 is set for only 2.0 amps > so it is not running at full power. SO you will be fine even with the > reduced torque. > > > This is the first time this axis ran. Just some jogs up and down. But > listen to the motor, you can't start and stop these stepper motors > instantly the velocity ramps up and down. In fact this rate of change > is as fast as I can go with this setup and the DM542's 2.0 amp current limit. >If you do a fast slew to a target, you need to ramp up the speed > then slow down and hit the mark and then pick up the star tracking > rate. That second loop controls the speed and the rate of change of that > speed. > Software was to plan the motion in advance so that it start to slow > soon enough not to over shoot https://youtu.be/tlMTksuOuZQ > > On Mon, Jul 13, 2020 at 11:51 PM Gene Heskett wrote: > >>> The driver tech-sheet basically says it can do pretty all it's >>> available micro stepping with a 1.8 degree stepper motor, I wonder >>> if that is really true. >>> >> In theory yes, in practice, no. There is resistor tolerances and all >> sorts of errors that can creep into a motor being held by the >> relative balance of the currents thru 2 sets of coils. > ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] off topic: pwm with a stepper driver/motor
> -Original Message- > From: Chris Albertson [mailto:albertson.ch...@gmail.com] > Sent: July-14-20 2:49 AM > To: Enhanced Machine Controller (EMC) > Subject: Re: [Emc-users] off topic: pwm with a stepper driver/motor > > Gene is correct when he wrote the precision might be off when > micro-stepping. > Yes. Micro-stepping is only for harmonic reduction. You cannot rely on positioning with micro-stepping. It can take 3 or 4 micro-steps to even start moving to overcome static friction. > Motors are mechanically built for 1.8 degree steps so that is likely to be > accurate but half steps depend on the driver. Half steps rely on only one coil energized so you lose half the torque. For static motion that may well be enough depending on the size of the motor and the load. > > But what I wanted to add is that when you read the speed vs. torque curve > it is for FULL steps. The amount of holding torque is reduced with > microsteps. It makes sense too, full steps use full current that is > switched between coils just 100% on or 100% off. With microsteps one > coild gets perhaps 3/8 of full current and the other gets something like > 5/8. So the current is overall reduced. 70.7% is the number you are looking for. > > In any case, run the motors at a step rate that causes them to run smoothly > without actually stepping. You want to see continuous motion. > > BTW I'm using a DM542, the same driver you have on this vertical axis test > (link below). It has enough power even when doing 1/2 steps to move a 35 > pound chunk of steel up and up at a decent rate of speed. machine is > obviously not balanced like a telescope The DM542 is set for only 2.0 amps > so it is not running at full power. SO you will be fine even with the > reduced torque. > > > This is the first time this axis ran. Just some jogs up and down. > https://youtu.be/tlMTksuOuZQ > Were you using LinuxCNC for this? Or did you write your own control software? John Dammeyer ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] off topic: pwm with a stepper driver/motor
On Tue, Jul 14, 2020 at 10:50 AM John Dammeyer wrote: > > > https://youtu.be/tlMTksuOuZQ > > > Were you using LinuxCNC for this? Or did you write your own control > software? > This was done with Linux CNC. However, The purpose of me owning a mill is for robotics. I have not yet figured how to use LCNC for robot projects so in those cases I do my own low-level motion control, typically using STM32 and an RTOS. The video is not meant to stand alone. It will be part of a web site that has other videos and some text and photos. But it does show how motors must be ramped up and down. -- Chris Albertson Redondo Beach, California ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] off topic: pwm with a stepper driver/motor
On Fri, 10 Jul 2020 at 10:34, andy pugh wrote: > I don't see why there is any limit to the possible reduction of a belt > drive, if idlers are added to increase the wrap. And here is an example: https://youtu.be/7zBrbdU_y0s -- atp "A motorcycle is a bicycle with a pandemonium attachment and is designed for the especial use of mechanical geniuses, daredevils and lunatics." — George Fitch, Atlanta Constitution Newspaper, 1912 ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] off topic: pwm with a stepper driver/motor
On 07/14/2020 01:51 PM, andy pugh wrote: On Fri, 10 Jul 2020 at 10:34, andy pugh wrote: I don't see why there is any limit to the possible reduction of a belt drive, if idlers are added to increase the wrap. And here is an example: https://youtu.be/7zBrbdU_y0s OH MY! Some people REALLY have too much time on their hands! Did anyone tell this guy that scissors are made to be held in a person's hands? Two fingers do the snip snip just fine. Jon ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] off topic: pwm with a stepper driver/motor
On 7/14/20 11:48 AM, John Dammeyer wrote: -Original Message- From: Chris Albertson [mailto:albertson.ch...@gmail.com] Sent: July-14-20 2:49 AM To: Enhanced Machine Controller (EMC) Subject: Re: [Emc-users] off topic: pwm with a stepper driver/motor Gene is correct when he wrote the precision might be off when micro-stepping. Yes. Micro-stepping is only for harmonic reduction. You cannot rely on positioning with micro-stepping. It can take 3 or 4 micro-steps to even start moving to overcome static friction. Motors are mechanically built for 1.8 degree steps so that is likely to be accurate but half steps depend on the driver. Half steps rely on only one coil energized so you lose half the torque. For static motion that may well be enough depending on the size of the motor and the load. But what I wanted to add is that when you read the speed vs. torque curve it is for FULL steps. The amount of holding torque is reduced with microsteps. It makes sense too, full steps use full current that is switched between coils just 100% on or 100% off. With microsteps one coild gets perhaps 3/8 of full current and the other gets something like 5/8. So the current is overall reduced. 70.7% is the number you are looking for. In any case, run the motors at a step rate that causes them to run smoothly without actually stepping. You want to see continuous motion. BTW I'm using a DM542, the same driver you have on this vertical axis test (link below). It has enough power even when doing 1/2 steps to move a 35 pound chunk of steel up and up at a decent rate of speed. machine is obviously not balanced like a telescope The DM542 is set for only 2.0 amps so it is not running at full power. SO you will be fine even with the reduced torque. This is the first time this axis ran. Just some jogs up and down. https://youtu.be/tlMTksuOuZQ Were you using LinuxCNC for this? Or did you write your own control software? Actually, both. I have a Sherline mill and lathe that I am running with lnux cnc and... the same motors and stepper drivers. The telescope will have the same drivers and stepper motors, BUT writing my own interface to try and control them,... well that before I try to hook it up to Stellarium directly. John Dammeyer ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] off topic: pwm with a stepper driver/motor
Hi Chris, On 7/14/20 12:10 PM, Chris Albertson wrote: On Tue, Jul 14, 2020 at 10:50 AM John Dammeyer wrote: https://youtu.be/tlMTksuOuZQ Were you using LinuxCNC for this? Or did you write your own control software? This was done with Linux CNC. However, The purpose of me owning a mill is for robotics. I have not yet figured how to use LCNC for robot projects so in those cases I do my own low-level motion control, typically using STM32 and an RTOS. Same here, I am using the same drivers and motors in my Sherline CNC machines... BUT trying to make my own interface fr the telescope. (would be interesting if there could be a telescope "option" I don't think a telescope is probably not that different... but outside the scpe, since it is not a CNC machine. The video is not meant to stand alone. It will be part of a web site that has other videos and some text and photos. But it does show how motors must be ramped up and down. ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] off topic: pwm with a stepper driver/motor
This person makes basically comedy videos with one totally impossible robot after another. The "robots" are props. He does not try to be serious. I suspect the kid is the actor and others make the props. The background sets are built and the lighting is certainly not what is found in a home garage. Making a video like this is a lot of work. They do it well and with decent production quality, even the sound is good which is rare on Youtube. Back to belt reductions. Yes of course a belt reduction can have any ratio but always there is a minimum gear diameter lets call it "d" and if the reduction ratio is N:1 the larger gear must by dN diameter. Many times dN will not fit in the available space. On Tue, Jul 14, 2020 at 12:59 PM Jon Elson wrote: > > > https://youtu.be/7zBrbdU_y0s > > > OH MY! Some people REALLY have too much time on their > hands! Did anyone tell this guy that scissors are made to > be held in a person's hands? Two fingers do the snip snip > just fine. > -- Chris Albertson Redondo Beach, California ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] off topic: pwm with a stepper driver/motor
There are sine wave controllers that do various smoothing things to run steppers smooth and silent. Trinamic calls it Spread Cycle and Stealth Chop. https://www.youtube.com/watch?v=Q0sJlGh9WNY On Tuesday, July 14, 2020, 11:18:22 AM MDT, Todd Zuercher wrote: If you can hear it, it isn't smooth. I'd recommend using the finest micro stepping setting your driver offers, but simply not counting on more than 1/4 of a full step in your resolution accuracy. But just because the motor and drive may not be able to physically achieve positioning accuracy much better than 1/4 step, doesn't mean that having the finer micro step resolution won't significantly contribute to smoother quieter motion. ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users