Stepper Encoder/Closed Loop

Post anything you want to discuss with others about the software.

Stepper Encoder/Closed Loop

Postby drxlcarfreak » Tue Jul 24, 2018 2:35 am

I am in the market for a new set of steppers, and stumbled across stepper motors with encoders built in (https://bit.ly/2LJd0qp). It would be nice to be able to makeup steps, or ensure that they aren't lost at all during a cut rather than have to scrap the piece I am working on. It says in the user manual that the auxiliary encoders cannot be used for closed loop operation, I was wondering if any of the updates have changed this, or if there are plans in the future to be able to run steppers closed loop via the software?

Does anyone have experience with a closed loop stepper setup? Will it work the way I anticipate, allowing me to get closer to the edge of the motor's abilities, or is it not as automatic as I am thinking?
drxlcarfreak
 
Posts: 27
Joined: Tue Jun 26, 2018 2:51 pm

Re: Stepper Encoder/Closed Loop

Postby cncdrive » Tue Jul 24, 2018 3:05 am

No update needed to run those drives and motors. The UCCNC can already run them, because they accepting step/dir signals.
With those drives the loop is closed between the motor and the stepper drive, there is no feedback to the motion controller and to the software.
The drive accepts step/dir signals and so the loop is still open between the motion controller and the drive.

The operation of these drives and motors is the same as how step/dir based servo drives and motors work, except that the stepper motors have higher inertia than servos and does not have peak torque.
This means that it is easier to fit the motor to the driving mechanism and axis, because there is usually no need to do inertia matching calculations like you need to do that if you want an optimally working servo system. But the same time the higher inertia means more "lazy" slower motor response and so the stepper motor can't accelerate as fast as a servo which may be a problem or not depending on the application.

We also selling similar closed loop stepper motors and drives: http://shop.cncdrive.com/index.php?categoryID=151
The HSS drives and the HSE motors are the closed loop ones.
We often install these drives into machines we build.
cncdrive
Site Admin
 
Posts: 4887
Joined: Tue Aug 12, 2014 11:17 pm

Re: Stepper Encoder/Closed Loop

Postby drxlcarfreak » Tue Jul 24, 2018 1:04 pm

Fair enough. I am not thoroughly experienced in how the closed loop works. To me it would make sense for the software to realize that steps are being lost and to slow the code down temporarily to allow the axis to catch back up more quickly, otherwise you could have the Z axis diving into the piece while the Y axis is trying to catch up. Or does it not normally happen that way?

I guess I should back up a bit and explain what I am trying to avoid. I finally got my machine running solidly, dialed in the backlash etc, and was cutting my spoil board and all was going well for the first hour or so, then when it was about to finish up, the Y axis stalled during a rapid (I can't say that I have lost a step actually cutting, it always seems to be during a rapid no matter how much I reduce velocity and acceleration) and the spindle plunged into the board an inch short from where it was supposed to. I reset the machine a few times and it kept stalling in the same spot even though it had crossed this area on the Y axis about 100 times before this during the program. After looking at it, I think that I attribute it to the steppers running very hot from being run so long without a break lowering the torque available coupled with some MDF dust on the rails (I need to install rail brushes regardless). Thankfully it is just the spoil board that is going to be beat up anyways, but if it were an actual piece I wouldn't be happy (not that I was happy when it happened here!). I want to be able to avoid this issue in the future on actual parts.

My original thought was to well oversize the steppers for added headroom, but if I can also add close loop operation, then if it operates the way I am thinking I would be pretty confident in the operation of my machine.

Oh nice! Do you have any torque curves available for these? I bought my last steppers based on what I thought was a good torque curve, but read PPS as REV and just recently realized that there is no information on these past 240RPM, so I am guessing torque just dies off, and may be the reason my rapids occasionally are stalling on me.
drxlcarfreak
 
Posts: 27
Joined: Tue Jun 26, 2018 2:51 pm

Re: Stepper Encoder/Closed Loop

Postby cncdrive » Tue Jul 24, 2018 1:34 pm

Well, you wrote "Or does it not normally happen that way?", it depends on what we see normal. :)
There is no way to properly achive what you want to achive, because if one axis fully stall then it would be required for the other axis to stall too otherwise the other axis overruns which is a position error.
And stepper motors often loose steps if you stall them above their start/stop frequency.
And so what you would achive when one axis stalls is that you stall the other axis too and so not only one, but 2 axis loose steps.

The other thing is that a system like that can't respond immediately you must have a following error tolerance and because of that the system will be instable without a control loop (e.g. PID loop).
And so then tuning would require much more knowledge than the avarage user have.

On the other hand a system which has the loop closed to the drives only still has an advantage that it corrects the position error continously which still makes some error, but it will be corrected so it is not a remaining position error, it is just temporary or if the error is too large then the drive can tell the software to stop.

Usually what people do is the same what you have mentioned is that they oversize the motor. Even if it is a closed loop stepper motor drive it is still a good idea to oversize, however you should take the higher inertia of the larger motor into account which will make your machine more "lazy".

Unfortunately I don't have torque curves at hands at the moment. Can try to ask the manufacturer of the motors, but will probably need some time to ask them, because currently I'm a bit overloaded with work a s some of my collegues are currently spending their summer holidays. :(
cncdrive
Site Admin
 
Posts: 4887
Joined: Tue Aug 12, 2014 11:17 pm

Re: Stepper Encoder/Closed Loop

Postby Gary Campbell » Wed Jul 25, 2018 12:36 am

drxlcarfreak….
You are conflating the benefits of a servo system that has encoder feedback with that of a closed loop stepper system. Stepper systems, or "hybrid" steppers with encoders only have encoder feedback to the drive. The drive, in most cases will increase power once a full step is lost, and will report an alarm to the controller once the preset time/encoder count threshold has been breached. In most cases both are user set.


Here are a few things you might want to know:

If you are losing steps due to high rpm, these larger motors will most likely loose position at a lower rpm
In many, possibly even most, cases, bolting the ~1200 ozin motors in place of ~600 ozin motors will make the machine slower
A closed loop 600 or 1200 ozin motor will not outperform its equal without an encoder
In order to take advantage of a closed loop stepper system you will need to connect the alarms to control inputs and configure them to trigger a motion stop
Most end users, left to their own logic will set encoder counts waaaay to low to accommodate accel/decel.
Gary Campbell
CNC Technology & Training
Control & ATC Retrofits
gcnc411(at)gmail.com
https://www.youtube.com/user/Islaww1/videos
Gary Campbell
 
Posts: 56
Joined: Thu Nov 24, 2016 8:25 pm

Re: Stepper Encoder/Closed Loop

Postby ger21 » Wed Jul 25, 2018 2:30 am

Consider this.
A stepper motor usually stalls or loses steps because it doesn't have enough power.

A closed loop stepper is just a regular stepper with an encoder.

So when it loses steps because it didn't have enough power, it also won't have enough power to get back into position.

As Gary said, what closed loop steppers allow you to do is safely stop the machine when it loses position.

Will it work the way I anticipate, allowing me to get closer to the edge of the motor's abilities


No, not really. Running close to the edge of the motors abilities is the cause of the problem.
If you want a machine to run reliably at 600ipm, then it should have motors capable of being mostly reliable at 800-900ipm.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Stepper Encoder/Closed Loop

Postby drxlcarfreak » Wed Jul 25, 2018 3:04 pm

Well, you wrote "Or does it not normally happen that way?", it depends on what we see normal. :)
There is no way to properly achive what you want to achive, because if one axis fully stall then it would be required for the other axis to stall too otherwise the other axis overruns which is a position error.
And stepper motors often loose steps if you stall them above their start/stop frequency.
And so what you would achive when one axis stalls is that you stall the other axis too and so not only one, but 2 axis loose steps.

The other thing is that a system like that can't respond immediately you must have a following error tolerance and because of that the system will be instable without a control loop (e.g. PID loop).
And so then tuning would require much more knowledge than the avarage user have.

On the other hand a system which has the loop closed to the drives only still has an advantage that it corrects the position error continously which still makes some error, but it will be corrected so it is not a remaining position error, it is just temporary or if the error is too large then the drive can tell the software to stop.

Usually what people do is the same what you have mentioned is that they oversize the motor. Even if it is a closed loop stepper motor drive it is still a good idea to oversize, however you should take the higher inertia of the larger motor into account which will make your machine more "lazy".

Unfortunately I don't have torque curves at hands at the moment. Can try to ask the manufacturer of the motors, but will probably need some time to ask them, because currently I'm a bit overloaded with work a s some of my collegues are currently spending their summer holidays. :(


So I have heard this before about the larger motor having more interia to spin. In theory I get it since there is more mass farther out so it takes more torque to get it to spin at the same acceleration, but wouldn't the added torque (minus the torque needed to overcome the extra inertia) go straight to bettering the acceleration?

Not a problem. I am still making the machine work. I am trying to take my time this go around instead of going for the first motor/drive that was mentioned to me.

If you are losing steps due to high rpm, these larger motors will most likely loose position at a lower rpm

I have not heard this before, what is the reasoning for that?

In many, possibly even most, cases, bolting the ~1200 ozin motors in place of ~600 ozin motors will make the machine slower

I understand the added inertia issue from above, but are there other reasons that I am unaware of?

A closed loop 600 or 1200 ozin motor will not outperform its equal without an encoder

Makes complete sense. I was hoping a bit too much on the closed loop abilities. They are both the same motor encoder or not.

In order to take advantage of a closed loop stepper system you will need to connect the alarms to control inputs and configure them to trigger a motion stop
Most end users, left to their own logic will set encoder counts waaaay to low to accommodate accel/decel.

So that would account for a lot of false alarms I am guessing then. Honestly, in cutting wood like I am right now, I am not concerned with 1/10 of a step, or probably even a whole step. I would almost like it just to save a piece if an axis fully stalls on me before the Z plunges.

Consider this.
A stepper motor usually stalls or loses steps because it doesn't have enough power.

A closed loop stepper is just a regular stepper with an encoder.

So when it loses steps because it didn't have enough power, it also won't have enough power to get back into position.

As Gary said, what closed loop steppers allow you to do is safely stop the machine when it loses position.

No, not really. Running close to the edge of the motors abilities is the cause of the problem.
If you want a machine to run reliably at 600ipm, then it should have motors capable of being mostly reliable at 800-900ipm.


Completely makes sense. So as Gary was saying above, if I get a machine that can run reliably at 600ipm, will I have issues then at 100ipm?

One thing I have been looking into while trying to get a better understanding of steppers/drives are the Clearpath SDSK servos. They are a bit pricier, but include the drives so depending on which motor I look it, there may only be a small premium to go to them. They tout no lost steps, but I think that is similar to a stepper with encoder right? If its run near the max, it will just stall as well? One thing I do not quite understand is sizing them. Looking at the torque curves, I am guessing RMS torque is more for maintaining velocity and peak torque is for acceleration? Would that mean a close to apple to apples comparison would be compare the peak torque curve of these servos to a comparable stepper torque curve?
drxlcarfreak
 
Posts: 27
Joined: Tue Jun 26, 2018 2:51 pm

Re: Stepper Encoder/Closed Loop

Postby ger21 » Wed Jul 25, 2018 3:36 pm

So I have heard this before about the larger motor having more interia to spin. In theory I get it since there is more mass farther out so it takes more torque to get it to spin at the same acceleration, but wouldn't the added torque (minus the torque needed to overcome the extra inertia) go straight to bettering the acceleration?


Stepper motors are different than most other motors.
With steppers, as rpm's increase, torque decreases. Typically, the larger the motor, the faster the torque decreases.
Say you want the motor to spin at 1000 rpm. It's very possible that a 400oz motor will have more torque at 1000rpm then a 1200 oz motor.

Since most hobby controls use linear acceleration, the same amount of torque is required from a standing start, all the way up to the top speed. So your acceleration rate is limited by the available torque at rpm of your max velocity.

Servos won't stall, but they'll fault.

If the position monitored by the encoder is too far from the commanded position, the drive will fault. Typically, the machine is configured to shut down all axis when a fault occurs.

The bottom line, is that you can only go as fast as your motors are capable. For a truly rliable machine, the motors should be capable of moving the machine 30%-50% faster than it will ever be used.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Stepper Encoder/Closed Loop

Postby Gary Campbell » Wed Jul 25, 2018 11:56 pm

"So that would account for a lot of false alarms I am guessing then. Honestly, in cutting wood like I am right now, I am not concerned with 1/10 of a step, or probably even a whole step. I would almost like it just to save a piece if an axis fully stalls on me before the Z plunges."

I rest my case ;)

If your encoder has 1000 counts per rev, I suggest you set the alarm threshold around 1/4 turn or 250.

Can I guess that you are driving 5mm pitch ballscrews? If so, put on 10mm pitch units, its that simple
Gary Campbell
CNC Technology & Training
Control & ATC Retrofits
gcnc411(at)gmail.com
https://www.youtube.com/user/Islaww1/videos
Gary Campbell
 
Posts: 56
Joined: Thu Nov 24, 2016 8:25 pm

Re: Stepper Encoder/Closed Loop

Postby drxlcarfreak » Thu Jul 26, 2018 1:30 pm

Stepper motors are different than most other motors.
With steppers, as rpm's increase, torque decreases. Typically, the larger the motor, the faster the torque decreases.
Say you want the motor to spin at 1000 rpm. It's very possible that a 400oz motor will have more torque at 1000rpm then a 1200 oz motor.

Since most hobby controls use linear acceleration, the same amount of torque is required from a standing start, all the way up to the top speed. So your acceleration rate is limited by the available torque at rpm of your max velocity.

Servos won't stall, but they'll fault.

If the position monitored by the encoder is too far from the commanded position, the drive will fault. Typically, the machine is configured to shut down all axis when a fault occurs.

The bottom line, is that you can only go as fast as your motors are capable. For a truly rliable machine, the motors should be capable of moving the machine 30%-50% faster than it will ever be used.


That all makes sense. So it is all about reading the comparative torque curves after realizing that generalization.

Let me just see if I got this fully correct... Lets say I am aiming for a reliable 500ipm, so I want to size the motors for around 1000ipm. 1,000ipm with my gear reduction is 955 rpm at the motors. I know that this motor is a strong match for the machine, so I will use it as a baseline: http://www.cncrouterparts.com/cdata/cad ... _curve.pdf

Using interpolation, at 955rpm this motor outputs 199 oz-in.

Looking at this motor, at 955rpm, the motor appears to be putting out close to 250 oz-in. https://www.teknic.com/model-info/CPM-S ... voltage=75

Assuming I bolt the motor to the same gear reduction, this servo motor will outperform the motor designed for this machine because the torque at peak speed of the servo is higher than that of the stepper even though the stepper beats it at lower speeds, because the acceleration has to stay linear to maximum velocity. Is that all correct?

Also, if I can figure out a backlash-free way to further increase the gear reduction, I may also be able to get even more torque available at peak speed on this servo motor if the torque doesn't drop off too fast at the higher rpms. Correct as well?

I rest my case ;)

If your encoder has 1000 counts per rev, I suggest you set the alarm threshold around 1/4 turn or 250.

Can I guess that you are driving 5mm pitch ballscrews? If so, put on 10mm pitch units, its that simple


I am actually using rack and pinion with a 3:1 gear reduction on the X&Y axes. Those are the axes I am most concerned about at the moment. Knock on wood, I don't seem to have an issue with my Z axis. My Z is using 1/2-10 leadscrew, so if I am understanding correctly, I am already pretty close to the 10mm pitch right?
drxlcarfreak
 
Posts: 27
Joined: Tue Jun 26, 2018 2:51 pm

Next

Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: No registered users and 17 guests