Write Register of SPI sensor MA730

Hi,
i want to use a MA730 sensor in off axis setup.
Therefore i have to write the register of the sensor, to compensate the mag field shift.
It needs 2 x 16bit SPI frames, but with 20ms delay in between.
But i have no clue how to do it.
Is something like this already included in simplefoc? I didnt find anything.
Greetings, David

Hi David!

Have you seen our dedicated driver for the MA730 here?

I’m not sure I implemented the registers you need, but it should be fairly easy to extend it…

Let me know if this makes sense to you, or if you have further questions feel free to ask!

Thank you very much, stupid me wasnt looking under the foc-drivers directory.
I found everything i needed for adjusting the bias current.
It works now.

Here is the next problem, when using a magnet off axis, the mag field changes 2 times/rev.
When using AB signals its no problem, i just can double the resolution.
But can i do that somehow when using SPI to get the angle?
Greetings,
David

Hey,

I think you’re the first to use the sensor in this way - we’ll be really interested to hear your experiences!

SPI also uses a CPR value, which is hard-coded in the MA730 class…
See the #define MA730_CPR

Perhaps the best thing to do is just create a subclass of the MA730 driver class, and fix it to suit your needs. Or even just copy the classes from the ma730 folder to your own project and adjust them as needed.

Once you confirm it is working, I would be very happy to make a modification to this driver to accommodate edge-on mounting.