#5160 Rotary encoder support

1 messages · Page 1 of 1 (latest)

young sandal
#

So, im asking to see how i could connect rotary encoders to my 5160s as apparent they support that, if anyone knows whats going on feel free to drop in, heres documentation from trinamics website

undone fossilBOT
#
AI Help

To connect rotary encoders to your TMC5160s, you need to follow the pin configuration mentioned in the TMC5160 datasheet or the Trinamic website. You can use any of the available four quadrature encoder interfaces (ENC0, ENC1, ENC2, and ENC3) provided on the TMC5160 to connect rotary encoders.

To connect the rotary encoder, you need to connect its A and B signals to the encoder inputs of your TMC5160. Also, you need to connect the encoder's index (Z) signal to the corresponding encoder index input of the TMC5160. To use the encoder interface, you'll also need to configure the encoder interface's necessary parameters in the TMC5160 registers, such as encoder resolution count per revolution, direction, etc.

For a more detailed description, you can refer to the TMC5160 datasheet or the Trinamic website. If you face any issue while connecting or configuring the rotary encoders, feel free to ask.

young sandal
#

wow chatgpt is good at this stuff

ionic edge
#

Yeah, seems like some manufacturers call index channel N, I thought that it's bad enough that index could be called either Z or I

young sandal
#

this is the chip im using

ionic edge
#

I wonder what's the Index channel for here

young sandal
#

i see ENCB_DCEN is encoder B and ENCA_CDIN is encoder A right?

#

just dunno what index channel is

ionic edge
#

Yep

young sandal
#

im using “datasheet” off here

ionic edge
young sandal
#

ah ok

#

oh

#

index is DC0 apparently

#

you also mentioned a relay when splitting the signal from the encoder? could you please elaborate on that

ionic edge
#

Now, encoders can have channels and also inverted (with – above the letter), inverted channels are worth it as then you can do differential pair on the wiring and limit the noise

ionic edge
young sandal
#

ah, is that dependent on the encoder i choose?

ionic edge
#

You can use buffer with one with inverted channels but it defeats the point of using inverted channels

young sandal
#

what would be a good omron encoder for this application? if price was not important

#

and what would go into choosing one

ionic edge
#

Check if TMC is limiting pulse rate or CPR first

young sandal
#

what does “software controlled” correction of step loss mean

#

meaning set in the register?

ionic edge
#

Hmm, I'd have to read into it, alternative version is to use cheapo encoder and just test

young sandal
#

i think im getting ahead of myself

#

dc step is a “mode” or communication interface?

#

also found this in regards to the encoder poll rate

#

125us

#

so hears what i understand

#

comparator makes signal integrity better if i use inverted channels, but if the 5160 expects uninverted i need to use an inverter?

#

or repeater if normal channels for good signal integrity?

#

so i can use a repeater/comparator before i go into the wago and before it goes into the chip?

#

oh no i get it now

#

comparator converts differential signals into single ended signals, repeater amplifies signal

#

so i need a comparator on A1 and A2 to make A going into 5160, and B1 and B2 going into a comparator to make B

#

Index is just its own thing snd i need a repeater

#

seems like a job for a pcb!

#

sad waterrot didnt hook up these and i needa solder directly to the chip

young sandal
#

ive landed on omron encoder e6b2-cwz6c 1800p/r

#

seems good?

ionic edge
young sandal
#

would it be better with?

ionic edge
#

But yes, you use differential pair with inverted channel to have better signal integrity and right next to the input of the chip you put a comparator to filter it and make it into single signal

ionic edge
ionic edge
young sandal
#

the encoder i picked out doesnt have differential signals

#

should i pick one with?

young sandal
#

but fast accelerations

#

its under its max of 100r/s

ionic edge
#

Ok, so 1500mm/s with 32mm/rev gives ~49rev/s, with 1800 p/r you get 88200 Hz, so whole cycle is 11.3us, pulse is 5.6us

young sandal
#

40mm/rev

#

60rev/s

ionic edge
#

Then 7us pulse length

young sandal
#

yeah

ionic edge
#

That's a bit lower than 125us

young sandal
#

too fast?

ionic edge
#

Too high resolution

#

Hmm, but that's for STEP impulse it seems

young sandal
#

