7 Replies Latest reply on Apr 23, 2020 12:32 AM by AH_96

    Tuning IDAC Value for Inductive Sensing MagSense


      Hi i have a problem reaching the recommend 70% of the maximum value of the raw counts.

      I am testing my own designed coil for a MoT system. Although i already set the value for the IDAC to the maximum of 127 i can only reach a value for the raw count of 2100. (The maximum value for the raw counts is 10434 and 70% are 7304)


      The coil the following values


      Dout: 15 mm

      Shape: circular

      Trace width/space between: 4 mills

      Turns N: 27

      Layers: 4

      copper thickness:  35 u


      The overlay is aluminium with a thickness of 0.5 mm and the Spacer between Coil and overlay has a thickness of 0.5 mm.


      The tank capacitor has a value of 100pF and the resonant frequency is at 2.28MHz.


      The value of the RLx resistor is 6,34kOhm and the amplitude Vamp at resonant frequency is 2,17V.


      As i meet all the limits (Rp<50kOhm, 45kHz<f0<3MHz) i dont understand why i cant adjust the raw counts to the desired 70% of Maximum value


      Could it be that the IDAC has to less power to support such a configuration?

      Or is it a matter how accurate i adjust the Vamp Value to 1,8V?

      Or is there any other reason i dont see for that problem?

        • 1. Re: Tuning IDAC Value for Inductive Sensing MagSense

          Hi SeFu_4636006


          The 70% provided in the component datasheet is an error and the raw counts must be calibrated to 30% (with a 10% tolerance being acceptable). I have created an internal request to fix this bug. Thanks a lot for identifying and reporting this.


          A few additional information on MagSense IDAC component:

          The default IDAC gain is set to 300nA/bit. This means that the maximum current that it can drive is 300*127nA. You can increase/decrease this as there are 3 gain levels possible in MagSense.

          To check this, you need to go to expression view

          Go to Tools > Options > Design Entry > Component catalog and check the Enable Param Edit Views option.

          Then in the MagSense component configurator, right click on Advanced and click on Show Expression view.

          Scrolling down, you will find an option to set the gain. By default it is set to 300nA.bit.


          This might not be applicable in this case since i believe you are able to achieve 30% easily. Please make sure that the IDAC code is within 30-90 to make sure that error in IDAC is not present.


          Edited: Calibration percent must be 30%.




          • 2. Re: Tuning IDAC Value for Inductive Sensing MagSense

            Thanks that helped a lot.

            The signal and therefore the SNR is much better now.

            I only have the little problem that I need to set the IDAC value higher than 90 to reach the desired 30% with the default gain 300nA/bit.(Exactly to 104)

            If I set the gain to 2400nA/bit the IDAC values are lower than 30. (Exactly to 13)

            Would you recommend to use the default gain 300nA/bit or the higher gain 2400nA/bit in that case to avoid error in IDAC?

            • 3. Re: Tuning IDAC Value for Inductive Sensing MagSense

              Hi SeFu_4636006


              It is better to use lower gain (300nA/bit) with the higher code. However, I see that you are obtaining high Vamp. You can increase Rlx to reduce this Vamp to get close to 1.8V so that the IDAC code required will also be within the required range. Please try this and let us know if you were able to tune with lower IDAC code.




              • 4. Re: Tuning IDAC Value for Inductive Sensing MagSense

                Hi Hari,


                I adjusted the used coil from above to 1,79V Vamp and used a Lx frequency of 2,2 MHz. The IDAC code is 120 to reach the 30% (3272) of the maximum value of raw counts. It works but the IDAC value is quite high.


                Than I tested 4 smaller Coils with a Vamp of 1,95 V. ( Dout: 10mm; N: 18; tank capacitor 390pF; RLx: 2,37kOhm; Other Parameters are the same like above)

                I adjusted the Vamp to 1,79-1,81V. Because of this i could degrease the IDAC value from 116 to 93 with the same resonant frequency of 1,92 MHz. There it worked.


                However I recognized also a side effect of degreasing the IDAC value. This results in a higher noise.

                Before the noise of the coils was around 5 to 15. With the degreased IDAC value the noise increased to 15-23 while the Signal only increased slightly from 381-439 to 376-575.



                How can i recognize an error of the IDAC?

                • 5. Re: Tuning IDAC Value for Inductive Sensing MagSense

                  Hi SeFu_4636006


                  1. Can you check the IDAC code set by the component with auto-calibration enabled?

                  2. Can you increase the tank capacitor (C) so that F0 is reduced? lower f0 will result in lower IDAC.

                  3. Can you probe the Rx line? The Rx line must be probed before coupling capacitor Cc. You will be able to observe a sine wave with amplitude = Vamp. If this is not a sine wave then, the tuning is incorrect and f0 calculated is wrong.


                  Can you also mention the coupling capacitor used in the design (Cc)?



                  • 6. Re: Tuning IDAC Value for Inductive Sensing MagSense

                    Hi Hari,


                    1. The IDAC code is between 67 and 71 in auto-calibration mode. The Lx frequency is set to 1,84kHz. The raw_counts are between 6740 and 6880 which seems a bit high for me. I found in the expression view the Parameter IsxRawCountCalibrationLevel which was set to 50 and changed it already to 30. With that Parameter set to 50 the IDAC code is 74 and the raw counts are between 7000 and 7200.

                    Are there more parameters to set the auto-calibration of the IDAC ? I use a slightly changed version of the sample code CE222867_MagSense_With_Feedback_LEDs. And now I am not certain what the function TuneMagSense does. Obviously it is involved in calibrating the IDAC Value, but it works with a percentage of 70%.


                    void TuneMagSense(void)


                        uint8 widgetIter;

                        uint16 biggerHalf;


                        /* Tuning */

                        for(widgetIter = 0; widgetIter < 4; widgetIter++)


                            /* Move buttons to more sensitive frequency. */

                            WD_STRUCT_PTR(widgetIter)->snsClk += 3;


                            /* Recalibrate Idacs for 70% sensitivity */



                            /* Scan the sensor */



                            /* Wait till scan is complete */



                            /* Process the widget */



                            biggerHalf = CINTA_RESULT > CINTB_RESULT ? CINTA_RESULT : CINTB_RESULT;


                            /* Update IDAC */

                            WD_STRUCT_PTR(widgetIter)->idacMod[0] =

                                ROUND_DIVIDE((WD_STRUCT_PTR(widgetIter)->idacMod[0] * biggerHalf * PERCENT_100),

                                    (PERCENT_70 * HALF_PERIOD_MAX(widgetIter)));





                    Could you please explain what the calculation in the end does?




                    2. Yes that is a possibility which works.

                    3. I probed the Rx line. It is a sine wave.


                    I use as recommended a 10 pF coupling capacitor for Vamp = 1.8V.


                    I also use a 100nF DC blocking capacitor in the Lx line.


                    4. Could you please explain me how the raw counts are derived?

                    5. Or do you have already information up to what frequency the IDAC code can be tuned in the limits of 30-90? Is it just frequency dependend or are there more parameters involved which have an impact on the IDAC code? (for example the setup of the resonant circuit)

                    • 7. Re: Tuning IDAC Value for Inductive Sensing MagSense

                      Hi SeFu_4636006


                      The raw counts are not derived. They are measured based on the physical inductance parameter. we do not have  a derived mathematical formula for raw counts of MagSense.


                      For a higher resonant frequency, the current required will also be higher. But it also depends on the vamp obtained, as higher Vamp results in more charge in the capacitor requiring more current.