We are attempting to make an balancing system (with a reaction wheel) with current and angle PID control.
The whole circuit consists of a DC motor, a power supply, a current sensor, and an MPU6050 (for angle). The process of the system is that the angle PID control determines the amount of required current (in the form of duty cycle for PWM in an Arduino) and it passes current PID control to generate the amount of required torque (to keep it from over-current).
I did simulated parts of the entire system in Simulink and Matlab, but implementation matters.
Now I am working on the current part. First, I installed a current sensor (INA260) in the DC motor's + line, but the problem is that the current data should be continuous. The motor is controlled by PWM in the motor driver and so the data has much noise becayse of the PWM signals (I checked it by plotting on a PC).
I previously used an ACS758 analog current sensor but I failed to manage this problem then as well. As far as I know, using filters for the current signal could generate some delay in the system but I do not know some good way to get data together without a filter.
And how can I do current PI control? Is there any good solution for that?
- PWM setting = 3000 Hz
- MCU = Arduino Uno
- MPU6050 (angle sensor)
- MD30C (motor driver)
- SPG300 (300 W DC motor)
- INA260 (current sensor/shunt resister based/I2C/up to 15 A)
- ACS758 (current sensor/Hall sensor/analog/up to 15 A))
Collected Current Signal: