Welcome! Log In Create A New Profile

Advanced

Tracking Axis movement with Rotary Encoders

Posted by Celcius1 
Tracking Axis movement with Rotary Encoders
April 30, 2017 09:27AM
Hi Guys,

I'm currently building my own CoreXY printer, as my Geeetech clone is on its way out so using one last time to build my next printer.

Now I want to see if i can get rid of using end stops and replace them with rotary encoders to accurately track the axis position (alleviating the need for regular re-calibration), looking to use these optical encoders [www.ebay.com.au]

My Question is, what input do I use on the board to read the pulses from the encoder, also is there a routine in Marlin that can read this input, or am I looking at making a modification to marlin myself.

Talk Soon
Paul (Celcius1)
Re: Tracking Axis movement with Rotary Encoders
April 30, 2017 10:35AM
There are quite a lot of posts on this forum about various closed loop system some using 2d inkjet printer encoder strips, and others using hybrid servo motors or dc motors with encoders. Whilst it will be nice to get rid endstops potentially (although are they really that much trouble?) it often comes back to the same argument, if your stepper motors don't skip steps then you don't gain anything by going over to closed loop, unless you plan to use cheap DC motors to make a low cost printer instead of steppers. I don't know much about them but do rotary encoders enable absolute position to be determined or only relative position? If its relative position then you are not going to be able to do away with the endstops.

I don't think any of the main firmware offerings support encoders or closed loop control natively but you can use step/dir/enable signals to feed various external motor controllers.

Edited 1 time(s). Last edit at 04/30/2017 10:56AM by DjDemonD.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: Tracking Axis movement with Rotary Encoders
April 30, 2017 03:04PM
Rotary encoders still need 0 calibrated, so you would still need an end stop. You just get absolute positioning from them as long as the sensor is quick enough and the encoder has high enough pulses and your motion system can move with accuracy to match the encoder. I used to rebuild HID that used optical rotary encoders for position. The software that used them needed you to put the controls to a 0 position when initializing, kind of like the analog joystick on game consoles. The problem is that if you move too quickly, or dust gets on the wheel then you lose accuracy with optical encoders as they can skip/add pulses.

I think I saw settings for encoders in marlin, I haven't started toying with them yet though so I'm not sure if I am imagining this or not.
Re: Tracking Axis movement with Rotary Encoders
April 30, 2017 03:21PM
So a rotary encoder on each of the core XY motors?
Seems a rather complex algorithm required to determine X, Y position?

Encoder can do 2400 pulse / rev
will that detect missed steps, calibration?

Will the encoder be useful at the speeds of the motors / belts?

Perhaps intelligent encoder driver / decoder
and a powerful computer to run firmware / software

End stop -- even the most expensive
-- may be much better, less complex, and a lot less frustration?
confused smiley
Re: Tracking Axis movement with Rotary Encoders
May 01, 2017 01:51AM
I only have an endstop on z-axis on my CoreXY. ( and jumpers on the controller for X and Y endstop )
I have to push the gantry home after an unfinished print, but the end code in my slic3r includes G1 X0 Y0, so it is ready for the next job.
Re: Tracking Axis movement with Rotary Encoders
May 01, 2017 02:08AM
Well to add I am working on an ultrasonic endstop using a 1.7mhz transducer to measure down to approx 10 to 5 um.

I'll use this to get the absolute position at all times, and for self calibration. and see if it works for bed levelling too.

But at this stage it's at design stage.
Re: Tracking Axis movement with Rotary Encoders
May 01, 2017 04:36PM
First post "get rid of endsops"
Last post "working on an ultrasonic endstop using a 1.7mhz transducer to measure down to approx 10 to 5 um"

Doesn't sound like getting rid of endstops ---- 5 to 10 millionth of a meter?
Is printer mounted on granite block to keep it from moving a one millionth of a meter as you walk by?

confused smiley
Re: Tracking Axis movement with Rotary Encoders
May 01, 2017 07:54PM
Endstops are not very important in cartesian printer x and y axes, return to 0,0 after a print and if you have an accurate z probe (which is an endstop anyway) then you're there. If you have a flat, physically levelled bed then an endstop switch might suffice (with babystepping for fine tuning) or perhaps even a hard physical stop to set the bed to, but you'd need to be very precise in your build, endstops are a convenience and they work fairly well for little cost or hassle.

Deltas on the other hand require endstops unless you really want to do everything the long, slow way. Sure you can use hard stops and do everything else in software, but the convenience is worth having them.

Piezo endstops are possible now and could give at least 10 micron accuracy possibly better, but unless it's for a delta it's unnecessary, and optical surely manages this accuracy too and is tried and tested and readily available.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: Tracking Axis movement with Rotary Encoders
May 02, 2017 01:31AM
Sorry I was typing my last message whilst driving, the ultrasonic detector I am designing is more a readily available distance mesausre than an endstop and the accuracy is actually 0.15mm to 0.1mm.

