However, I don’t get the readings for two angles properly. What could be the reason ?
Do I need to manually switch chip select (CS) PIN HIGH/LOW when reading the two sensors ?
Yes, both sensors work individually and I am using an Arduino Uno for the moment. Pin assignment was as follows.
[ Both sensors were mounted on iPower GBM4108H-120T motors, and I tried this without driving the motors, but rather manually rotating the motors [i.e: motors were not connected to the board and hence the program consisted the lines only related to encoders]
sensor 1:
MISO-MISO (pin 12 of Arduino)
MOSI-MOSI (pin 11 of Arduino
SCK - SCK (pin 13 of Arduino)
CSn - Digital pin 4 of Arduino
sensor 2:
MISO-MISO (pin 12 of Arduino)
MOSI-MOSI (pin 11 of Arduino
SCK - SCK (pin 13 of Arduino)
CSn - Digital pin 8 of Arduino
What is the minimum you need to comment out to get encoder1 working? I think you’ve said that it works if you comment out all 3 lines below but does it work if you just comment the last line or the last two lines?
Thanks a lot Owen for helping out with this. I found the issue. It was my fault that I haven’t checked the wire connections properly. Even though both the sensors worked well individually, when they connected together it didn’t work properly. So I rechecked the wiring and code again as per your suggestions and found that one of the wires (jumper wire) joining two MOSIs pins and Arduino pin has been broken. That caused the issue and when I fixed that both the sensors worked perfectly.
AS5047P is a very powerful and adaptable sensor and it is supported with simplefoc library with both SPI and ABI(encoder) and even UVW (hall sensor) if well configured.
We still did not suport the PWM input though, I’m hoping that we will support it soon as well
I am sure that my as5047 works on sensor-test-encoder.But,I don’t know why it doesn’t when it work on velocity_motion_control-encoder. I try it many times,but I use AS5600(IIC) it was work.
could you tell me why Init FOC failed?