No it’s not same frequency.
You have 20 pole pairs.
So you will have 20 electrical revolutions for one mechanical revolution.
And there is an offset between the mechanical and electrical angle.
No it’s not same frequency.
You have 20 pole pairs.
So you will have 20 electrical revolutions for one mechanical revolution.
And there is an offset between the mechanical and electrical angle.
Maybe it looks like that because of the plot sample rate
yeah, could be the plot sample rate.
It looks wrong.
What did you set as driver power supply voltage, driver voltage limit and motor voltage limit?
What do you mean by starting phase actually?
I set 25V to the driver voltage_power_supply
I set 8V to the driver voltage_limit
I set 8V to the motor voltage_limit
and I set 5A to the motor current limit
The system is set in voltage and torque mode
I mean the first part where the library is trying to find the zero electric angle, the number of pair poles…
Don’t set driver.voltage_limit, it will then be equal to driver.voltage_power_supply.
This will center the modulation
Ok, now I’ve understood better how it works the driver voltage_limit
Can it be a problem on your hardware ?
[EDIT] Is the amplitude of phase current changing, or is the middle of the sinewave moving up and down ?
Maybe try sinusoidale modulation instead of SVPWM as a test.
I don’t know if could be an hw problem but I tested the current amplifier and the mcu with a constant current of 0.5A through the shunt and the mcu can read it correctly…
It’s the amplitude of the current that is changing.
The red and cyano signals are the phase current readed from the mcu and written out using two dac
I’ve tried with sinusoidale and I get the same result, seems like it’s something limiting the current or “oscillating”… Can be the angle sensor (AS5048) not perfectly aligned (centered) with the magnet?
I added the calibration and now the motor is spinning smoothly and no more vibrating. I’m trying the foc_current mode but I have some troubles with the PID, if I set in this way it seems working
motor->PID_current_q.P = 0.5;
motor->PID_current_d.P = 0.5;
motor->PID_current_q.I = 0.0;
motor->PID_current_d.I = 0.0;
motor->PID_current_q.D = 0.0;
motor->PID_current_d.D = 0.0;
motor->LPF_current_q.Tf = 0.0065;
motor->LPF_current_d.Tf = 0.0065;
motor->PID_current_q.limit = MOT_VOLT_LIMIT;
motor->PID_current_d.limit = MOT_VOLT_LIMIT;
motor->PID_current_q.output_ramp = 0.0;
motor->PID_current_d.output_ramp = 0.0;
motor->target = 5.0;
If I increase the I term the motor rise it speed uncontrollable. How can I tune this type of PID?
Which calibration? So the phase currents look better now?
The calibration for the encoder sensor and with the smoothing
Yes now the phase currents have the same amplitude, I tune the current PIDs in this way…
Not just offset calibration right? Was there some eccentricity?
Now I use calibration offset and the smoothing of the sensor… Yes there was some eccentricity. I have to keep testing it to be sure that the dq currents are dc…
I made all the parts with fusion 360 and I used the 3D model of the board to place the magnet in the center of the AS5048, but than I had to solder it by hand so here it comes the problem, it’s almost impossible to place the sensor in the right (perfect) position on the pcb by hand, so some eccentricity it will always occur.
Any advice for current PID tuning?