EN RU CN
Encoders AMT222B and AS5048A
  • Hello,
    We have a SimpleBGC 32-bit extended, 2 differents encoders : AMT222B and AS5048A. We validated those encoders and we know that they work. But we can't get them to work with the simpleBGC board. Here is our configuration on the GUI and our system :

    https://drive.google.com/file/d/1_p5OCKqpLXnwX0GpXVg51XvVqnmK8voM/view?usp=sharing

    AMT222B is connected on the roll pin according to the guide SimpleBGC_32bit_Encoders.pdf page 5, with the run mode.
    AS5048A is connected on the pitch connector below the board with only the first 3 pins for PWM.
    The IMU works well.
    And here is our configuration on the GUI, we have the firmware 2.70 b2.

    https://drive.google.com/file/d/1gyDoN8v0DAjPKd5HQOPWCjyfFK5k5hSl/view?usp=sharing

    Please tell me what is wrong with our setup, Thanks !
  • Hello,
    For the AMT 222/223, PWM connection is not supported. See the table on page 3 of the encoders manual. When you select this model, the controller enables SPI port function on pins RC_ROLL, RC_PITCH, RC_YAW and makes them unavailable for other functions. That's why AS5048 does not work.
    As a solution, you can connect both encoders by SPI. It's much more reliable than PWM, though requires more wires.
  • Hi alexmos,
    Thanks for reply,
    AMT222B is connected with SPI to the basecam.
    That explain why AS5048 doesn't work, but what about the AMT222 ?
  • Are you sure AMT222 does not work? In the monitoring, check the raw values from the ENC_RAW_R
    https://c2n.me/4cjfyFu
    Also it should be some information about the encoder in the "Debug" - "Request system state"
  • It seems I found the problem. You connect the encoder according to the "Regular" board diagram, where there is no a dedicated encoder port. From the GUI screenshot I see now that you use the "Extended" board which has a dedicated SPI port for encoders. The pinout is: https://c2n.me/4cjg28O
  • The question remains why the PITCH encoder does not work on PWM input.. Normally PWM works well because it's hard to make a mistake in connection - only the single data line.
  • ""Are you sure AMT222 does not work? In the monitoring, check the raw values from the ENC_RAW_R""
    Just rechecked it with AMT Viewpoint, works well, didn't forget to put it back in run mode.
    I was just trying to use this monitor tab to watch my encoder value but it stays at 0.

    ""Debug - Request system state""
    This tells me that it's not connected.
  • ""Extended board which has a dedicated SPI port for encoders""
    So you can't use this configuration, you have to use the dedicated port ?
  • ""The question remains why the PITCH encoder does not work on PWM input.. Normally PWM works well because it's hard to make a mistake in connection - only the single data line.""
    Indeed, we tried the AS5048A on another pc with a old tiny pro v2, works perfectly. Maybe it was because the AMT22 was on SPI mode and it blocked all other connection as you said.

    Will try the dedicated encoders port and will keep you updated. Thanks a lot !
  • Tried with the dedicated Roll encoders port with SPI, it doesn't detect my encoder.
    Requesting state gives me this :
    Encoder[ROLL]
    Encoder type: DISABLED
    diagnostic data: 000000000000 read errors: 0
  • There are no more things to try. Check the electrical connection; show in the drawing how you connect port pins to the encoder pins.
  • We rechecked the SPI connection, it seems correct.
    We also tried : Basecam extended + AS5048A (PWM connection, updated it on the GUI) on dedicated roll port alone, with or without the IMU. GUI detect IMU but not the AS5048.
    So we highly suspect it comes from the board.
  • Connection for AMT22 in SPI to dedicated SPi port basecam extended, pin number according to the picture :

    https://drive.google.com/file/d/1Oa2tpWFQ44ASchf1LQba16sVeYBegZWL/view?usp=sharing

    Pin 1 : Encoder + 5V - Basecam + 5V
    Pin 2 : Encoder SCLK - Basecam SCK
    Pin 3 : Encoder MOSI - Basecam MOSI
    Pin 4 : Encoder GND - Basecam GND
    Pin 5 : Encoder MISO - Basecam MISO
    Pin 6 : Encoder CHIP SELECT - Basecam CS/PWM
  • Just noticed that if I indicate an encoder on the GUI on Pitch or Roll I get no error message (even if they are an encoder or not).
    But if i indicates an encoder in Yaw (plugged or not), I get this error message :
    "Emergency stop: Encoder does not respond during initialization"
  • Update : everything is working well, the issue came from my SPI connection and the AMT22 was on the wrong mode, it now works on Program Mode.
  • Hi... I likewise attempted to associate the AS5048A with an Arduino UNO. For the primary attempt I utilized the code from qubit. However, I have the issue that I simply get 0 or 11111111 for result1 and result2. I tryed to fix the issue by contemplating the information sheet - however had no achievement.

    I aslo associated the PWM-pin of the AS5048A to a capacitor so I can meassure the voltage with a multimeter. That worked awesome. So the chip and the magnet position ought to be alright. Just in case I attempted another AS5048A chip - same outcome - right sign at pwm-pin however I get only 0 or 11111111.