AS5600 Magnetic encoder - A practical example

preview_player
Показать описание
In this video, I continue discovering the AS5600 magnetic position encoder and its applicability in different scenarios. I rotated a stepper motor by providing pulses with a CNC handwheel and measured the angular displacement of the shaft. I wanted to compare the number of "theoretical steps" with the actually done steps and it seems that they are the same. Of course, I did not go too fast and there was no load on the shaft. Nevertheless, it seems that the motor did not skip any steps and it behaved according to the microstepping settings.

If you want to support my work, please consider buying the parts using my affiliate links:
Рекомендации по теме
Комментарии
Автор

A question about the encoder. You get a 1 bit +/- result. Is the magnetic encoder error cumulative? If it is not, then one can just round up the encoder result to the nearest degree, and it the results on the OLED will match the wheel perfectly.

alfatech
Автор

Hi, thank you for the extensive explanation, really appreciated. I'm going to use the magnetic encoder, and You've been of a great help.
As little consideration, the full rotation could be divided in three equal parts parts of 120 degrees instead of quadrants: The purpose to detect turns increament/decrement could be fulfilled with a larger time period (+33%, by considering the same rotational speed).

andreafavero
Автор

Hi! I have managed to get your setup working on a nano clone with a quadrature encoder. The encoder has 600 pulses per revolution. The code seems to work quite well after i accounted for the difference in the number of pulses, but I am having trouble with the board crashing when i change the direction of the encoder in rapid succession. Do you think implementing the code on a faster microcontroller (teensy 4.1 @600MHZ) would solve the problem? Thanks!

livingrainman
Автор

Thank you for this video. I have bought three brand new as5600, printed mount for a magnet, I have same display and use your Arduino code and also try default sketches from as5600 library with same glitchy results: the angle is not stable. and I cant reach 360 degree. Dir pin is connected. What can be wrong?

irrealix
Автор

Apart from missed steps checking, the use of shaft encoding can be closed loop with micro stepping?
There is no load on your motor. Changing current drive pwm to hold or achieve accurate position in microsteps would be an interesting demo. I would have to write my own code.
PID loop with no overshoot. Telescope astrophotography drive.
I want to use big 5 phase micro stepping but even look up table the 64 microsteps have varying torque.

marklimbrick
Автор

Did you align the magnet and the encoder? There is quite an elaborate procedure to achieve that as far as I remember

therealspixycat
Автор

the error can also be in the computing of the encoders signal in the arduino. i had that with an uno, when i ran same encoder on a mega the error became almost nothing. want to try a faster micro controller like teensy 4.1

manusholm
Автор

Thank you for this wonderful video. It got me inspired to rebuild an old airplane instrument using the AS5600 to read heading inputs when the pilot dials a knob. I do have a question though. My gauge has multiple knobs to adjust angles and headings. I can see from the manual that the I2C address is 0x36 (which is what you use in your code). Do you know if that address is static? How would you go about using 3 or 4 of these units connected to the same Arduino (since they all have the same I2C address)? Is it even possible...

HorstFederau
Автор

This is wonderful Project. i want to know how to set encoder position zero pro-grammatically ? suppose i read degree using magnetic encoder like 265 and now how to set zero this position?

nikunjpatel
Автор

I got my AS5600 boards today. I will be using them on my CNC router, but I have not built it yet. So I need to decide what little project to try these on.

tinayoga
Автор

The STM32F103C8/BT6 has 4 timers that can do all the QEI processing for you in hardware, the count is in a register. It takes some setting up. Perhaps this can be done in 'arduino' c++, though I've only used it in plain C. BTW: great channel, thanks for the videos!

darkfibres
Автор

you have a video of how to use this project at CNC

mesquitamk
Автор

WOW 09:33 you dont get exact pulses from your handwheel - thats nasty (in the cnc world anyway). Are you saying its an inherent +/- 1 bit uncertainty (or more?) that needs to be rounded in s/w?. I cant have my reading jittering (like a dvm does - I often switch to my old Avo model 8 the analog display often tells you so much more)

RobinRastle
Автор

This is amazing. I now have the same ESP32 board, an as56000 and a 17hs4023... and i would love to build one... can you possible provide details of the 3d printed part you used to mount the sensor to the stepper ? Much appreciated!

julesd
Автор

Me and friends like your projects.
I would like help with the AS5600, I placed the magnet on the axis of a NEMA17 and installed the AS5600 on the back. It turns out that at some angular points, the reading is jumping in two measurements alternately. Not changing the angular position, even disconnecting the power from the system and then re-feeding it, the same thing happens.
If it's at a single-reading angle, it returns a single-reading, which seems okay to me.
Did it have to do with a problem in defining the quadrant or something similar?

africano
Автор

hi dood, nice films! spent the whole evening watching them ! im hoping you can help me with a problem i have? i have purchased 4 AS5600 pcbs with magnets but i should have bought incremental encoders. is there a way to use the AS5600 to generate A quadrature output similar to the A B output from your cnc handwheel?

cheers

tanc

itanc
Автор

Thanks for really nice and informative videos! How would you go about to combine a mpg handwheel and start/stop or fwd/rev in a control panel with an arduino? I am building a control panel for a stepper motor power feed :)

Flyrip
Автор

very cool your work. friend I will use your project on my CNH. I just have a doubt which pin of my controller board should I connect to stm32. for calibration

mesquitamk
Автор

Have you thought about using FreeRTOS on the STM32? I mean, you really need a lagless experience in order to receive both commands from MPG and AS5600 and then send perfectly timed impulses to the stepper driver. Also, use PID if you really want a proper closed loop experience. Thanks for sharing!

micultimy
Автор

I found the solution, the AS5600's DIR pin must be grounded. Otherwise the readings are erratic.
thank you for your attention

africano