Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyze residual noise at zero phase current #89

Open
3 of 6 tasks
nunoguedelha opened this issue Aug 5, 2019 · 14 comments
Open
3 of 6 tasks

Analyze residual noise at zero phase current #89

nunoguedelha opened this issue Aug 5, 2019 · 14 comments

Comments

@nunoguedelha
Copy link
Contributor

nunoguedelha commented Aug 5, 2019

When we set off all the PWM input signals, i.e. all terminal to terminal voltages are null, we should measure a null current, but instead we get a noisy measurement with a peak to peak amplitude of ~160mA and a quantization of ~20mA.
We need to check if this resolution and noise level is normal with respect to the expected performance of the current sensing module: hardware characteristics and configuration of the hall effect sensor in series with the ADC module.

Next actions

Conclusions

Sensitivity and quantization

  • The ACS714 and ADC configurations are OK.
  • The noise level and measurement quantization is as expected as per the HW architecture and configuration.
Hall Effect Sensor model ACS714LLCTR-20A-T.
Current Ip (input) range of 20A.
sensitivity of 100mV/A, noise level Vnoise(PP) = 11mV.
ADC fullscale 3.3V, 10bits
-> current measurement quantization: ADC LSB measures 50mA (without additional filtering)

Noise filtering

  • The filtering 47nF capacitors C28 and C29, expected to be connected to pin FILT6 of the ACS714 are actually absent on the 2FOC board revision F(), which is the current revision mounted on the iCub2.5 robots. (at least the Green has been checked).
    (
    ) "3336 . F - 2FOC, IIT - Electronic board with CAN interface, dual driver for brushless motors, power supply 18-48V, 20A full Band width, for iCub, new heatsink"
  • Discussion ongoing (Analyze residual noise at zero phase current #89 (comment))...

HES output offset and drift

@nunoguedelha
Copy link
Contributor Author

nunoguedelha commented Aug 5, 2019

The experiment was done using an icub-firmware debug build logging the phase currents qIa or qIc.

The debug build can be found in the icub-firmware-build repo, branch issue/#89_phase-current-noise, file CAN/2foc/2foc.hex.

The used branch can be found in the fork repo https://github.com/nunoguedelha/icub-firmware.git, debug branch debug/log-phase-currents, commit nunoguedelha@d934228.

The results are similar for both phases qIa and qIc (anyway, regarding qIb, in the 2FOC controller, qIb=-(qIa+qIc).
zero-current-ADC-noise-issue

The measurements are in mA. We can see the quantization at 20mA.

On the oscilloscope, we measured the phase currents of the stator terminals < 10mA.

Next step is to check the Hall sensor and ADC configurations.

@nunoguedelha
Copy link
Contributor Author

nunoguedelha commented Aug 5, 2019

Check the Hall Effect current sensor connection and datasheet

ACS714 connection (page 5 & 6)

ACS714connection-2

On the top array of inputs of the DSPIC33FJ (page 5), the inputs RA0 & RA1 get the IW1 & IU1 signals coming from the current HES ACS714 (page 6). The DSPIC33FJ128MC802 integrates the PWM controller. Its supply voltage is of 3.3V (value used to compute the ADC resolution).

ACS714connection
(This can be helpful if we wish to check the output signals OUPUT(7)-IU1 and OUPUT(7)-IW1 waveforms.)

The used Hall effect sensor is the ACS714. The FILT(6) output is set to 47nF. This capacitor seems to be missing in the 2FOC test board used in the tests reported here.

  • The ACS0714 datasheet specifies a sensitivity of 100mV/A (page 6, x20A PERFORMANCE CHARACTERISTICS) for an Ip = 20A (Optimized Accuracy Range).
    As we saw in the 2FOC logic schematics (FILT(6) -> 47nF), the bandwidth is set to 2kHz, for which the Vnoise(PP) = 11mV.

@ale-git How can we check which range is selected?
=> refer to answer here

@nunoguedelha
Copy link
Contributor Author

nunoguedelha commented Aug 5, 2019

Check ADC module configuration

In the 2FOC controller code ( ADCConfigPWMandDMAMode(...) in ADC.c ), the ADC is configured in 10bits mode (AD1CON1bits.AD12B = 0), and VCFG<2:0> is set to 0 (refer to Register 16-1: ADxCON1). This implies that the resolution in Volts is defined by (AVDD-AVSS)/(2^10).

We have to check the values of AVDD and AVSS. @ale-git can you take this action?
@ale-git answered here.

Register 16-1: ADxCON1: ADCx Control Register 1

Screen Shot 2019-08-05 at 16 32 30

Register 16-2: ADxCON2: ADCx Control Register 2

Screen Shot 2019-08-05 at 16 06 01

@nunoguedelha
Copy link
Contributor Author

CC @marcoaccame @DanielePucci

@claudiolorini
Copy link

As far as i can tell, the noise level you experiencing are 'normal' and intrinsic in the technology of the sensor (hes). This kind of noise (as far as it ha a 0 mean value) does not have relevant effect on the torque output but only audible effect.
I'd rather be more concerned of the non zero mean value that is generated by the ACS714-20 when there is a temperature change. This effect cannot be removed, but only mitigated calibrating the offset of the conversion chain (hes&adc) periodically. This kind of drift effects the torque ripple of the system.

@nunoguedelha
Copy link
Contributor Author

Thanks @claudiolorini for the details.

Regarding the intrinsic noise...

indeed, as a side note, the ACS0714 datasheet(page 6) mentions a sensitivity of 100mV/A and peak-to-peak noise of 11mV for an Optimized Accuracy Range Ip = 20A, which implies a peak-to-peak noise of 100mA.

  • But isn't this a high frequency noise that should be filtered by the FILT(6) -> 47nF ?

  • Has this noise spectrum ever been characterized? I understand that there is no direct impact on the torque, but couldn't it impact the Current tracking if that tracking is done at 20kHz or 40kHz?

non zero mean value...

@ale-git worked on the improvement of the HES+ADC chain offset and gains calibration but it is done only at startup. So as you advised, we need to implement a periodic calibration or a dynamic compensation that requires the identification of offset = f(temperature).

  • @ale-git has this drifting offset ever been addressed previously?

@ale-git
Copy link
Contributor

ale-git commented Aug 8, 2019

@nunoguedelha Giorgio Zini explained to me that with a sensitivity of 100 mV/A, reduced to 65.8 mV/A by the voltge divider made by R29, R30 and R103 resistors, and 3.3 V power supply, 10 bit converter, the LSB of the converter corresponds to 3.3 V / 1024 = 3.22 mV. Dividing by the sensitivity we obtain the current quantization that corresponds to the LSB: 3.22 mV / 65.8 mV/A = 50 mA of intrinsic error related to the LSB noise. The noise in the plot is reduced by the two subsequent sample filtering.
About the temperature drift, we could repeat the calibration any time the PWM is switched off, and every 20 seconds in OFF state.

@nunoguedelha
Copy link
Contributor Author

#89 (comment)

Regarding the intrinsic noise...

The noise in the plot is reduced by the two subsequent sample filtering.

Ok @ale-git , but I think we shouldn't see such noise in the first place with the filtering of C28 and C29 capacitors.

  • But isn't this a high frequency noise that should be filtered by the FILT(6) -> 47nF ?

Ciao @claudiolorini , the capacitors C28 and C29 are actually missing on the test board I'm using. Are we sure they are present in the 2FOC boards on the robot?

non zero mean value...

@claudiolorini @ale-git , is the module "Dynamic Offset Cancellation" active in the ACS0714 HES (page 3 of the datasheet)? Isn't it enough?

HES-schematics

@claudiolorini
Copy link

Boards in revision C does have the caps mounted:
"3336 . C - 2FOC, IIT - Electronic board with CAN interface, dual driver for brushless motors, power supply 18-48V, 20A"

Boards in revision F does not have the capacitors mounted:
"3336 . F - 2FOC, IIT - Electronic board with CAN interface, dual driver for brushless motors, power supply 18-48V, 20A full Band width, for iCub, new heatsink"
I suppose your robot uses this one.

The capacitors introduce a delay in the current control loop (20KHz), and this is definetly BAD.

By experimental tests, the internal offset correction is not 100% effective to avoid temperature or
stray-fields related offets.
Try heating the board or placig it near an iron part, you will see the current offset change.

@nunoguedelha
Copy link
Contributor Author

Boards in revision F does not have the capacitors mounted:
"3336 . F - 2FOC, IIT - Electronic board with CAN interface, dual driver for brushless motors, power supply 18-48V, 20A full Band width, for iCub, new heatsink"
I suppose your robot uses this one.

Ciao @Fabrizio69, can you please confirm that on iCubGenova04 (Greeny) we are using the 2FOC revision F?

@marcoaccame
Copy link
Contributor

Hi @nunoguedelha, I have just checked w/ @davidetome & @Miche19:
iCubGenova04 and most recent iCubs use revision F.

@nunoguedelha
Copy link
Contributor Author

Thanks @marcoaccame ! Sorry I hadn't update the issue, @Fabrizio69 had also confirmed this.

@nunoguedelha
Copy link
Contributor Author

@ale-git How can we check which range is selected?

As explaned by Giorgio Zini, the Ip current range depends on the model of the ACS714 IC, The one mounted on the 2FOC boards is the ACS714LLCTR-20A-T. A summary of the sensitivities depending on the models is given in the manual:
Screen Shot 2019-08-28 at 18 39 37
This confirms the 100mV/A sensitivity.

@claudiolorini
Copy link

LLCTR-20A-T

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants