-
Notifications
You must be signed in to change notification settings - Fork 1
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
Setting configuration files - single motor with MC4plus and single motor with EMS4 and 2foc #15
Comments
Ciao @plinioMoreno and @wevmacedo, first of all, you'll surely need to tune the PID gains as pointed out here. You may start from a Here is an example for the joints of the iCub neck. |
The main issue from my point of view is that the calibration is not working, and I want to have this figured out before going to the PID tunning. The additional reason for this is that for our robot Vizzy, we already did the PID tunning and we know how to do it. I guess that to have the calibration working we do not need the PID perfectly tunned, or do we have to do that first? |
Ciao @plinioMoreno , if the PID gains are too small also the calibration will not work because the motor can't move, so you should increase them in order to have the motor moving/calibrating and then you can proceed w/ the fine tuning. |
Hi @davidetome, In the current setups, both motors are moving in one direction up until the hard stop happens. For this to happen, I believe the PWM has to be set largely enough for the motor start to move. Then, after the hard stop, is the motor controlled using the PID? I'm asking this just to understand what to expect. Regarding the PID setting, our motors are free (no gear box or anything attached to them), so I believe that a low value should work. In the case of the MC4 plus we should be able to do the PID tunning. But in the case of the 2foc connected to the EMS4, the joint goes to the state "Not configured" after executing the calibration, so we cannot control the joint. How can we setup the PID values in this case? |
I'm not familiar with the calibration procedure per se but I know that certain types do require the PID controllers to work during the process, which are tuned with ad hoc gains. @ale-git will get back to you with more info on this. |
HI @plinioMoreno, the PID is not used during type 5 calibration, but it is used in "go to startup position" after calibration.
With the MC4+ board it seems to me that the calibration is fine, but the joint can't reach the startup position after calibration. Probably it will after PID tuning. You should be able to change PID parameters at runtime by the yarpmotorgui as usual. About the EMS+2FOC the board succeeds in type 5 calibration, but it doesn't exit from calibration state. Since the 2FOC firmware for DC motors was born to be used in the R1 torso, which has type 9 calibration (torso tripod), and it has never been used with calibration type 5, I have to examine the firmware to understand what's going on. |
Hi @ale-git, thank you for the explanation. We will work on the MC4+, setting the min and max values of the PID controller as pointed here by @davidetome. About the EMS+2foc we will wait for your feedback on that. |
Hi @plinioMoreno, I examinated the EMS firmware, and unfortunately I've found out that calibration type 5 is compatible only with MC4+ board controlled motors and not with EMS/2FOC. The 2FOC DC firmware is dedicated to R1 torso linear actuators, with hard stop calibration that involves three coupled motors. What we can do for you is to modify the calibration type 9 in the EMS firmware to make it comply with a single motor, providing the .hex file as well as the modified source files. Please notice that we'll not be able to maintain this separated version nor integrate it in the official iCub software, because it would involve modifications in all the iCub software framework. If it is ok for you we can proceed in this way. |
Hi @ale-git, |
Sorry to chime in at this point, but we need to account also for organizational aspects here. Your side
Our side
If you deem that this plan looks good to you, we can proceed with points 1 and 2. Let us know! |
Hi @pattacini, Thank you for the additional info. The plan sounds good to me, so you can proceed with the experimental FW plus the code to handle the setup. I will take care of the feature request during this week. Thanks again @pattacini @ale-git @davidetome |
Great! |
Hi @plinioMoreno, this is the .hex file
|
Hi @ale-git, We uploaded the firmware to the EMS board, and we got an error related to the firmware versions (see below). What is the procedure to have the same versions in the pc and in the control board?
cc plinioMoreno |
Hi @wevmacedo, it seems to me that your https://github.com/robotology/yarp are outdated with respect to the board firmware, so you have to update them. |
Hi @ale-git, We updated the repos and we were able to run the test. The new calibration file is here. The behavior is as follows:
The output from the
The video of our test: 20210524_170145.mp4 |
Hi @wevmacedo, I think that the 2FOC isn't able to detect the hard stop because it is made by hand, and thus not stable enough. |
Hi @wevmacedo, I've noticed that the encoder value after a calibration with positive PWM is negative, so probably you have to invert the encoder sign. You can do it here: Line 51 in ca1650c
by changing 2048 to -2048. Can you try this, please? |
Hi @ale-git, We changed the encoder value like you said, but we continue with the same results mentioned above. The output from the yarprobotinterface is as follows:
|
Hi @wevmacedo, I've improved the hard stop detection in the 2FOC DC control. I've realized also that the 2FOC encoder management may have problems with multiple revolutions, so please be patient for a little while I'm going to fix it. |
Hi @wevmacedo, here it is the 2FOC firmware with rotational encoder support. |
Hi @ale-git, We uploaded the firmware from the previous message and got the following error:
Do we have to update all the repositories again? cc @wevmacedo |
We applied the changes from the pull request here, and we were not able to run the calibration type 5.
Regarding the MC4 plus, the behavior is the same as the initial test reported here and the most recent one here
Regarding the EMS4 with 2foc, the behavior is the same as the initial test reported here and the most recent one here
@davidetome and @ale-git let us know the next step here.
cc @pattacini @wevmacedo
The text was updated successfully, but these errors were encountered: