Closed Juanduino closed 11 months ago
Setting the voltage limit and PSU voltage manually gives better results... hmmm
BLDCDriver3PWM::BLDCDriver3PWM(int phA, int phB, int phC, int en1, int en2, int en3){
// Pin initialization
pwmA = phA;
pwmB = phB;
pwmC = phC;
// enable_pin pin
enableA_pin = en1;
enableB_pin = en2;
enableC_pin = en3;
// default power-supply value
voltage_power_supply = 12;
voltage_limit = 1;
}
If you wonder how open loop velocity mode looks on a LED setup :P
Hey @Juanduino The first issue is really an issue related to the current implemntaiton of the library. We are mostly handling the pin numbers and do not handle well the wo_assotiations. I am not sure if this makes problems in your case but we will be working on it. @runger1101001 can give you some more updates regarding the samd architecture.
Regarding the voltage being at the half of the duty cycle. this is normal. See in documentation: https://docs.simplefoc.com/bldcdriver3pwm#step-22-voltages
basically we have two voltage limits implemented. One in the driver and one in the motor. The driver one actually does what you expect it to do. It limits the max dc voltage the code is allowed to set.
driver.voltage_power_supply = 12V;
driver.voltage_limit = 10V; // by default driver.voltage_power_supply
Now the motor voltage limit is the maximal D and Q voltage magnitude allowed. That will more or less define the magnitude of the sine waves that the code is allowed to set to the motor.
motor.voltage_limit = 3V;
And the max you can set for this value is 0.5-0.75 of the driver.voltage_limit
. But even if you set this value to more than driver.voltage_limit
the values will still be limited to the driver.voltage_limit
in the driver.
Lastly in terms of the half of the duty always. That is due to the fact that we are always setting relative voltage to the motor phases and for that setting 0 duty cycle of 0.5 duty cycle to all of them at once is exactly the same. Because the relative voltage in between any of the two phases will be zero. The image in the docs will maybe give you a better idea https://docs.simplefoc.com/bldcdriver3pwm#step-22-voltages
Now we do support feature to disabled the centered pwm (centered at the 0.5 of the driver.voltage_limit
), but it seems that I've forgot to document it.
If you wish disable the centered pwm set the:
motor.modulation_centered = 0;
I see....
Then I will recommend updating the : https://github.com/simplefoc/Arduino-FOC/blob/master/examples/motion_control/open_loop_motor_control/open_loop_velocity_example/open_loop_velocity_example.ino
Someone might get burnt...
A voltage limit has been added to this example, so I will now close this issue... :-)
There are two bugs here, with regards to the SAMD/E implementation.
First of, the CCBUF, should not be fed with the channel number, but the wo association. I think, correct me if im wrong?
[Edit], I can see it is working with CCBUF and channel number. My mistake.
Danger BUG!
The pwm multiplier, when running open_loop_velocity is around 0.5, no matter which voltage limit I set. This equals 50% duty cycle and potentially a fried controller or motor.