The idea is, the arduino can get an accurate reading of the absolute position of the axis, so I can write a calibration routine into the firmware that using the ultrasonic sensors for the distance feed back, so the arduino can calibrate it's step rate it self and not have the painstaking task of using either calibration prints or marker and vernier gauge to calibrate your step rate. Also using it to do bed autolevelling but I'm investigating if I can have it scan the bed instead of testing it at seperate points and ascertain a more accurate picture of the bed surface

Talk Soon
Celcius1
Re: Tracking Axis movement with Rotary Encoders
May 02, 2017 08:20AM
Quote
Celcius1
Sorry I was typing my last message whilst driving, the ultrasonic detector I am designing is more a readily available distance mesausre than an endstop and the accuracy is actually 0.15mm to 0.1mm.

The speed of sound in air varies with temperature by almost 0.2% per degC at room temperature. So to achieve 0.1mm accuracy over distances that are not very short, you will need to control the temperature precisely.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Tracking Axis movement with Rotary Encoders
May 02, 2017 02:16PM
I'm trying to devise a simple method to test endstop repeatability that does not rely on a z probe at the other end of the travel, and can be done using the 3d printers we current have rather than specialised test rigs. At the moment it consists of clamping something firmly to the axis a few cm from the endstop. Homing then moving to the clamp recording the distance travelled, then homing and repeating. Either that or going back and two between two identical endstops at either end of the axis, but this is less neat and doesn't work on deltas.

0.1mm accuracy does not sound particularly impressive I'd be looking for something around 10 times more accurate to be genuinely impressed. We're limited by microsteps (and the fact that they have to accumulate to get actual motion). Leadinglights measured the delay to the controller registering a trigger as about 1ms so figures that 5 microns might be a limit a a result of this delay.

Open to suggestions though?


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: Tracking Axis movement with Rotary Encoders
May 02, 2017 03:17PM
Add a dial gauge mount to the axis in question or extruder carriage. Zero the gauge, move the axis away, then move it back and see what the gauge reads. You can easily print gauge mounts that are rigid enough to do the job.





https://vimeo.com/142670595


Ultra MegaMax Dominator 3D printer: [drmrehorst.blogspot.com]
Re: Tracking Axis movement with Rotary Encoders
May 02, 2017 03:21PM
That's a good approach I'll look into it thank you.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: Tracking Axis movement with Rotary Encoders
May 04, 2017 09:27AM
Any way to use a laser to determine the position?
Re: Tracking Axis movement with Rotary Encoders
May 04, 2017 07:24PM
Quote
paulo_silver
Any way to use a laser to determine the position?

Not with 0.1mm absolute accuracy.

Edited 1 time(s). Last edit at 05/04/2017 07:25PM by dc42.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Tracking Axis movement with Rotary Encoders
May 04, 2017 07:31PM
Are there any example of built printers that use rotary encoders. I thought there were some stepper motors with rotary encoders built in? Or, actually, are stepper motors sort of rotary encoders themselves, since they move in discrete steps and if you turn them they will generate voltage on alternating pins?
Re: Tracking Axis movement with Rotary Encoders
May 05, 2017 12:41PM
I'm pretty confused as to what is being asked in this thread. Rotary encoders don't provide any information a stepper does not already have unless the stepper is stalling or otherwise missing steps.

Quote

[...] So the arduino can calibrate it's step rate itself and not have the painstaking task of using either calibration prints or marker and vernier gauge to calibrate your step rate.[...]

The steps per millimeter is a simple one-time calculation (step angle of motors * diameter of pulley) and does not change over time. Even if you had a rotary encoder the math remains because the encoder is coupled to the axis via the same mechanism as the motor.



The problems you are trying to solve (such as printers needing continuous calibration) are caused by sloppy builds with poor rigity. Switching stepper motors with servos will not fix belt stretch or frame sag.

There is something to be said for linear encoders, but the reality is that on an average printer the frame/belt are the biggest sources of error by several orders of magnitude. Adding linear encoders to a low-end printer is like blowing out a candle while your house is on fire.


That being said, I am currently building a printer with 10 nanometer encoders on each axis: [imgur.com]
It has a build volume of 6x6x8" and weighs over eighty pounds.
Re: Tracking Axis movement with Rotary Encoders
June 07, 2017 12:21PM
Looks like it cost a few bob more than my Gozilla, but it is a beast of a machine.
Re: Tracking Axis movement with Rotary Encoders
June 07, 2017 08:53PM
Quote
691175002
I'm pretty confused as to what is being asked in this thread. Rotary encoders don't provide any information a stepper does not already have unless the stepper is stalling or otherwise missing steps.

Quote

[...] So the arduino can calibrate it's step rate itself and not have the painstaking task of using either calibration prints or marker and vernier gauge to calibrate your step rate.[...]

