Infineon / TLE5012-Magnetic-Angle-Sensor

This repository includes an library for Arduino for the TLE5012 Magnetic Angle Sensor with SSC interface.
MIT License
50 stars 26 forks source link

check error #18

Open wt76cn opened 2 years ago

wt76cn commented 2 years ago

Steps to reproduce the behavior:

  1. download the readAngleTest 2.the returned check error is 1 sometime is FF
OlafFilies commented 2 years ago

Hello, before I can answer the question fully I have also some.

  1. Which interface type of the TLE5012 do you have? IIF, PWM, HSM or SPC?
  2. Is the TLE5012 still attached to the XMC2Go or is it attached to an external MCU?
  3. Do you have magnet arround the Sensor when you start it?

The last point is the most likely one, as without magnetic field the sensor throws an error. Also when the magnetic field is to strong, so when you put a very strong magnet directly on top of the chip, it throws an error. The checkerror apears only at startup in the example, but every function gives the checkerror back so you are able to check the magnetic field constantly and the health of the sensor with every function.

wt76cn commented 2 years ago

arduino pro mini,no magnet,all the print value is always 0发自我的华为手机-------- 原始邮件 --------发件人: "Dr. Olaf Filies" @.>日期: 2021年10月12日周二 下午4:28收件人: Infineon/TLE5012-Magnetic-Angle-Sensor @.>抄送: wt76cn @.>, Author @.>主 题: Re: [Infineon/TLE5012-Magnetic-Angle-Sensor] check error (#18) Hello, before I can answer the question fully I have also some. Which interface type of the TLE5012 do you have? IIF, PWM, HSM or SPC?Is the TLE5012 still attached to the XMC2Go or is it attached to an external MCU?Do you have magnet arround the Sensor when you start it? The last point is the most likely one, as without magnetic field the sensor throws an error. Also when the magnetic field is to strong, so when you put a very strong magnet directly on top of the chip, it throws an error. The checkerror apears only at startup in the example, but every function gives the checkerror back so you are able to check the magnetic field constantly and the health of the sensor with every function.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android.

OlafFilies commented 2 years ago

Ok, so there must be a magnet near the sensor, otherwise you get the checkerror at the begin. If you use an arduino ( no matter which version) than keep in mind, the the main interface of this sensor is the SSC 3-Wire SPI. There you a SCK, a CS and only one Data pin. To connect this with the MISO/MOSI have a lokk in the GitHub wiki of this sensor. Basicly you two options, take the normal SPI, than you need a resistor between MISO/MOSI or you take the 3-Wire SPI from this library than MISO/MOSI are shortcutted. There is still the question of the interface version. If you have the SPC interface than please have a look in the SPC example and in the documentatioon, has this type needs an external trigger. All other interface types should work without that.

wt76cn commented 2 years ago

a magnet near the sensor at the begin the check error change to FF

[08:54:38.630]收←◆checkError: FF

[08:54:39.630]收←◆Init done

Temperature:0.00掳Cangle:0.00掳range:0.00speed:0.00 Revolution:0

[08:54:40.648]收←◆Temperature:0.00掳Cangle:0.00掳range:0.00speed:0.00 Revolution:0

[08:54:41.655]收←◆Temperature:0.00掳Cangle:0.00掳range:0.00speed:0.00 Revolution:0

[08:54:42.662]收←◆Temperature:0.00掳Cangle:0.00掳range:0.00speed:0.00 Revolution:0

I find the error types in the file of tle5012b_util.hpp src/corelib, I am not sure my error is the CRC_ERROR? the TLE5012 chip is wrong?how can i solve it?thanks enum errorTypes { NO_ERROR = 0x00, //!< \brief NO_ERROR = Safety word was OK SYSTEM_ERROR = 0x01, //!< \brief SYSTEM_ERROR = over/under voltage, VDD negative, GND off, ROM defect INTERFACE_ACCESS_ERROR = 0x02, //!< \brief INTERFACE_ACCESS_ERROR = wrong address or wrong lock INVALID_ANGLE_ERROR = 0x03, //!< \brief INVALID_ANGLE_ERROR = NO_GMR_A = 1 or NO_GMR_XY = 1 ANGLE_SPEED_ERROR = 0x04, //!< \brief ANGLE_SPEED_ERROR = combined error, angular speed calculation wrong CRC_ERROR = 0xFF //!< \brief CRC_ERROR = Cyclic Redundancy Check (CRC), which includes the STAT and RESP bits wrong };

At 2021-10-12 20:53:07, "Dr. Olaf Filies" @.***> wrote:

Ok, so there must be a magnet near the sensor, otherwise you get the checkerror at the begin. If you use an arduino ( no matter which version) than keep in mind, the the main interface of this sensor is the SSC 3-Wire SPI. There you a SCK, a CS and only one Data pin. To connect this with the MISO/MOSI have a lokk in the GitHub wiki of this sensor. Basicly you two options, take the normal SPI, than you need a resistor between MISO/MOSI or you take the 3-Wire SPI from this library than MISO/MOSI are shortcutted. There is still the question of the interface version. If you have the SPC interface than please have a look in the SPC example and in the documentatioon, has this type needs an external trigger. All other interface types should work without that.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

OlafFilies commented 2 years ago

So this data tells me that the sensor does not react at all so please test the following:

  1. as far as I understand, you have bulk chip not a small PCB board with the sensor o top, correct? If so please have a look here https://github.com/Infineon/TLE5012-Magnetic-Angle-Sensor/wiki/Hardware-Platforms under Bulk Sensor and attach the Sensor to you Arduino as show in the picture with a 470 Ohm resistor between MISO/MOSI.
  2. on that page you can also find a list of different TLE5012 versions with different interfaces. To check that you type is not an E9000 SPC, please try the E9000SPC example.
  3. the Arduino pro mini was never tested, does the compiltion run without any errors or warnings? and if there are some which one.
  4. to check the software itself, which IDE/version of IDE are you using, which version of the TLE5012 library
  5. can send a photo from you wired setup?
wt76cn commented 2 years ago

At 2021-10-13 16:40:20, "Dr. Olaf Filies" @.***> wrote:

So this data tells me that the sensor does not react at all so please test the following:

as far as I understand, you have bulk chip not a small PCB board with the sensor o top, correct? If so please have a look here https://github.com/Infineon/TLE5012-Magnetic-Angle-Sensor/wiki/Hardware-Platforms under Bulk Sensor and attach the Sensor to you Arduino as show in the picture with a 470 Ohm resistor between MISO/MOSI. on that page you can also find a list of different TLE5012 versions with different interfaces. To check that you type is not an E9000 SPC, please try the E9000SPC example. the Arduino pro mini was never tested, does the compiltion run without any errors or warnings? and if there are some which one. to check the software itself, which IDE/version of IDE are you using, which version of the TLE5012 library can send a photo from you wired setup?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

robosithi commented 2 years ago

@OlafFilies Hello. I have a similar problem. I am using the following environment. Linux: Ubuntu 20.04 Arduino IDE: 1.8.19 TLE5012 Library:3.0.1 Arduino Board : Arduino Mega 2560 Chip: TLE5012b E1000 Bulk(TLE5012BE1000XUMA1) I connected 6.8k ohms between MISO and MOSI of the Arduino. I then connected it to the data pins of the TLE5012 via 470 ohms. I have magnet arround the Sensor.

In my case, the default Example did not work. I got it to work by changing line 41 as follows. Tle5012Sensor.getAngleValue(d);

However, if I then comment out the serial output on lines 47-51, I get an error of 1 at Init.

litchiate commented 2 years ago

my Arduino leonardo dosen't work too. I found SS_Pin curve strange with a oscilloscope. After adding following in void SPIClass3W::sendReceiveSpi(); pinMode(11,OUTPUT);
digitalWrite(11, HIGH); It works.

OlafFilies commented 1 year ago

Hello, when it works only with hard set pins, than I would assume that the pin setting in the calling function is not correct. Are you initializising the TLE5012 with the constructor from TLE5012-pal-ino.hpp line 53 or 54? If you use the simple one from line 53, than please check the setting of the PIN_SPI_MISO/PIN_SPI_MOSI defines. If you use the full SPI setting from line 54 than pleas check the input there. What I'm worried about is that you also set digitalWrite to high. The code was checked with an original Arduino and XMCs but not with a Leonardo. I have to check that. Does it work without digitalWrite to High? You set these commands in lines 86-88 of spi3w-ard.cpp? Did you also change it for the second part in line 97-99?

Sesko1 commented 11 months ago

@OlafFilies Hello Olaf, I initially had the same issue with an Arduino nano, error FF or Error 1. I got it to work without issues on an Arduino Uno, using the same pinout. In my application I would ideally use a Nano - I did try manually porting the pins for the Nano but it returned the same error. I'm wondering if there is something else I'm missing. Thanks in advance!

OlafFilies commented 11 months ago

Hello,

Question, do you use a bulk TLE5012 chip or the breakout part from the Sense2Go Kit? The difference between them are the resistors which between the DATA, SCK and CS lines. Please refer to the TLE5012 manual for the SSC interface. Also try to setup an open-drain configuration. Depending on the microcontroller and its pullup resistors, the open drain configuration is a better choice. Please also check the timing of the CS and SCLK.

From: Sesko1 @.> Sent: Freitag, 20. Oktober 2023 19:50 To: Infineon/TLE5012-Magnetic-Angle-Sensor @.> Cc: Filies Olaf (DES TOC PSA) @.>; Mention @.> Subject: Re: [Infineon/TLE5012-Magnetic-Angle-Sensor] check error (#18)

Caution: This e-mail originated outside Infineon Technologies. Do not click on links or open attachments unless you validate it is safe https://intranet-content.infineon.com/explore/aboutinfineon/rules/informationsecurity/ug/SocialEngineering/Pages/SocialEngineeringElements_en.aspx .

@OlafFilies https://github.com/OlafFilies Hello Olaf, I initially had the same issue with an Arduino nano, error FF or Error 1. I got it to work without issues on an Arduino Uno, using the same pinout. In my application I would ideally use a Nano - I did try manually porting the pins for the Nano but it returned the same error. I'm wondering if there is something else I'm missing. Thanks in advance!

— Reply to this email directly, view it on GitHub https://github.com/Infineon/TLE5012-Magnetic-Angle-Sensor/issues/18#issuecomment-1773153669 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ALKTARZYEVYNO57RYNBC23DYAK2WJAVCNFSM5FZUKLAKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZXGMYTKMZWGY4Q . You are receiving this because you were mentioned. https://github.com/notifications/beacon/ALKTAR6IIEB5YBYUFHV4OG3YAK2WJA5CNFSM5FZUKLAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGONGYC3BI.gif Message ID: @. @.> >

github-actions[bot] commented 3 months ago

This issue is stale because it has been open more than 6 weeks with no activity. Please comment on this issue if it's still relevant or it will be closed automatically after 1 week.