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

Support of 7 joints in the mk3 hand #179

Merged
merged 15 commits into from
Apr 27, 2021
Merged

Support of 7 joints in the mk3 hand #179

merged 15 commits into from
Apr 27, 2021

Conversation

marcoaccame
Copy link
Contributor

@marcoaccame marcoaccame commented Apr 12, 2021

Aim of the PR

This PR is part of a set of PRs which adds support to manage the movement of the 7 joints of the mk3 hand.

The new MC mode is offered by the pair mc4plus and pmc and is hence nicknamed eomn_serv_MC_mc4pluspmc.

In order to do that, some features in icub-firmware and icub-firmware-shared are required in order to:

  • provide proper configuration of the new mode eomn_serv_MC_mc4pluspmc,
  • extend the data structures managed by the mc4plus board for the MC from 4 to 7.

The first feature adds changes to the data structures transmitted over ETH and hence has required an increase of the MN protocol version.

To limit the effect of the latter feature (which needs more RAM) the changes have been been conditioned to the macro EOTHESERVICES_customize_handV3_7joints, which is defined so far only by the project mc4plus.handv3.uvprojx.

For this reason the FW of the standard ems, mc4plus and mc2plus boards does not have much impact.

Description of the changes

The mc4plus directly moves the four joints of the hand in open close mode (thumb, index, medium, pinky) by controlling 4 DC motors. That is standard behaviour for the mc4plus.

However, the mc4plus also manages other three joints (thumb metacarpus, thumb rotation, index adduction) which are actuated by piezo electric motors driven by the pmc board.

As such, the MController inside the mc4plus board has been extended to contain data structures for 7 joints/motors rather than for 4 as it happens so far.

The extension of data structures to hold more entities (and hence use more RAM) and the addition of some extra functions is enabled by macro EOTHESERVICES_customize_handV3_7joints.

The aim is that with macro EOTHESERVICES_customize_handV3_7joints being not defined the ems and mc4plus don't compile some parts of code, don't use additional RAM and don't change much their behaviour.

Associated PRs

This PR is a part of a set of related PRs:

  • PR on icub-firmware-shared: it adds required data structures;
  • PR on icub-firmware: it adds the FW of the mc4plus in a dedicated project called mc4plus.handv3.uvprojx;
  • PR on icub-firmware-build: it adds the FW of the recompiled versions of the ems, mc4plus, mc2plus;
  • PR on icub-main: it adds capability of parsing xml file for the mode eomn_serv_MC_mc4pluspmc;
  • PR on robots-configuration: it adds the xml files for the experimental setup wristmk2_handmk3.

Tests

Two kind of tests were done. Both of them were successful.

  • Compatibility tests. They were done on the iCubGenova04 robot so that we can be sure that the FW produced for ems and mc4plus still works fine. The test showed that the robot, in its iRonCub version is able to move the head and the upper arms using the new versions of mc4plus and ems.
  • Tests on the 7 joints of the hand mk3. They were done on the dedicated setup. The tests showed the correct behaviour of yarprobotinterface and of the yarpmotorgui for the case of emulated piezo motors and emulated magnetic encoders.

Final comment

This PR adds support for the movement of the new hand and does not add any new features to the standard robots. We have now yarprobotinterface running properly for the new hand with 7 fingers. But we also made sure that the robots keep on working as before.

some changes were needed on:

- EOtheEncoderReader which now manages up to 7 encoders
- EOtheMotionController which now manages up to 7 joints and the new eo_motcon_mode_mc4pluspmc
- EOtheCANmapping whuch now supports more than two values for eObrd_caninsideindex_t
- Controller and Motor which:
  - manage the case of 7 joints (before they were 4 only)
  - now the two types MC_ACTUATION_t and MC_MOTOR_HARDWARE_t to manage what previously was
    coded w/ HARDWARE_2FOC, HARDWARE_MC4p and UNKNOWN. in this way we have an actuation,
    the ACT_TYPE_MC4pPMC, which can have 4 motors of type HARDWARE_MC4p and 3 of type HARDWARE_PMC.
  - for motors of type HARDWARE_PMC we have actuation through CAN messages.
- ETH callbacks such as eoprot_fun_UPDT_mc_joint_config() etc which manage the case eo_motcon_mode_mc4pluspmc

moreover, the macro EOTHESERVICES_customize_handV3_7joints is defined in order to increase the RAM required
for managing 7 joints instead of 4
the connector J13 is now named correctly (it was wrongly called J11)
… tests

it is activated by macro EMBOT_HW_BSP_PMC_emulates_SNSR_PZM
by undef of TESTRTC_IS_ACTIVE
… inside code enabled by EOTHESERVICES_customize_handV3_7joints
…stomize_handV3_7joints is defined.

otherwise the code is exactly the same as for the case of 4 joints.
…ant bit of ID of CAN protocol to represent the joint number
ems     -> 3.39
mc4plus -> 3.32
mc2plus -> 3.23
@marcoaccame marcoaccame changed the title [WIP] Support of 7 joints in the mk3 hand Support of 7 joints in the mk3 hand Apr 26, 2021
@marcoaccame marcoaccame marked this pull request as ready for review April 27, 2021 07:07
@marcoaccame marcoaccame merged commit 6f2bb1e into robotology:devel Apr 27, 2021
@marcoaccame marcoaccame deleted the feat/mc4pluspmc branch January 11, 2022 09:44
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.

1 participant