dcservo icon indicating copy to clipboard operation
dcservo copied to clipboard

Can i use a encoder with step only instead of a quadrature encoder

Open Animalrsa1 opened this issue 6 years ago • 23 comments

Good day, many thanks for making your work public, i was wondering if it would be possible to use a step only encoder (no direction) with your project to control the position of large dc motor, ramps will still send its normal step and dir but the closed loop will only be on steps, is this possible?

many thanks Tony

Animalrsa1 avatar Aug 06 '18 16:08 Animalrsa1

Hi @Animalrsa1,

It is not possible.

A tachometer gives you information about motor speed but not direction.

A position control needs to know the direction of each motion to be able to accurately track motor shaft position. Without that, it won't work.

You could use that for a speed control though.

misan avatar Aug 06 '18 16:08 misan

Hi

many thanks for the swift response, if possible could you assist with a cost effective solution to a quadrature encoder. i want to use wiper motors to move my mill.

thanks again

tony

Animalrsa1 avatar Aug 06 '18 16:08 Animalrsa1

You can get a relatively inexpensive one online: https://es.aliexpress.com/store/product/Encoder-600P-R-Incremental-Rotary-Encoder-AB-phase-encoder-5V-24V-Two-Phases-Shaft/3105031_32851443854.html

misan avatar Aug 06 '18 17:08 misan

Hello, lemme say, i tried that, bo matter what you do the motors are slow and will overheat fast, if ur pid is too low they wont move properly, if u go higher so ur motor spins up right, it will overheat . U coud drill holes in the motor and cool it by forcing air trough, but u coud try either try servo motor from say a opel corsa steering or bmw x5 compressor motor, etc. I just got some oldschool dc motors wich have 4 huge brushes and rotor, they have about 500 watt, got them at the junkyard. And i used ibt_2 h bridges. Hope this helps.

PaulRobert1 avatar Oct 18 '18 14:10 PaulRobert1

https://www.ebay.co.uk/itm/AEDR-8300-Series-Encoders-Reflective-Surface-Mount-Optical-Encoder-2-channe-W1V8/123276004045?epid=8006938605&hash=item1cb3d28acd:g:XcwAAOSwNDVbW0sH

PaulRobert1 avatar Oct 18 '18 14:10 PaulRobert1

Cheap encoder link, u have to make the disc, i made it with a 3d printer

PaulRobert1 avatar Oct 18 '18 14:10 PaulRobert1

And mirror on the other side, and disc must b thin

PaulRobert1 avatar Oct 18 '18 14:10 PaulRobert1

If I'm reading the datasheet right on the AEDR-8300, the code wheel will need to be 8.35 lines/mm (212 LPI), which seems like it would be somewhat difficult to print.

Kadah avatar Oct 19 '18 20:10 Kadah

You could go with as many lines as u can, like i did to test and get used to the whole thing until u scavange the real deal :) here s another link to a encoder

PaulRobert1 avatar Oct 20 '18 04:10 PaulRobert1

https://www.ebay.co.uk/itm/NEW-5V-24V-Encoder-600P-R-AB-2-phase-6mm-Shaft-Incremental-Rotary-Encoder-WD/292424483269?epid=11011024104&hash=item4415db81c5:g:jWUAAOSwyH9aKQVL

PaulRobert1 avatar Oct 20 '18 04:10 PaulRobert1

U got to open it, inside u will find 2 empty pads ready 2 solder components, solder 2 4k7 resistors on the pads before giving it a go.

PaulRobert1 avatar Oct 20 '18 04:10 PaulRobert1

With 3d printed encoder disk i managed to get a precision of 0.1, wich isnt that bad taking into account the disk precision

PaulRobert1 avatar Oct 20 '18 04:10 PaulRobert1

Or go to the scrap yard and get encoder strips from old plotters

PaulRobert1 avatar Oct 20 '18 04:10 PaulRobert1

I believe I have the same issue. I stumbled upon this project in the hopes that the controller could be used to build a controller system for a Pegasus robotic arm. The vendor that made the arm (it's a "educational robot") isn't much help as they won't share any specifics about the computer control setup (which I'm lacking here). I picked up a nvcmv2.1 and was able to drive the motor on the x axis forward and backwards. The problem is the encoders on these motors are a very fine incremental/step encoder rather than a absolute. The motors themselves have easy access to the encoders. It's just a set screw that holds the disc on. And two screws that hold down the encoder. Is there a encoder I could retrofit onto the backend of the motor to convert it over to a quadrature encoder? I saw a link above for one, but that's really a sealed unit that couples to the shaft. I was hoping for a simple disc and new sensor to convert it. I can get more measurements of the disc diameter and the mounting holes of the sensor. The shaft is only about a 1/8" diameter or a little more.

Edit: would one of these work? https://www.ebay.com/itm/223514147915

I think I could likely drill out the disc to fit the shaft. And 3d print a holder for the sensor setup.

patracy avatar Jun 30 '22 23:06 patracy