so i need a rotary encoder with less p/r?

#

wont is be less accurate?

#

around 100p/r

#

for ~125

ionic edge
#

Find a section that specifically tells about encoder timing as the one you sent with 125us pulse is for STEP in DcStep

young sandal
#

clock speed 12mhz

#

8MHz

#

so then its still too much

ionic edge
#

8MHz gives you 0.125us so you'd be fine with 1800 ppr

young sandal
#

thats why its 0.125us

ionic edge
#

No, 8MHz encoder counting frequency

young sandal
#

how would i find that

ionic edge
#

And encoder output frequency is ppr × rev/s

young sandal
#

so 1800 is not fine

#

i think ill go with 1000p/r

ionic edge
#

1800 is perfectly fine as with 37.5 rev/s you get 0.068 MHz which is lower than 8 MHz

young sandal
#

ah

#

even with 60 rev/s its still far under 8MHz right? so it should be fine

#

in that case more resolution more better?

#

i can get upto 2500p/s

#

also, do you know of a repeater pcb that also splits into 2 outputs

ionic edge
#

I'm not sure if this style encoder is the way to go

young sandal
#

what would you suggest?

ionic edge
#

Some magnetic ones get output with AB, have 12+ bit resolution and are cheaper, mostly Osram AMS

young sandal
#

price doesnt really matter. Would they be more accurate?

#

Also why would you recommend them over this

#

1800 is perfectly fine for me, its already a 8th microstep

ionic edge
young sandal
#

how much longer would they last over an optical encoder like this?

ionic edge
#

Optical ones usually are limited by bearing lifespan and this depends on how well you mount them

young sandal
#

would i expect more than 10k hours on this one if mounted correctly?

ionic edge
#

You'd need a longer shaft or double sided shaft to mount though

young sandal
#

im planning on using a coupler

ionic edge
#

Which coupler?

young sandal
#

ok wow that is not long

#

450 hours under max load

#

minimum life expectancy

young sandal
ionic edge
young sandal
#

whats the one they slap at the back of steppers? or in servos?

ionic edge
# young sandal undecided yet

Couplers introduce kinematic inaccuracies which means that if you use wrong ones or use them wrong, you'll introduce errors

young sandal
#

ah ok

ionic edge
young sandal
#

hrmm interesting

#

also note i plan to not put these encoders directly on the motors

#

they will be belt driven

ionic edge
#

Oh no

young sandal
#

they are for rough positioning vaulthah

ionic edge
#

1800 PPR isn't rough positioning

young sandal
#

i can put em on the motors themselves tho

#

no problem with that

ionic edge
#

Then why would you plan on belt driving them?

young sandal
#

it was easier

#

because i wouldnt need to buy 80mm shaft motors

crisp fiber
#

Why do you want to do this ?

ionic edge
#

Worry not, you'll need machined parts to mount it correctly as you won't hit this spec with prints

young sandal
#

apparently 5160s can support rotary encoders so i wanted to ask about it since i already had some

crisp fiber
#

It’s generally a myth that closed loop is better for 3D printers

young sandal
#

for a certain fast boat race vaulthah

ionic edge
young sandal
#

rules state “must be stepper powered” no limits on closed loop

#

it is powered by stepper motors

crisp fiber
#

I still don’t know why you need a closed loop stepper - it’ll either step or it won’t. Closing the loop won’t help

undone fossilBOT
#
This post has been closed due to inactivity.

This post has been inactive for over 1 hour and so has been closed. To reopen this post simply send another message.

young sandal
#

when the rotor lags behind

#

the way dcstep works is it automatically finds the highest speed it can step back at without skipping and steps back to the desired position

#

the reason i set the limit at 1.5m/s is because thats the point where the phase resistance and back emf overcomes 48v and no longer makes torque (with my motors)

#

the way the steppers step is they appromimate a sine wave to get a motion

#

sometimes when the wave is off or there is a sudden back emf spike it will be too much to overcome and the motor will “skip”

#

see this simulation

#

when the peaks get to low the motor will lose steps, thats why i want to put a rotary encoder in there t

#

thats why the motor wont lose steps 100% of the time and just some of the time

young sandal
#

this is closed loop

#

stepper motors

#

wondering if i should just get these instead of super powers