This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I use the TMS320F28035 card and controlSUITE code to control a motor. During the control process, I have the AD converter to convert some analog signal to digital signal. Now I have a problem. That is in the debug mode, the whole system works good and AD results are good all the time, but in the stand alone mode, the system still works but the AD results have huge variation. In both modes, they convert the same signal. I thought it's due to the calibration. But actually in my code, it has the AD calibration code during system initialization as below:
SysCtrlRegs.PCLKCR0.bit.ADCENCLK = 1; // Enable ADC peripheral clock
(*Device_cal)(); // Auto-calibrate from TI OTP
SysCtrlRegs.PCLKCR0.bit.ADCENCLK = 0; // Return ADC clock to original state
I measured the analog signal in both mode by using the oscilloscope, they are the same.
Is there anyone who has any suggestion about this?
Hi,
What do you mean by debug mode vs standalone mode?
Debug = run with emulator & run in some combination of flash/ram? Or run with emulator & run only in ram?
Standalone = run without emulator & run in some combination of flash/ram?
What happens if you try to sample a voltage that is know to be constant and clean?
[perhaps if you have a spare ADC channel which goes to a header you can try to read the voltage of a standard alkaline AAA battery while your code is in both modes]
Thank you,
Brett
Debug mode = run with emulator & run in flash.
Standalone = run without emulator & run in flash?
If I sample a constant voltage, it's the same value both in debug mode and stand alone mode. I just found today if I turn off the motor, then the AD result will be right. If I turn on the motor again, the AD results will be variable again. That means the motor running has some effect on the AD results. But why in the debug mode, it's right?
Hi,
1) Are you running your motor control system open-loop or closed-loop when you see this? Please note that if you're running closed-loop, code discrepancies not directly related to the ADC may end up affecting the ADC results - and this means that what you are seeing may not actually be related to the ADC.
2) I cannot think of why running from your 'debug' mode vs your 'standalone' mode would affect the ADC from a peripheral perspective.
Thank you,
Brett
Hi,
huaping wang said:
I was running the motor control system closed-loop. What do you mean by "code discrepancies not directly related to the ADC may end up affecting the ADC results "? Why what I saw is not related to the ADC? I did see the constant value is the same in both mode because I sent it out by CAN bus and I can see it in my interface.
I finally figure it out. it's due to the capacitance on my board, after I removed some capacitor on my board, everything is normal right now. So it's not software issue, it's hardware.
Hi Huaping,
Out of curiosity (and for future readers), what signal was the capacitor connected to?
Thank you,
Brett