@patracy: an incremental encoder usually provides a quadrature output, that can be used to obtain an absolute position if you pair that with a way to detect a reference [home] position when booting up. The encoder you linked is a low-resolution unit (only 12 pulses per revolution), it is an incremental encoder, and it provides a quadrature output too.

Alternatively you can use Magnetic encoders to obtain an absolute position (angle), like the AMS5600: https://ams.com/as5600

misan avatar Jul 01 '22 06:07 misan

I have tried the dcservouno sketch. But it acts very strangely. The motors I have have a HEDS-9000 encoder on them. They have a 500cpr on them. When I power up the arduino I get nothing out of the serial port. But when I disconnect the encoder A/B leads, it will then provide the menu. I can then reattach the AB leads and I am able to home it. Set to T mode and it will randomly move as expected. I was having jitter at home when I first started it but I put P down to 1 and it seems to be behaving now. Is this encoder setup going to be too much for the mini as far as counting goes? I know it's going to be excessive since it's a gearmotor setup on the number of counts.

https://docs.broadcom.com/doc/AV02-1867EN

patracy avatar Jul 01 '22 23:07 patracy

I think maybe the encoder setup is just simply too much for this. It's 500cpr on the motor shaft side of things, feeding a gearbox. I bought this cheapo DC motor/encoder just to try it out and it behaves just fine it would seem. I'm going to try a hall effect encoder like it has on the style motor I have and see if that would help.

https://www.amazon.com/dp/B0833X3KY3?psc=1&ref=ppx_yo2ov_dt_b_product_details

patracy avatar Jul 05 '22 12:07 patracy

You can always not power the motor and move the motor shaft by hand (while the encoder is powered and connected). The "?" command on the serial port will show you whether the location changes or not (useful for troubleshooting).

Please note the motor you linked has a low-resolution encoder, which is not a problem and due to the gearbox you should get a nice resolution. However ... that encoder measures the motor shaft and not the output shaft, which means that any amount of play in the gearbox can ruin the accuracy of your measurement anytime there is a direction inversion.

misan avatar Jul 05 '22 12:07 misan

The time to get encoders vs the cost I picked up some AS5600 encoders. I'm using a nano. I tried flashing the magnetic encoder firmware, but I get a bad checksum error when I connect to it over the serial port. (I think it was the mega version, I do recall it warning about stability when I flashed it due to low space) I tried to compile the pro micro mag encoder under the nano, but it gives me PINF related errors. So I simply set it to micro. I've ordered some pro micros that should be in tomorrow. ( https://www.amazon.com/dp/B08THVMQ46 ) I'm going to give that a try with the magnetic encoder setup. Otherwise I'll order some more hall effect encoders and wait for those. Since I know that works.

patracy avatar Jul 07 '22 21:07 patracy

The checksum error is about the EEPROM storage not being initialized. Once you use "W" command this should go away.

misan avatar Jul 08 '22 07:07 misan

It's unresponsive when I try to type anything. The L led goes solid.

patracy avatar Jul 08 '22 13:07 patracy

when using an I2C encoder if it becomes unresponsive it seems there is a problem with I2C communication, you should check your circuit with i2c scan code you can find online. https://create.arduino.cc/projecthub/abdularbi17/how-to-scan-i2c-address-in-arduino-eaadda

On Fri, Jul 8, 2022 at 3:18 PM patracy @.***> wrote:

It's unresponsive when I try to type anything. The L led goes solid.

— Reply to this email directly, view it on GitHub https://github.com/misan/dcservo/issues/52#issuecomment-1178980239, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADRZSDMP6TRG3TMKRV37UDVTATC7ANCNFSM4FOCVYDA . You are receiving this because you commented.Message ID: @.***>

misan avatar Jul 08 '22 14:07 misan

Please note the Arduino cannot handle very high interrupt rates, so it may only work for low speeds if you have a high-resolution encoder. You may want to lower the motor voltage to see if you can move within a low-speed range for it to work.

On Sat, Jul 2, 2022 at 1:58 AM patracy @.***> wrote:

I have tried the dcservouno sketch. But it acts very strangely. The motors I have have a HEDS-9000 encoder on them. They have a 500cpr on them. When I power up the arduino I get nothing out of the serial port. But when I disconnect the encoder A/B leads, it will then provide the menu. I can then reattach the AB leads and I am able to home it. Set to T mode and it will randomly move as expected. I was having jitter at home when I first started it but I put P down to 1 and it seems to be behaving now. Is this encoder setup going to be too much for the mini as far as counting goes? I know it's going to be excessive since it's a gearmotor setup on the number of counts.

— Reply to this email directly, view it on GitHub https://github.com/misan/dcservo/issues/52#issuecomment-1172789694, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADRZSAOZNAJCBNIEML7OLTVR6A2RANCNFSM4FOCVYDA . You are receiving this because you commented.Message ID: @.***>

misan avatar Oct 11 '22 08:10 misan