MT6701 compatibility question

Hey all, I grabbed a hand full of these MT6701 encoders from aliexpress based on the description (specifically the bold parts):

The MT6701 corresponding output Angle signal of 0~360°. In addition to providing ABZ/UVW incremental output and Analog/PWM absolute Angle output, the MT6701 provides 14 bit digital Angle output via the I2C/SSI interface. In addition to rotation Angle measurement, the MT6701 also offers a “push” output to enable single-chip button (rotation + press) functionality.

Features:
- Based on differential Hall technology, absolute Angle measurement from 0° to 360° is provided
- Operating voltage 3.3~5.0V, operating temperature -40℃~125℃
- Typical linearity deviation <±1°, <±1.5° over the whole temperature range
- System delay is as low as 5us and can support speeds up to 55,000 RPM
- Provides I²C/SSI interface to read 14-bit Angle data inside the chip
- Incremental output ABZ supports any resolution of 1 to 1024 lines
- Incremental output The UVW supports any polarity from 1 to 16
- Provides 12-bit PWM output or analog output (12-bit DAC)
- Dedicated press detection output (sensing changes in magnet and chip spacing) for single-chip button applications
- Built-in EEPROM, >1000 iterations of programming

I am not sure if I am missing something about how these are to be used, but there only seems to be one available interface on the actual chips:

I was looking in the SimpleFOC drivers repo, and while there is info on using the I2C interface I only saw an SSI class.

I just wanted to make sure to clarify before I put them away in a bin in the back of a shelf and forget about them.

From the looks of it, even though the chip used is capable of communication via other interfaces, these particular boards I have are not compatible currently, as they only have the I2C interface exposed (at least until an I2C variation of the MT6701 driver is added to the repo)?

For additional context, the planned usage was with an ESP32-S3 with SimpleFOC Mini.

Thanks,
MH

Hey,

The MT6701 has all kinds of interfaces but they’re all doubled up on its pins. It makes it really complicated to use IMHO.

You can adjust the different modes using the I2C protocol, and can switch between the I2C and SSI modes using its nCS pin IIRC.

Unfortunately I haven’t completed the I2C driver for it yet…

Oh, I see. Does that mean that it might actually be possible to use this board via SSI, it simply doesn’t have the pins labeled as such?

I have been trying to locate info on what SSI even is, and what pins I would need to use on esp32-s3, but I am not finding much info on it. I mostly have been finding posts of other people asking what it is, lol.

I am pretty sure that it is at least related to SPI in some manner, but there doesn’t seem to be enough pins on here for that (assuming SSI uses the same number of pins as SPI, but even that I have yet to find info on). I remember a few weeks ago I had came across an image that was for SSI and I remember seeing one of the pins labeled ‘data’ or ‘something data’, but I can’t seem to find it anymore.

SSI and SPI are extremely similar. SSI/SPI can be clocked much faster than I2C and are synchronous.

SSI differs from SPI in that the communication is unidirectional (like read only SPI) and that you cannot run multiple MT6701s on a bus (because it’s nCS line disables SSI but activates I2C on the same pins.

Looking at the Datasheet it doesn’t look like your module makes SSI possible easily since the nCS pin isn’t on the header…

You would have to somehow connect pin 8 to the MCU.

Ugh. If it’s not one thing, it’s another. Though, looking at this, I feel like I am much more likely to be able to solder 1 wire to pin 8, than when I tried to solder 6 wires to a tiny AS5048A. If that is all it should take, I have 6 of them, so it is worth a try. Especially since they are of no use to me otherwise without I2C available.

I will give this a go here in a bit and see how it goes. I definitely appreciate the info. :+1:

I actually wrote a basic I2C driver for this chip, if it’s interesting for you.
It’s not polished enough for with really any features beyond reading the angle, so you can add more if you want:

2 Likes

If you do try to hack your board, it looks like the pin 8 is connected to VCC, so you would also have to either lift that pin or scrape a gap in that trace as well as soldering to it :frowning:

If you’re very interested in that sensor I also have some PCBs here which make both interfaces accessible, I could send you one if you’re interested to help test it…

1 Like

@VIPQualityPost
I will definitely give that a go. All I need is to read, and I don’t necessarily need super high speed or anything. I am just building a small robot arm using gimbal motors. It would at least be nice to be able to use these boards as opposed to having them sit around forever.

While I would prefer to use a known better and faster method of communication if I can, up to this point, I have not really noticed any issues due to using I2C.

@runger
Good catch on that. I should probably make a habit of looking at schematics (and learning to read them). I can often follow them if I know exactly what I am looking at/for, but otherwise I end up getting lost.

I appreciate the offer, but I am already ahead of you on that. I had ordered a few of these last night (https://www.aliexpress.us/item/3256806222280835.html?gatewayAdapt=glo2usa)

Once they get here, I am still down to help test anything if you need. The only reason I am relatively set on wanting to use this board is the simple fact that the AS5048A is just too darm small for me to accurately solder reliably. I even tried to solder on a JST SMT connector, but upon first plug, and then trying to move it, it ripped off. I prefer the ‘hole-through’ form factor so I can put on little 2.54mm pitch screw terminals, as I move things around often, try new approaches, etc. I like the reusability.

I have also an MT6701 connected to an Nucleo G431 here an I use it not with simpleFoc but with some other Arduino Library

This Library is good for a test. It is working with I2c when the mode-pin of the MT6701 is tied to HIGH.

1 Like

I would prefer to use SSI over I2C if I am able, which that board that is pictured seems like it should be able to (fingers crossed), so I am just waiting on them to arrive from aliexpress then I can give them a test. Though, I believe I got the smaller version of it. I didn’t realize at the time I ordered that there were two different ones.

I might get a few of those ones as well, as no matter what I seem to order, there ends up being something weird which keeps it from being ideal, so I have to cast a wide net.

When you take the board I posted, the basic configuration is ABZ (Quadratur Encoder Outputs) and analog output. I have to admit that I2C is not really suitable for motor applications. When there is a glitch, the I2C blocks the hole MCU.
Probably using the ABZ output can be convenient, but the frequencies can become quite high which may cause quite a big processing load to the MCU ( If I’m right the driver is interrupt driven for every pulse).
I think some STM32 MCUs have dedicated quadrature encoder blocks but the may be not supported by simpleFoc.

They are… check out our STM32HardwareEncoder in the drivers library.

2 Likes

I tested your driver out on one of these boards and am using it as a second encoder for my main arm. Seems to be working quite well. :+1:

3 Likes