0
\$\begingroup\$

I’m a student on a team developing this project. We are attempting to make an balancing system(by reaction wheel) with current and angle PID control. The whole circuit consists of dc motor, power supply, current sensor, and mpu6050(for angle). The process of the system is that angle PID control leads the amount of required current(in the form of duty rate for PWM in Arduino) and it passes current PID control to generate the amount of require torque (to keep it from over current). I did simulation things about the entire system by Simulink, Matlab. But implementation matters. enter image description here

Now I am working on the current part. First, I installed a current sensor(ina260) in dc motor + line. But the problem is that the current data should be continuous but the motor is controlled by PWM in motor driver and so, the data has so many noises followed by the PWM signals( i checked it by plotting on PC). I previous used Acs 758 analog current sensor but i failed to manage this problem too). As far as i know, Using filters for current signal could generate some delay of system but I do not know some good way to get data together without filter thing. And how can I do current PI control? Is there any good solution for that? I would so much appreciate it from bottom of my heart if you could give me some good advice...

enter image description here

*PWM setting = 3000hz *MCU = Arduino Uno *mpu6050 (angle sensor) *md30c (motor driver) *SPG300 (300w dc motor) *ina260 (current sensor/shunt resister based/i2c/up to 15A) *ACS 758(current sensor/Hall sensor/analog/up to 15A))

[Collected Current Signal] enter image description here

\$\endgroup\$
1
  • \$\begingroup\$ your INA can't even do 1000 samples a second. figure out how many it can do, then you have a ballpark target for your filter. even at "just" 3k, you should have plenty of time to filter without dropping sample rate or bluring useable info. \$\endgroup\$
    – dandavis
    Jul 19, 2021 at 18:56

2 Answers 2

0
\$\begingroup\$

Analog low pass filter is mandatory for the ADC anti aliasing. You should increase the PWM frequency, use enough high sampling rate for the ADC with an analog LPF with a cut-off 1/3 x ADC sampling freq. Then process everything in the MCU using a digital LPF FIR filter. Of course there will be a slight delay that will limit the dynamics of the system, but not so much if done properly.

I guess you would need an MCU with enough resources (computation speed).

\$\endgroup\$
0
\$\begingroup\$

This is a year old question, and we have not heard back from the OP, but I thought I might make some suggestions in case someone else has a similar problem.

You can effectively eliminate noise on the current signal by sampling it right after the PWM signal turns ON. At least this should give a consistent reading proportional to current. And you could sample the 3 kHz PWM at perhaps 10 to 20 samples per second, and perform a quick true RMS calculation.

A Hall effect sensor is a good way to read motor current, but there are also high side current shunt sensors like the HV7800 and INA195 that are inexpensive and fast enough.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.