Re: Mechaduino Closed-loop Stepper December 04, 2016 09:58AM |
Registered: 9 years ago Posts: 5,232 |
Quote
My main goal for the homing is for bed leveling, this way the nozzle would be used to measure the bed height and you would have perfect bed leveling.
Re: Mechaduino Closed-loop Stepper December 04, 2016 12:26PM |
Registered: 8 years ago Posts: 20 |
Re: Mechaduino Closed-loop Stepper December 04, 2016 12:29PM |
Registered: 11 years ago Posts: 564 |
Quote
trampas
The code does implement phase advancement which in simple terms, allows dynamic step size on the stepper motor. That is the driver code for the A4954 implements 256x microstepping, while I have normally been running the external interface at 16x microstepping. So what happens is when a user requests a step internally the firmware calculates what the desired angle is, then it measures the current angle using an encoder and compares to the desired angle. It will then move the motor the difference to achieve the desired position. What this means is that if the error is large (fast movement) it will take larger steps, if error is small it will take smaller steps.
Re: Mechaduino Closed-loop Stepper December 04, 2016 12:39PM |
Registered: 11 years ago Posts: 14,685 |
Quote
trampas
That is correct, using the motor for Z homing would be hard with a delta.
Trampas
Re: Mechaduino Closed-loop Stepper December 04, 2016 03:49PM |
Registered: 8 years ago Posts: 20 |
Re: Mechaduino Closed-loop Stepper December 04, 2016 05:27PM |
Registered: 11 years ago Posts: 564 |
Quote
trampas
LoboCNC,
I am changing the current on the Vref1 and Vref2 pins such that I have 256x microstepping at the A4954 driver level. Thus I can can adjust the motor for very small errors, less than 0.01 degrees, the A4954 driver also lets me change the current (torque) (ie magnatude) going to motor. So I can move with a lot of current one microstep or a small amount of current one microstep. From a hardware perspective this means I need more than 8 bits on the Vref ADCs (bug in early versions of Mechaduino firmware). Since I can control the step size and current to the motor it allows me to implement multiple control loops.
The default control loop out of the box is a very simple control loop where I command forward/reverse steps to minimize the error, when the error is low the controller switches to the "hold current" to lower power, heat and noise. This control algorithm is not the "optimal" for any given machine but works with most machines out of the box without tuning. That is it is simple and will work for most applications. It is a PID controller and you can change the parameters, but the control variable is the step size. Inititally the P term is 1.0 and the I and D terms are really small. So this can be thought of as simple control loop where if we have error we move until the error is near zero, hence the "simple" control loop. The I is small to adjust for long term errors, the D term just helps a bit with the stablity. However the default values should be good enough for most system, but depending on the load it might have to change.
I also have a positional PID control loop where you can tweak the PID terms and tune your machine. This basically the same as the mechaduino's positional control loop. This loop controls the current to the motor, rather than step size such that motor behaves more like a DC servo. This can have the lowest power and heat when tuned correctly. However the tuning is highly dependent on your machine.
Trampas
Re: Mechaduino Closed-loop Stepper December 04, 2016 05:46PM |
Registered: 9 years ago Posts: 1,671 |
Re: Mechaduino Closed-loop Stepper December 04, 2016 05:56PM |
Registered: 11 years ago Posts: 564 |
Re: Mechaduino Closed-loop Stepper December 04, 2016 06:43PM |
Registered: 8 years ago Posts: 20 |
Re: Mechaduino Closed-loop Stepper December 04, 2016 08:05PM |
Registered: 11 years ago Posts: 564 |
Quote
trampas
I was confused over what you were calling phase advance, I think I understand now. I do not do this currently as my goal was not maximum motor speed, but rather positional accuracy.
Is there a need for such speeds? I had figured most people would be happy with full stepping speed, and microstepping accuracy.
Re: Mechaduino Closed-loop Stepper December 05, 2016 06:33AM |
Registered: 9 years ago Posts: 5,232 |
Re: Mechaduino Closed-loop Stepper December 06, 2016 01:26PM |
Registered: 11 years ago Posts: 564 |
Quote
o_lampe
I see the biggest benefit of closed loop steppers in the possibility to use smaller/lighter steppers for direct drive extruders with gears ( say you want to build a mini-E3d Titan with even smaller stepper )
Can you confirm this?
Re: Mechaduino Closed-loop Stepper December 06, 2016 01:39PM |
Registered: 8 years ago Posts: 20 |
Re: Mechaduino Closed-loop Stepper December 07, 2016 01:18AM |
Registered: 9 years ago Posts: 5,232 |
Re: Mechaduino Closed-loop Stepper December 07, 2016 01:46AM |
Registered: 11 years ago Posts: 564 |
Quote
o_lampe
My above mentioned question was also related to geared steppers and the chance to eliminate backlash with an encoder on the output side.
Re: Mechaduino Closed-loop Stepper December 08, 2016 05:52PM |
Registered: 9 years ago Posts: 25 |
Re: Mechaduino Closed-loop Stepper December 08, 2016 06:32PM |
Registered: 8 years ago Posts: 20 |
Re: Mechaduino Closed-loop Stepper December 08, 2016 07:05PM |
Registered: 11 years ago Posts: 564 |
Quote
kr_
1 - Missed steps when the nozzle hits a bump that sometimes appears when doing top infill (I don't want to lift the nozzle or slow down both the travel and the top infill speeds for the whole part so I currently edit the Gcode to reduce the feedrate for the problematic layers only...)
2 - Missed steps when fast solid infill moves hit a natural frequency (resonance) of the Y axis.
Re: Mechaduino Closed-loop Stepper December 09, 2016 12:53PM |
Registered: 11 years ago Posts: 14,685 |
Quote
LoboCNC
1. If the nozzle hits a bump (some errant bit of filament) the X or Y motor will be pushed out of position. With open-loop control if it gets pushed out by more than 1 full-step, then you'll never recover and forever have shifted print layers.
Re: Mechaduino Closed-loop Stepper December 09, 2016 12:58PM |
Registered: 8 years ago Posts: 20 |
Re: Mechaduino Closed-loop Stepper December 09, 2016 01:55PM |
Registered: 11 years ago Posts: 564 |
Quote
dc42
Quote
LoboCNC
1. If the nozzle hits a bump (some errant bit of filament) the X or Y motor will be pushed out of position. With open-loop control if it gets pushed out by more than 1 full-step, then you'll never recover and forever have shifted print layers.
Actually it needs to slip by 4 full steps, although something that blocks motion for just 2 full steps or more will cause that to happen. But correct otherwise.
Re: Mechaduino Closed-loop Stepper December 09, 2016 02:19PM |
Registered: 8 years ago Posts: 20 |
Re: Mechaduino Closed-loop Stepper December 09, 2016 05:05PM |
Registered: 9 years ago Posts: 25 |
Quote
LoboCNC
1. If the nozzle hits a bump (some errant bit of filament) the X or Y motor will be pushed out of position. With open-loop control if it gets pushed out by more than 1 full-step, then you'll never recover and forever have shifted print layers. With closed-loop control, though you'll end up with a minor defect in your print, but the motor will eventually recover to the proper position and the rest of your print should be OK.
Quote
LoboCNC
2. Open-loop steppers are highly susceptible to resonances, as the magnetic detents that form the stable step positions act like mass-spring systems which have a specific resonant frequency. If you get to oscillating and the magnitude of the oscillation grows to more than one full step, again, you will never recover. Closed-loop control, however, is constantly modulating the current so you don't get the same sorts of fixed-frequency resonances that can grow pretty large. Also, if you do happen to hit some resonance that produces large errors, the motor will eventually recover its position after you stop exciting the resonance.