The steps per millimeter is a simple one-time calculation (step angle of motors * diameter of pulley) and does not change over time. Even if you had a rotary encoder the math remains because the encoder is coupled to the axis via the same mechanism as the motor.



The problems you are trying to solve (such as printers needing continuous calibration) are caused by sloppy builds with poor rigity. Switching stepper motors with servos will not fix belt stretch or frame sag.

There is something to be said for linear encoders, but the reality is that on an average printer the frame/belt are the biggest sources of error by several orders of magnitude. Adding linear encoders to a low-end printer is like blowing out a candle while your house is on fire.


That being said, I am currently building a printer with 10 nanometer encoders on each axis: [imgur.com]
It has a build volume of 6x6x8" and weighs over eighty pounds.

I would like encoder feedback as well. I had hoped that the Tropical Labs servo would work but for a 3D printer application it turns out to be too easy for it to miss STEP pulses since it is software sampled. Maybe the problem could be solved if a simple hard logic device (PLD?) was added outside the controller to be driven by STEP, EN, and DIR. The main reason to have it is a skipping stepper. If the print settings aren't perfect you can have some curling plastic that catches the nozzle and then the stepper will skip. Happening on small prints is a pain, late on a big print is a royal pain. I'm building a printer with a very big print volume and want it to be reliable. Would be great if the printer (or servo) could recover from a skipped step just like what is shown in one of Tropical Labs' videos.

[www.youtube.com]
Re: Tracking Axis movement with Rotary Encoders
June 07, 2017 09:01PM
[www.youmagine.com]


Similar concept but really the same problem. Need hardware in the the interfaces, software sampling can miss pulses.
Re: Tracking Axis movement with Rotary Encoders
July 06, 2017 05:15PM
It's been mentioned before(Mechaduino), but not sure if its been implemented in any other designs yet, Magnetic Encoders like the AS5048A


[www.designworldonline.com]

[www.tindie.com]
Re: Tracking Axis movement with Rotary Encoders
July 07, 2017 12:48PM
The advantages of servos are much more constrained than people think. A servo and stepper of equivalent torque will fail in the same situations, and in practice you should not "recover" missed steps even if it is technically possible to do so.

If a servo is loaded to the extent that it is missing steps, something has gone wrong. Maybe a bearing alignment has failed, maybe your cables are caught, maybe the print has detached from the bed and is jamming the printers motion.

If you chose to ignore faults, at best you complete an (already flawed) print by jumping over extrusion hiccups. But if something more serious has gone wrong you could spend the next four hours at 10x torque grinding the printer to dust.

You should use a servo when you need efficiency, power density, resolution, rigidity, and/or speed. Servos belong in high quality systems, not low quality ones. They are not a band-aid for bad design.
Re: Tracking Axis movement with Rotary Encoders
July 07, 2017 01:52PM
But, sometimes a bit of plastic can caused skip steps... having the ability to get back to even would have advantages..
Re: Tracking Axis movement with Rotary Encoders
July 07, 2017 02:02PM
If a bit of plastic, such as the curled edge of a print, can cause your printer to skip steps, you've got seriously underspecced motors driving the mechanism.


Ultra MegaMax Dominator 3D printer: [drmrehorst.blogspot.com]
Re: Tracking Axis movement with Rotary Encoders
July 07, 2017 04:19PM
Happens on my sets from time to time.. could be belt slippage though, which this wouldn't help.
Re: Tracking Axis movement with Rotary Encoders
August 04, 2017 06:03AM
This appears to be a similar thing to that already shown:

[ooznest.co.uk]

Some industrial servos that I have worked with (indirectly) used a battery back up to allow absolute position tracking in terms of number of turns moved since last zeroing. I'd check if there is isolation of the power and electronics on this board and consider something similar.

End of travel zeroing is still useful for situations like after service or if steps have been missed for what ever reason. The proposal on the systems I worked on was to run the axis at a low speed and torque limit until a hard stop was detected. With encoders attached to the stepper it maybe possible to run at a low current until missed steps are detected and treat that as the new homing routine. You just need to make sure your system can take the torque of the motor running at limited current onto a dead bind.
Re: Tracking Axis movement with Rotary Encoders
September 14, 2017 09:32AM
I have, back in the '90s, made a fairly analogue system on my homebrew CNC wood mill that worked on a multiturn potentiometer. As the (stepper) motor spindle turned, so did the potentiometer spindle. 10mm / turn, 100 turns end to end, 1M potentiometer, 12V system. So, each mm gave 0.012V drop or raise, depending on the direction. Absolute, no homing required. But I never found a potentiometer accurate enough / consistent enough over it's complete range and reading such small differences in voltage proved difficult. Maybe now, 20 years on, we can buy the required stuff from China for a few bucks, but I don't think so... But if you give it a shot, please post the results.

Hugo

Edited 1 time(s). Last edit at 09/14/2017 09:33AM by HugoW.
Sorry, only registered users may post in this forum.

Click here to login