noob question - stepper motor encoder
Hello,
I am totally new to this. I want to mount an encoder to a stepper motor that I recently bought in order to correct missing steps, from time to time.
The motor is this Nema 34 CNC Stepper Motor 13Nm and controls a belt driven linear slide. On the shaft of the motor is a pulley 27 Tooth Timing Pulley, T 10mm Pitch, Aluminum . The motor is control by a drive set at 2000 pulse/revolution, the maximum speed will be 10.000 steps/second. The drive is controlled now by a teensy 3.2 board with AccelStepper library.
I don't know how can I mount the encoder to this and what type I will need. Off course a cheaper solution will be more convenient. I don't want to use a servo motor, I don't need a speed more then the one mention.
Thanks
Re: noob question - stepper motor encoder
Mounting an encoder onto your stepper isn't going to help by itself. You'll need to switch drives to something that supports encoder feedback. If you're doing that anyway, it would make more sense to get rid of the "teensy" drive and get something beefier. - I couldn't find out how many watts you could put through one of those things, but it's probably not enough for your steppers,
Re: noob question - stepper motor encoder
we had drama with a switching powersupply on a doughty drive it would miss steps if we ran full simultaneus too fast, either slow it down or make some upgrades to a toridial style power suppy
Re: noob question - stepper motor encoder
Re: noob question - stepper motor encoder
Quote:
Originally Posted by
awerby
Mounting an encoder onto your stepper isn't going to help by itself. You'll need to switch drives to something that supports encoder feedback. If you're doing that anyway, it would make more sense to get rid of the "teensy" drive and get something beefier. - I couldn't find out how many watts you could put through one of those things, but it's probably not enough for your steppers,
So is not possible to put an encoder and read the impulse with teensy? Are you sure?
Re: noob question - stepper motor encoder
You can read the encoder pulses with a teensy, but then what? All that tells you is whether it is off or not. If the position is not where it is supposed to be then how are you going to get it back to where it is supposed to be? Doing it on the fly is much more complicated than just injecting a few extra pulses. As I understand it, the commercial closed loop feedback steppers can momentarily increase current to the motor, thereby increasing torque for short durations. This is something you can't do with a normal stepper driver. In addition, you would have to have logic to detect the steps and not just inject more steps, but momentarily increase/decrease the step pulse generation and once caught up return it to normal. My guess is that the closed loop drivers have a FPGA or something to perform this task. You could probably hack a standard driver with a piggyback microprocessor and after a lot of testing, code writing, code re-writing... get it to work. In the end all that has already been done and isn't all that expensive. If you want to do it because you like that stuff then that is great, but from an economic standpoint it would not be practical if you count your time worth anything.
Having said the above, If you want to track position with an encoder and somehow check it only occasionally, like in-between code runs every 15 minutes or something, I think that could be implemented easier, but I wonder why you wouldn't just use homing switches and home the machine occasionally if that is your end goal.
Re: noob question - stepper motor encoder
Quote:
Originally Posted by
redpeppery
So is not possible to put an encoder and read the impulse with teensy? Are you sure?
You can if you are a good enough programmer. teensy 3.2 is arm cortex so plenty of processing power to read encoder signals and run a PID loop to "servo control" a stepper motor/driver. You will need to read, understand and implement a working PID for the Teensy. If you don't even know what a PID is then you have many hours of hard work to implement this.
Time vs money
You can spend $150 for leadshine servo driver/servo motor with encoder and be done with it.
Re: noob question - stepper motor encoder
There are, and you can build, stepper motor based closed loop servo systems. It's pretty easy as well...
1. You just take the step and direction signals from the motion controller (PC, RAMPS, whatever) and instead of feeding them into a stepper driver directly, you feed them into a servo controller. That can be a microcontroller like the teensy given the right programming. It needs to track the desired position from the step and direction pulses in one variable, e.g. via an interrupt routine which is triggered by the step, and counts up if direction is one way, down if it's the other.
2. Then that same controller needs to read the encoder and have a second variable tracking the actual position of the shaft. Typically, that is a quadrature signal so you have another interrupt and you count up if it's one phase, down for the other.
3. Now that it knows the current position, and the desired position, it can compare the two and produce step and direction signals that go to the actual stepper motor driver, commanding the motor to turn in the direction that will reduce the error. That comparison can be a simple difference, or something more complex, like a PID.
The source code for my servo controller (which currently produces PWM signals for a standard motor driver) is available and shows how this generally works... It's for a PIC, but that's also a good option for the controller. It would be fairly easy to modify my controller to drive steppers as well.
techref.massmind.org/techref/io/servo/BOBPID.htm
Now... this isn't normally done because: Stepper motors pretty much suck, except for one thing: They don't usually NEED closed loop feedback! So if you have closed loop, you are really better off using DC motors or BLDC's or whatever. More power, lower cost, etc... For a nice list of the good and bad points of each sort of motor, read this page:
techref.massmind.org/techref/io/motors.htm
Re: noob question - stepper motor encoder
Quote:
I don't know how can I mount the encoder to this
Magnetic encoders are easy to mount: You just glue or clamp the magnet to the end of the shaft. Most are very very low speed, but there are some which are fast:
techref.massmind.org/techref/io/sensor/pos/enc/ENC1.htm
Re: noob question - stepper motor encoder
Quote:
3. Now that it knows the current position, and the desired position, it can compare the two and produce step and direction signals that go to the actual stepper motor driver, commanding the motor to turn in the direction that will reduce the error. That comparison can be a simple difference, or something more complex, like a PID.
The problem here is that the stepper has already lost position, most likely because it didn't have enough power. So, if it didn't have enough power to go where it was supposed to go, how s it going to have enough power to make corrections?
Re: noob question - stepper motor encoder
Quote:
Originally Posted by
ger21
The problem here is that the stepper has already lost position, most likely because it didn't have enough power. So, if it didn't have enough power to go where it was supposed to go, how s it going to have enough power to make corrections?
Lost steps are often the result of a momentary failure. Vibration, resonance, binding that clears when shaken, the head hitting something, cutting head bouncing, etc... One lost step almost never causes the motor to just bind in place. Yes, there are stalls that do cause that, but that is the exception rather than the rule.
I do completely agree that the better solution is NOT feedback, but rather a larger or better motor / driver. But not for that reason. If you are going to stay with steppers, get one that has the power to do the job open loop, or switch to non-stepper motors with a servo controller. Putting a closed loop patch on a motor that is only there because it can be open loop is a bad idea.
Re: noob question - stepper motor encoder
I suppose the better question to ask the OP is what model stepper driver, stepper motor, PS voltage and linear stage he is running. Something may be mis matched. We all know that low end drivers do not have anti-resonance capability. Does the OP driver have that.
Re: noob question - stepper motor encoder
Not sure if that motor will give you 7Nm at 300rpm, especially at 60V. You'd have a better chance with 100V.
But generally, those big motors don't have a lot of torque once they start spinning.
When you need that much torque, servos are a much better choice.
noob question - stepper motor encoder
You will need a quadrature encoder mounted to the back of the stepper motor. This will require a dual shaft motor. I like to use ones by USdigital. Usually the E2 or E5 version.
I have used this encoder when a dual shaft isn't available
Slowing 69.16.243.61&c=1&t=42773.7226631944
You mount the magnet on the end of the front shaft with glue and place the board as close as possible to get a reading.
Hookup the encoder to the arm chip and write your code.
Re: noob question - stepper motor encoder
Adding an encoder to an open system is quite easy. You should however look at why you want to do this? Losing steps is often a common belief, but not a reality... especially with micro stepping.
I have made a video here that you might find interesting -
https://youtu.be/b5JD2-hlvtw
Re: noob question - stepper motor encoder
HI Gerry,
NEMA34 8Nm with the HSS86 driver.
the motor goes to position fault whenever home switch is triggered.
Mach3 through LPT to 5 axis BoB.
what could be happening ?