-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Current set to zero after switching the control mode to current #554
Comments
To provide a high-level perspective: The problem with this behavior is that when we switch to current mode while the robot is on the ground, the desired current is momentarily set to zero. Although this happens for a very short time, it is sufficient for the robot to collapse under its own weight. |
Ccing @ale-git that maybe knows what is happening |
I provided the ems fw here attached to @GiulioRomualdi to test on the robot. Please note the the fw I provided is based on the current version on the robot (3.95) and not on the top of the devel branch. Thanks @GiulioRomualdi for the tests! |
Thank you @valegagge! 🎉 I'm currently testing the firmware on ergoCubSN002. I flashed the board 10.0.1.6 the right upper leg Here the output of the interface This is the video of the experiment 20250116_162539.mp4 |
Hi @GiulioRomualdi , Now the solution is to provide the current value of |
A possibility is to to use the same filter @ale-git implemented back in time (an average between n samples discarding the max / min values) |
yep! |
Since the 2FOC can run in three different control modes (pwm, current, velocity), we decided for the clean transition mode that resets the references until a new reference value is received. We can use instead the smooth transition mode, that uses the present feedback as new reference. Thus, 1) moving from current or pwm mode to velocity, we can set the measured velocity as reference, 2) moving from current or velocity to pwm, we can set the present pwm as reference, 3) moving from velocity or pwm to current, we can use the present current feedback (filtered) as input. |
Hi @ale-git , In addition, we need to remember that the fw of 2foc 3.3.38 already provides a filtered current. |
Ok. Just for clarity, my proposal is to implement all points 1, 2 and 3. |
sure! I see that in some cases there are some smooth transitions, but I need to go in detail with all of them. In order to fix this issue I started from the point 3. |
I’m currently working on the current control mode and noticed an issue. When switching the control mode from position to current, the setpoint is set to 0.
However, when switching from position to torque, the setpoint in torque is set to match the estimated value.
After discussing this with @valegagge, it seems this might be a bug in the 2foc implementation, where the setpoint in the current mode is not being set correctly.
Here, it's a video showing the behaviour
Screencast.from.01-13-2025.04_55_50.PM.webm
The text was updated successfully, but these errors were encountered: