Affordable higher-resolution encoders?

I’m looking into using ODrive for my small CNC mill. I’m intending to put 1605 ballscrews on it and I’m thinking about adding ±3µm linear scales and rotary encoders, if it’s sufficiently budget-friendly.

My thinking is:

  • To give the linear scales a chance at being useful, I need to be able to hold the ballscrew within ~3µm
  • The ballscrew has a pitch of 5mm
  • So I need to hold the ballscrew to within 0.003mm/5mm = 0.0006 of a revolution
  • So I need an encoder with a resolution of around (1/0.0006) * 10 = 16666

That means I’m on the very edge of the standard 14-bit CUI encoders. Plus, I’d like a smoother-running motor if I can get it.

So I’m looking into other possibilities.

I found the more prominent encoders from RLS, SICK, Renishaw and the like but these are generally well out of my price range, e.g. >$200 per piece.

This doesn’t make much sense to me because you can buy a whole servo motor with a built-in 23-bit encoder for less than that, so I went looking elsewhere.

I came across this whole thread over at the Granite Devices community (which mainly seems concerned with building racing simulators) that raised some more options:

  • Tamagawa - purported to have a 23-bit encoder that costs ~$70. Unfortunately I haven’t been able to determine that the particular encoder (TS5700N5401) actually exists. I’m contacting my local distributor to find out what’s available.
  • Yuheng Optics - has a “JKD-4” encoder that supports BISS-C. This one appears to have been used in the simulated racing community on their servo motors. I asked them for a quote for “JKD-4-22PF-G05BL-B-0.3M” (22-bit, 5V, BISS-C) and they gave me a quote for $74.

That brings me to the topic of the main topic of the thread: has anyone been able to find a source of affordable, high-resolution encoders?

Does anyone have experience with the sources I mentioned?

1 Like

I had a look through the ODrive encoder code on Github and it looks like SSI and BiSS encoders aren’t yet supported.

However apparently SSI and BiSS-C can be treated as essentially a really stripped down SPI with nothing but MISO and CLK. That would be all well and good except it wouldn’t allow sharing the SPI interface among multiple encoders.

However the SPI encoder documentation:

The AMT23x family has a hardware bug that causes them to not properly tristate the MISO line. To use them with ODrive, there are two workarounds. One is to sequence power to the encoder a second or two after the ODrive recieves power. This allows 1 encoder to be used without issue. Another solution is to add a tristate buffer, such as the 74AHC1G125SE, on the MISO line between the ODrive and each AMT23x encoder. Tie the enable pin on the buffer to the CS line for the respective encoder.

gave me an idea: override CLK and MISO in hardware (i.e. a separate PCB) with the chip-select pin and a handful of logic gates (SSI requires MISO and CLK to be held HIGH while idle).

But that does make me wonder, if nobody else has cared about high-resolution encoders for ODrive, is ODrive meant for what I’m doing?

CUI is releasing a 20480 cpr version of their AMT10 encoders.

v3 supports CUI, AMT, and MA702 style SSI. It MIGHT support BiSS-C as-is, depending on how exactly it’s wired and what the data packet looks like. Do you have a specific encoder you want to support?

v4 currently plans to support SSI / SPI / BiSS-C and RS485, btw :slight_smile: Subject to change of course.

But that does make me wonder, if nobody else has cared about high-resolution encoders for ODrive, is ODrive meant for what I’m doing?

Yep, it’s good for what you want. People do care about the high resolution encoders, but they tend to be so expensive that people just go to Siemens or Allen Bradley or whatever instead because if you’re building a quarter million dollar mill, do you really care if your servo drivers are $150 or $1000, when each encoder is $500+?

2 Likes

Ah, I didn’t see that. How does one wire an SSI encoder to v3? Does it support more than one? If so, how should I wire it? I’ll need an RS-485 interface of course but I’m guessing I connect it to SPI somehow?

At the moment the JKD-4 encoder I mentioned earlier (link) is looking the most promising, with high resolution and low price.

v4 has been sounding wonderful for a long time but I’m unlikely to be able to wait for it :confused:

For me the alternative would be a more standard servo + driver. A set can be had for $400 which is more than I’d like but compared to ODrive/IONI + encoder + motor, it’s not that far off.

Do you mind if I ask what ‘standard servo + driver’ is this?

I mean the kinds of servos used on CNC machines in industry, from Delta, Panasonic, Yaskawa etc.

The one that’s caught my fancy is this - A 400W Panasonic Minas A6-series AC servo+driver with 23-bit absolute encoder - $467. There are cheaper options but few with 23-bit encoders.

Yes I am sure that is definitely genuine original panasonic controller :joy:
But yeah it is a good price, if it works.

I suppose the trouble with these alibaba products is, if you can’t get it to do what you want, then you have nobody to ask. Whereas with ODrive you at least have us, and failing that, it’s open source so you could dive in and try to work out what the problem is yourself.

Could you buy just the motor + 23 bit encoder from Alibaba?
It should be possible to get it working with ODrive - the only issue would be the motor will have a high back-EMF constant as it is designed for mains voltage, so it wouldn’t be able to produce full power. But you could still reach full torque, at low speeds. And for a mill with ballscrews, I doubt you’d need very high speeds out of these motors at all.

Also if you get the motor designed for 110V mains, it will be much closer to ODrive’s 56v and should work much better than a motor designed for 250V.

You laugh but AliExpress/Alibaba can actually be fairly reliable - if you’re willing to pay. I’ve bought various genuine parts there before. Of course if you see a Panasonic servo driver for $50, that’s unlikely to be genuine.

As for support, it really depends what you buy and where you buy it from. I’ve had good experiences with some small number of Chinese sellers and manufacturers can be willing to support their products even if you bought them from China.

Regarding buying just the motor with encoder on it’s own, it’s totally doable, from that very page even. I’d discarded the idea because I didn’t understand the impact of driving the motor with a lower voltage. I’m used to stepper motors so assumed lower voltage would mean lower torque.

The max speed I usually need is ~2400mm/min, so 480 RPM, but I was going to put that behind a belt reduction, the smaller the better. I’m not really after torque here, I’m after positioning resolution (not necessarily accuracy, I intend to use linear scales for that).

Could you elaborate on the impact of driving a 200V motor at 56V? If I bought the MHMF042L1U2M (page 46 of the catalogue from here), how fast should I expect to be able to drive it? (56 / 200) * 3000? So 840 RPM? How would that change if I used a 100V motor?

And the torque is proportional to the current, right? Wouldn’t a lower voltage result in a lower current passing through the coils, so a lower torque? Or is there some magic going on here similar to what happens in stepper motor drivers?

A servo motor is very low resistance compared to a stepper, and the driver needs to step down the voltage in accordance with the speed of the motor (actually, the driver is behaving as a current source - it will vary the PWM dity cycle of the MOSFET switches to achieve a specified current, using current sense resistors as feedback, and it rarely, if ever, needs to apply 100% PWM to achieve its set current).

When voltage-limited i.e. PWM close to 100%, it behaves similarly to a DC brushed motor, in that maximum no-load speed is proportional to voltage.

If you look at the spec sheets for those motors, you should be able to find the winding resistance. That will tell you how much voltage you need to achieve a given current at stall (i.e. at 0 speed).
A mains-driven motor will normally have a resistance in the region of 1 Ohm, which means with 50V, you could drive it at 50A, assuming it is not moving.
There will be an additional voltage that you need in order to maintain that current when in motion, and that is the back-EMF voltage, usually specified as a “velocity constant” “kV” (RPM/V) which you can invert to a “back-EMF constant kE” in Volts per (hundreds of) RPM. This is the voltage that the motor generates.
There is also the inductance to consider - If you need to change the torque quickly, you will need a third additional voltage V = L dI/dt.
Therefore the total voltage is: V = vR + vE + vL, where vR = I*R, vE = W*kE and vL = L * dI/dt. This is always going to be lower than the DC bus voltage, except where the motor is running at high speed, or the rate of change of torque is high.
Servo controllers always use a higher bus voltage than the motor needs, so that the rate of change of torque can be as high as possible for robotics applications.

A motor designed for 100V should have a lower resistance, inductance and back-EMF constant than a motor designed for 250V.
Unfortunately that catalogue does not list important parameters like resistance and inductance.

For use with ODrive I would recommend a motor rated to at least 20A peak. For example MSMF041L1 from your catalogue should be able to to do 1.27Nm @ 1000 rpm at 50V.

1 Like

So I looked into this some more and to update folks: I don’t think it makes sense to use ODrive for a CNC application if you want high-resolution encoders:

  • ODrive with commercial servo motor:
    • kV and winding resistance specs are usually missing. I think out of the ~7 manufacturers I checked, only 1 specified them.
    • If you buy a 400W servo but can only drive it at 1/3rd its rated speed, you don’t get anywhere near the rated power, so you need to buy an overpowered motor for your application, which means more expense.
    • The encoders used are usually proprietary so would require reverse engineering and probably some kind of adapter board for the ODrive.
  • ODrive with separately purchased encoders
    • ODrive doesn’t seem to be a substantial cost-saving
      • Delta
        • Per-axis
          • ASD-A3-0421-L drive: $192
          • ECM-A3L-CY0604RS1 motor: $166
          • Cables: $20
          • Total per-axis: $378
        • Total for 3-axes: $1134
      • ODrive
        • 2x 56V ODrive with connectors: $179 x 2 = $358
        • 48V AC/DC power supply(s)? $300 (this x 3)?
        • 3x D5065 270kv motors: $79 x 3 = $237
        • 3x JKD-4 encoders: $75 x 3 = $225
        • Total: $1120
        • Total per-axis: $373
    • The commercial drives have more features:
      • They’re much closer to plug-and-play and have very detailed documentation.
      • Various anti-resonance features like notch filters
      • Support for linear scales in the driver, making full closed-loop operation trivial (no need for fancy LinuxCNC configs or anything)
      • Fun features like distributing regenerative energy from one servo drive to the other servo drives

kV and winding resistance specs are usually missing. I think out of the ~7 manufacturers I checked, only 1 specified them.

??? Maybe if you’re looking at cheap shit on Aliexpress. Any good servo manufacturer is going to have a massive catalogue with all the relevant parameters. For example, here’s Parker’s standard servo brochure: https://www.parker.com/Literature/Electromechanical%20North%20America/CATALOGS-BROCHURES/Rotary%20Products-All%20Other/Parker%20BE%20Series%20Servo%20Motors.pdf

And Kollmorgen is now producing 48V motors: AKM2G Servomotor | Kollmorgen

But if you’re talking about hobbyking stuff, then yeah, it’s hard to tell. They usually give out kV, and ODrive automatically measures the resistance during calibration so it generally works out ok.

Adapter board for differential signalling yes, but a lot of times they’re standard protocols (BiSS-C, RS485, etc).

Various anti-resonance features like notch filters

Mm, that’s fairly clever. We have anticogging but generally no other filters. I think I can bang out a notch filter pretty quickly though.

Support for linear scales in the driver,

Yeah, ODrive supports linear scales. Not sure what you’re missing here?

Fun features like distributing regenerative energy from one servo drive to the other servo drives

Careful with marketing gimmicks. ODrive does this too: it’s a function of physics, not software or clever design.


FYI, your cost comparison is out of whack. Not so much because of the prices per se, but because of the capabilities. ODrive can put out roughly 125A at 48V peak (6kW!), and about 50A continuous per channel. The power supply you listed can do 10.61A peak, and 2.5A continuous. If you’re keeping to that range, you’re using < 10% of the power of each ODrive channel. In fact it’s not really designed to run such small motors - the current shunts on ODrive v3 have ~+/- 0.25A of noise!

In short, be careful making sweeping generalizations. For YOUR application I’m not sure ODrive makes sense, but it generally crushes the competition in price / watt.

FYI If you need 3x400W servos, you can use a single 1200W 48V power supply ($67), or you can use two 24V ones in series. This brings your per-axis ODrive cost down to ~$300. Unless you’re in Europe, who are much more restrictive about CE ratings, in which case you’re kinda screwed paying obscene prices for DC power supplies.

I’m not “looking at cheap shit on AliExpress”. Here are the catalogues I looked at:

Yaskawa and Mitsubishi are fairly well regarded among CNC folk. Haas uses them on their machines for example.

Do you have any references for that? I did try to determine which protocols they used but nobody seemed to know for sure. I found this for Panasonic for example and it doesn’t seem to be a standard protocol, unless spitting out serial data over RS-485 and parsing it is “standard” (which might be the case?).

Plus, even if it is RS-485 (the most likely I think), ODrive doesn’t support it (at least per this and the docs).

I really need to be certain, because there’s not much point me saving a few hundred dollars on servo drivers if I have to pour hours of time into reverse engineering a protocol and building an adapter or adding support into ODrive myself.

Perhaps but I have to evaluate the ODrive based on the features it has now.

I suppose I’m missing documentation. This isn’t, as far as I can tell, mentioned anywhere. It’s not in the official documentation as far as I can see and a quick search of the forums didn’t reveal anything either, just this thread from 2019 which says “coming soon” and this thread which says it’s in a development branch and one ODrive can only support two encoders.

I’m not sure where I might have learned that it existed. Is there some resource I’m missing?

That’s fair enough but as you point out, I don’t need 6kW. It’s fairly rare to need anything like 6kW on a CNC machine where ODrive would be used. The maximum routinely used by hobbyists is ~750W.

It could make sense for a spindle or lathe I suppose.

I don’t believe I made sweeping generalizations, I was careful to qualify my main statement and emphasise the qualification:

I don’t think it makes sense to use ODrive for a CNC application if you want high-resolution encoders

And I elaborated on the specific comparisons underlying my claims.

ODrive may indeed beat many alternatives on price per watt but that isn’t really relevant to me, nor do I think it’s relevant to most of the people who might look at ODrive for CNC motion control (again, ODrive might be great for a spindle or lathe).

I’m not here to tell people “ODrive sucks”, I’m just following up on this thread in case someone else comes reading and wants to know what I ended up doing and why. I would in fact love it if ODrive worked for me, it just doesn’t look like that’s likely right now.

I am indeed in Europe. The best I can do for a power supply like that in my corner of the world is ~$315

Hmm, I would double check some of those. Looks like Yaskawa gives you the torque constant (Kt), which is = 8.27 / Kv, Sanyo gives you both the Torque Constant and the phase resistance, and Panasonic has a selection software that seems to have the data instead? :thinking: Kinda weird. Worst case you email the manufacturer, because yeah all of those are top notch companies that give you good datasheets.

Yeah, only supported on v4 because we’re missing the differential communication drivers and firmware on v3. Maybe we should start putting together a docs page for v4 with all the new features :smiley:

Eh not really. Looks like the Panasonic ones are proprietary, Yaskawa has a proprietary but known (not supported by ODrive) format, Siemens probably is proprietary and horrible like everything they do :wink: Tamagawa is proprietary but known also. Looks like Renishaw makes BiSS-C encoders, and it’s a sort of “standard”, but I’m not too surprised the incumbents haven’t changed their protocols.

Oh for sure. Tbh ODrive V3 is for tinkerer hobbyists or if you really need the high power. V4 is going to be much more plug & play. Even higher power though, for the first ones.

Truthfully, very few people are using ODrive for CNC. It’s more appropriate for robot dogs, drive motor control for differential drive robots, etc. The lathe spindle as you mentioned. Something that routinely uses 30-100A.

Linear scales are (typically) just quadrature encoders, and ODrive supports any generic quadrature encoder up to about 10MHz pulse frequency. If you want to use two encoders at a time (one for motor commutation and one for position/velocity feedback at the toolhead for backlash compensation etc), that will be supported out of the box on ODrive v4.

Oh yeah, I understand. My complaint was your conclusion ... for high resolution encoders doesn’t really jive. If you had said “ODrive doesn’t make much sense for precision positioning of XY axes on a hobby grade CNC” I would have agreed with you without even looking at the supporting documentation :wink:

ODrive can read many high resolution encoders that use “SSI” protocol, and as mentioned v4 will support RS485 encoders (and likely BiSS-C). The resolution there is arbitrary. It also supports any resolution of quadrature encoder up to that roughly 10MHz bandwidth limit, so let’s say… at 17-bit, you could hit 4600rpm. In that ballpark. A glass scale can get quite fine if you’re running it after the ballscrew / gearbox before it hits 10MHz.

Big oof :frowning:

Don’t suppose there are any updates on when v4 is coming? I might take another look when it does, even if I feel the commercial systems suit me better right now, I’d much prefer to have an open-source system if I can.

Yeah, Renishaw, RLS, SICK and a bunch more make tons of SSI and BISS-C encoders that would render this question moot but to buy a >22-bit encoder from one of them costs as much as an entire servo motor with encoder included :confused:

Best I could do was Yuheng Optics, which will do 22-bit with SSI or BISS-C it for $74, but their only mounting method for the smaller servos requires a tapped hole on the rear end of the motor shaft and I’m not sure how standard that is.

FWIW, I did come to that conclusion reading the code but I didn’t see it in the encoder documentation.

1 Like

I’ve got a Yaskawa motor with an absolute encoder I’d like to use. Is the lack of support a hardware issue, a software issue, or both? You say the format is known, but I’ve been coming up empty everywhere I look for the info. The only other reference I’ve seen to it is the STMBL pages that say it’s supported, but the code goes above my head, anyway.

1 Like