Skip to content
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

Handling of overcurrent flag #83

Merged
merged 1 commit into from
Mar 6, 2024
Merged

Handling of overcurrent flag #83

merged 1 commit into from
Mar 6, 2024

Conversation

pattacini
Copy link
Member

@pattacini pattacini commented Feb 16, 2024

This PR addresses #58 by adding up the transmission of the overcurrent flag via CAN.

Here's a list of things I did:

🔘 Updated Flags in the dictionary

image

🔘 Updated SupervisorRX FSM

image

🔘 Updated SupervisorTX/MSG_STATUS_HANDLER FSM

image

🔘 Updated CAN_Encoder/STATUS/format_status_pck function

function pl = format_status_pck(control_mode, pwm_fbk, flags, shift, CAN_VOLT_REF_SHIFT)

pl = uint8((zeros(8, 1)));

pl(1) = uint8(control_mode);

pl(2) = uint8(0);

tmp1 = bitshift(pwm_fbk, CAN_VOLT_REF_SHIFT - shift);
tmp2 = typecast(tmp1, 'uint8');
pl(3) = tmp2(1);
pl(4) = tmp2(2);

% See https://github.com/robotology/icub-firmware/blob/devel/emBODY/eBcode/arch-arm/board/amc2c/bsp/motorhal/motorhal_faults.h
pl(5) = bitset(pl(5), 1, flags.ExternalFaultAsserted);
pl(5) = bitset(pl(5), 4, flags.OverCurrentFailure);
pl(6) = uint8(0);
pl(7) = uint8(0);
pl(8) = uint8(0);

📝 AOB

Warning

I also had to update some test models (see the tab Files changed) to comply with the changes in the dictionary.

Note

@mfussi66, we're required to port these modifications to the new architectural model.

⚙️ Tests

Important

The changes need to be tested!


cc @valegagge @Nicogene @mfussi66 @sgiraz

@pattacini pattacini self-assigned this Feb 16, 2024
@pattacini pattacini linked an issue Feb 16, 2024 that may be closed by this pull request
@pattacini
Copy link
Member Author

We need to finalize the test of this PR within this week.
cc @sgiraz @Nicogene

@pattacini
Copy link
Member Author

/remind tomorrow

Copy link

octo-reminder bot commented Feb 27, 2024

Reminder
Wednesday, February 28, 2024 10:00 AM (GMT+01:00)

Copy link

octo-reminder bot commented Feb 28, 2024

🔔 @pattacini

@sgiraz
Copy link
Contributor

sgiraz commented Mar 6, 2024

Hi @pattacini,

I'm going to test this features in the next few hours , stay tuned! 📢

cc @Nicogene

@sgiraz
Copy link
Contributor

sgiraz commented Mar 6, 2024

Hi @pattacini,

Here are the results promised:

yarpmotorgui_teY1F2z47a.mp4

I tested the new codegen on AMC2C with the following current limits using the yarprobotinterface:

        <param name="motorNominalCurrents">     30               </param>
        <param name="motorPeakCurrents">        40               </param>
        <param name="motorOverloadCurrents">    50               </param>

I also tested succefully the same codegen w/ AMCBLDC using the experiment-supervisor test model.

A new PR on icub-firmware and icub-firmware-build will follow. I think we can merge this PR ✅.

cc @mfussi66 @marcoaccame @Nicogene

@pattacini
Copy link
Member Author

Thanks heaps!

@mfussi66
Copy link
Member

mfussi66 commented Mar 6, 2024

I'll address the change asap on the WIP version of the new architectural model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AMCBLDC: supervisorTX doesn't handle the overcurrent flag.
3 participants