MT6835 Angle sensor 21bit

Are you still testing with L298 ?

To rule out the lousyness of L298, being the cause. You could try a different setup.

In my experience, the MT6835 is so sensitive, that the slightest touching the controller will change the angle like 0.0001 degrees.

at least the MT6835 has a feature to store a calibration table based on comparing its readings with an optical 21+ bits encoder. This is described in the manual. But without having that encoder you can only do the more basic user calibration - I commented about that aleady.
Regarding the noisy signal: if there is no solution to this by e.g. filtering, we indeed talk about 11bit usable resolution and I am back on square one - getting beyond microstepping resolution…

yes and no: when the stepper drives my two-motor setup, I am still on L298. Not so easy to get something else. I made a hardware design with TI chips which I can’t buy for two years now…
When the Maxon motor drives my setup, it uses a separate Maxon controller which for sure has high quality output - my belief in Swiss engineering is rock solid.
On both setups I don’t get clean signals from the encoder, which takes out the poor L298 from the equation currently :-0

You can get 256 microstep drivers for like 8 bucks, though. The actual resolution is swamped by other error sources in almost all practical contexts…

Another bug-fix to the MT6835 driver now fixes setting the ABZ resolution.
I’ve tested this a bit, and setting ABZ resolution, ABZ on and AB-swap via the driver works nicely.

Code is still on dev branch but will be the next release:

1 Like

I’ve pushed another update. I made good on m threat and radically simplified the STM32HWEncoder…
Now it just runs the timer to capture the encoder pulses, and leaves everything else (velocity, full rotations) to the base class Sensor…

It should now work like all the other sensors and the bugs should be solved :crossed_fingers:

As usual you can find this code on the dev branch for now, but I will release a proper version soon…

Oh, and it now supports the MT6835ā€˜s full resolution on ABI :slight_smile:

So sorry for posting stupid shit all over this wall. OMFG I was bowling a watermelon :watermelon: yesterday. It did not roll, it just went swusch. Sorry.

I think I just wanted to say, Hi. You guys are the best! Go team! Yay

Hi, sorry for replying directly here, I’m new and a little lost right here, i have a question about the MT6835 driver, i see that you are able to change the ABZ resolution, but i have a question, is that change permanent?, like will it be saved after power cycles and being disconnected from the spi?, thanks in advance

Hey @AlexYMo99 , welcome to SimpleFOC.

The change is not permanent unless you write it to EEPROM. See section 7.6.6 of the MT6835 data sheet about EEPROM programming.

You can use the writeEEPROM() method of our driver class to do so. Pay attention to the fact that you have to wait 6 seconds (!) before talking to the sensor again after programming the EEPROM.

1 Like

Got it, thank you so much for your answer, i have never done anything like that but i will research about spi programming on my own, that info deffinetly helps me getting started, only one last question, is there any problem if i do the programming with the ic already soldered in a pcb (with all the complementary components ofc)?, as i will be buying it that way?

Well, the SPI part is done for you in the driver already. :slight_smile: You just need to configure your settings using the driver’s methods, and then call the writeEEPROM() method to make them permanent.

It should work with any MT6835 board that has the SPI bus exposed.

1 Like

Oh, my bad, i didnt get that part the first time, i think i get it now, ill have a look at it, thank you again, you are awesome!