AS5048A 14-bit magnetic position encoder

Поділитися
Вставка
  • Опубліковано 31 гру 2024

КОМЕНТАРІ • 76

  • @deplorablesecuritydevices
    @deplorablesecuritydevices Рік тому

    Thank you so much for sharing that code, I had been all over the internet trying to get two AS5048a's working on the same bus and your code made it an easy fix.

    • @CuriousScientist
      @CuriousScientist  Рік тому +1

      It is nice to hear that my code allowed you to make the chip working! I hope you'll have fun! Cheers!

    • @gyanfransen4313
      @gyanfransen4313 8 місяців тому

      Could you maybe share how you made two AS5048a's work?

    • @CuriousScientist
      @CuriousScientist  8 місяців тому

      You can basically recycle and duplicate the already existing code for another sensor and then select the sensor that you want to read by the chip select (CS) pin.

    • @gyanfransen4313
      @gyanfransen4313 8 місяців тому

      @@CuriousScientist Hi, i am sorry but i have been looking for a couple hours to find a daisy chain code from another sensor for an arduino, but i cant find any that i am able to make work. Would you maybe be able to send a link that has this?

    • @CuriousScientist
      @CuriousScientist  8 місяців тому +1

      I don't have such code, but I just explained how to write one.

  • @jedzciejapka
    @jedzciejapka 3 роки тому +1

    I love this video, your comments in code and your explanations.
    Helped me a lot, you are a hero!

    • @CuriousScientist
      @CuriousScientist  3 роки тому

      Thank you! I am really happy to read this feedback. I am glad that the video was useful.

  • @isidoromaich7226
    @isidoromaich7226 3 роки тому

    you explained very well both encoders and how the software works, this give the viewer the knowledge for choosing the more convenient. Besides, is not THAT expensive, I think if it is needed this is worth it

    • @CuriousScientist
      @CuriousScientist  3 роки тому

      Thank you! Yes, it is not that extremely expensive, but I wanted to highlight that this one costs significantly more. Maybe for some people this difference is significant.

  • @vasileiossolakis2231
    @vasileiossolakis2231 3 роки тому +1

    Very well explained. Thank you! I really appreciate the time and effort you put to make these videos

  • @StreamzNow
    @StreamzNow 3 роки тому +1

    please keep making these videos love them

  • @riala
    @riala Місяць тому

    This is great man, I want to follow along (I got a AS5048) but I can't find any connector for it on amazon.. Did you solder the SPI wires on those tiny pads?

    • @CuriousScientist
      @CuriousScientist  Місяць тому +1

      Thanks! Yes, I did.

    • @riala
      @riala Місяць тому +1

      @CuriousScientist 3 years later and still replying so soon! Thanks man I appreciate the reply, hope my hands are stable enough for this.

    • @CuriousScientist
      @CuriousScientist  Місяць тому +1

      Sure, I reply to basically all comments that are relevant! It can help if you pre-tin the pads on the module and put a little flux on them. And then, pre-tin the wires and solder them one by one. Don't strip too much isolation off from the wires.

    • @riala
      @riala Місяць тому +1

      @CuriousScientist Roger that!

  • @Dorpt01
    @Dorpt01 Рік тому +1

    so from what i understand this type of encoders act as Absolute encoders? because angle is determined by the poles, so if you switch the system off power, it will save the position right?
    did you try it?

    • @CuriousScientist
      @CuriousScientist  Рік тому +2

      It doesn't "act as", but _it is_ an absolute encoder. There are four carefully placed hall sensors inside the chip, and they detect the alignment of the magnetic field and provide the position of the magnet. If you remove the power but doesn't move anything and then you turn the power back, you'll get the same position within the 0-360° scale.

    • @Dorpt01
      @Dorpt01 Рік тому +1

      @@CuriousScientist Thank you!!

  • @flanker0ne
    @flanker0ne 2 роки тому

    I used your video to make those Chinese hall potentiometer/encoder P3022-SPI-CW360, Aliexpress is full of those, to work with arduino
    Thank you

    • @CuriousScientist
      @CuriousScientist  2 роки тому

      Great! Thanks for sharing the type of sensor. It seems that they put a similar chip in a sturdy encoder casing. I saved this product for future reference and I will maybe buy it in the future when I have the resources.

  • @marklimbrick
    @marklimbrick 10 місяців тому

    Can this high resolution encoder closed loop allow PID on microstep positions?
    At slow speeds. And with calibrated lookup table for microstep currents.

    • @marklimbrick
      @marklimbrick 10 місяців тому

      14 bit resolution sensor chip. But only 1 degree resolution in this demonstration?

    • @CuriousScientist
      @CuriousScientist  10 місяців тому

      @@marklimbrick I chopped off the digits and did not print all of them.
      Yes, it allows PID. On its "sibling", the AS5600 I have recently published a video where I demonstrate PID with stepper motors. I used it with a TMC2209 which can do 1/256 microstepping.

  • @dhruvbose8294
    @dhruvbose8294 2 роки тому +1

    Great video! Had a question about AS5048A/B encoders. We are using the B variety and were wondering what's the max RPM that it can handle. We are using it on an arduino nano and its skipping counts depending on speed! Any help is appreciated. Thanks

    • @CuriousScientist
      @CuriousScientist  2 роки тому

      Hi and thanks! Unfortunately, I cannot comment on this because I don't know how your code is used. It really depends on how often you want to read it and what method do you use.

    • @dhruvbose8294
      @dhruvbose8294 2 роки тому

      @@CuriousScientist could you point me to the right method? I have the sensor mounted on a motor that can go upto 5800 rpm. At this speed, reading angles using the library by sosandroid is resulting in around 20-30 skipped counts. We are trying to measure the speed of this motor. This is at default I2C speed of 100kHz and 400kHz. We're polling the library function at the max cycle speed of the Arduino. No other functions/math is carried out elsewhere in the code.

    • @CuriousScientist
      @CuriousScientist  2 роки тому +1

      I am sorry, but since you are using another code that I am not familiar with, I cannot help. I don't have the time and resources to dig into someone else's code and troubleshoot it.

  • @jonathanizquierdo1144
    @jonathanizquierdo1144 9 місяців тому

    Any useful resources for the AS5045 (SSI Protocol)

  • @bobp5776
    @bobp5776 2 роки тому

    Do you or anyone have a code snippet to set the Zero position for the AS5040 ?

    • @CuriousScientist
      @CuriousScientist  2 роки тому

      Have you watched the whole video or checked my website?

    • @CuriousScientist
      @CuriousScientist  2 роки тому

      Please drop me a line via email and we discuss the rest there.

  • @varweg
    @varweg 3 роки тому

    Can i just use regular cubic magnet but put it on its side? so that north and south are sideways....

    • @CuriousScientist
      @CuriousScientist  3 роки тому

      No, that won't work.

    • @varweg
      @varweg 3 роки тому

      @@CuriousScientist here in this video there is another encoder but the trick works
      ua-cam.com/video/8DEV3hZvOI8/v-deo.html

    • @CuriousScientist
      @CuriousScientist  3 роки тому

      Okay, but the datasheet is specifically asking for a diametrically magnetized magnet. The magnetic field might cross the chip in a different way which can cause wrong readings. Therefore I suggest the way described in the datasheet. The magnets cost nothing, especially if you buy the modules from sellers who also include the magnet in the package.

    • @dhruvbose8294
      @dhruvbose8294 2 роки тому +2

      Well i had a bit of a sourcing problem on the magnets for AS5040 which basically needs a similar diametrically polarized magnet. The seller of the encoder didn't have those, so got them from another site that claimed they were diametrically polarized, but they weren't. So hacked it a bit. Placed two magnets tangent to each another with their north and south poles facing opposite each other. Made a tiny 3D printed shaft for it with these magnets push fit into one side. Worked like a charm!
      So as long as your magnetic field is oriented correctly, as described in the datasheet, and is strong enough to trigger the hall effect sensors, the cube might work as well.
      ngl i'm a little curious if it would work.

    • @CuriousScientist
      @CuriousScientist  2 роки тому

      It cost nothing to buy a proper magnet from Aliexpress and it doesn't need any hacking or workarounds. For good results I would only recommend a proper diametrically magnetized magnet.

  • @김지수-u2f7s
    @김지수-u2f7s 10 місяців тому

    Does this remember their location even after the power is off?

    • @CuriousScientist
      @CuriousScientist  10 місяців тому

      Between 0-360° yes, since it is an absolute encoder. Otherwise, you need to save the last location.

  • @alo1236546
    @alo1236546 4 місяці тому

    sir could it become liner encoder straight

    • @CuriousScientist
      @CuriousScientist  4 місяці тому

      Hi! I guess you mean linear. This encoder detects rotational motion. So unless you mechanically convert rotation into linear motion, then no, it can not "become" a linear encoder. Use a glass scale encoder or similar if you want a linear encoder.

  • @aramisdejesustinocodiaz7566
    @aramisdejesustinocodiaz7566 8 місяців тому

    Does this encoder work for the Nema 23 motor?

    • @CuriousScientist
      @CuriousScientist  8 місяців тому +1

      It works with anything that rotates.

    • @aramisdejesustinocodiaz7566
      @aramisdejesustinocodiaz7566 8 місяців тому

      Thank you very much, I need to control the motor like a clock, define a zero point and send it by coordinates, I think I can do it with this encoder

    • @CuriousScientist
      @CuriousScientist  8 місяців тому +1

      It would definitely work. It is an absolute encoder, so you would know its position.

    • @aramisdejesustinocodiaz7566
      @aramisdejesustinocodiaz7566 8 місяців тому

      Thank you very much, your video has saved my life, I'm subscribing right now

    • @CuriousScientist
      @CuriousScientist  8 місяців тому +1

      Thanks! Feel free to join my Instagram too!

  • @mertcapkin7263
    @mertcapkin7263 3 роки тому

    did you receive the magnet together with the encoder?

    • @CuriousScientist
      @CuriousScientist  3 роки тому

      Yes, but as I noticed, not all sellers provide the magnet. It is worth to order some additional magnets, just to be sure.

    • @mertcapkin7263
      @mertcapkin7263 3 роки тому

      @@CuriousScientist what exactly should I Google for? :) encoder magnet?

    • @CuriousScientist
      @CuriousScientist  3 роки тому

      Well, first of all you should watch the video more carefully because I tell everything about a magnet in the first minute of the video. I even wrote down the name of the magnet. Nevertheless, I just put a link in the description for the magnets.

    • @mertcapkin7263
      @mertcapkin7263 3 роки тому

      @@CuriousScientist sorry, I just watched a lot of videos so I don't remember all the content too well. I will rewatch the video. Thanks again!

  • @Gallardo6669
    @Gallardo6669 Рік тому +1

    Excellent. But still hard to follow through as a beginner

  • @noanyobiseniss7462
    @noanyobiseniss7462 7 місяців тому +1

    Comment for the Algo.

  • @peterchrien
    @peterchrien 2 роки тому +1

    you know you can program your own address for ams sensors? At least I do it.

    • @CuriousScientist
      @CuriousScientist  2 роки тому

      You mean the i2c address, right? Then yes, it is possible. Maybe it is also an easier way than having a bunch of CS lines when using the SPI connection.

    • @peterchrien
      @peterchrien 2 роки тому +1

      @@CuriousScientist Yes, I2C. My only problem is, that I have burned? 2 senzors already. I don't know what went wrong, but had to buy new one.

    • @CuriousScientist
      @CuriousScientist  2 роки тому

      I have never played enough with these chips to destroy them, however I am interested in the symptoms if there's any? Does the chip respond anything? Is it taking up more current (electrically damaged due to a short circuit somewhere)? Or what can you see?

    • @peterchrien
      @peterchrien 2 роки тому +1

      @@CuriousScientist I can't find it with I2C scanner, visually it looks ok, however when I measure contacts, it beeps between 3.3V and GND, however not between 5V and GND. Weird, because I use 5V. I removed the chip from the PCB and it still beeps between 3.3V and GND.

    • @CuriousScientist
      @CuriousScientist  2 роки тому

      It's not a good sign that the 3.3V and GND are shorted. I honestly don't know why this could happen, but I also suspect that the chip is toasted.