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

The amc2c binary moves a motor using CAN communication #426

Merged
merged 19 commits into from
Oct 17, 2023
Merged

The amc2c binary moves a motor using CAN communication #426

merged 19 commits into from
Oct 17, 2023

Conversation

marcoaccame
Copy link
Contributor

@marcoaccame marcoaccame commented Oct 17, 2023

Description

This PR enables the amc2c binary to move a motor in the same manner an amcbldc board does. This will allow us to remove one amcbldc board from the wrist of ergoCub.

Details

The AMC board hosts two cores, each running a different binary. We use the term amc to refer to the binary that runs on the CM7 core and the term amc2c to refer to what runs on the second core, the CM4.

The amc manages the ETH communication vs yarprobotinterface and the CAN communication vs motor control boards such as the amcbldc.

We use one amc and three amcbldc to control the wrist of ergoCub using following connections and xml files.

                               MOTOR 1              MOTOR 3             MOTOR 3
                                 |                    |                   |
     -AMC----------              |                    |                   | 
    | [amc]   CAN1 |o ---- o[amcbldc @ 1]o ---- o[amcbldc @ 2]o ---- o[amcbldc @ 3]o
     --------------
    | [amc2c] CAN2 |o 
     --------------
<group name="ACTUATOR">
    <param name="type">     foc         foc         foc         </param>
    <param name="port">     CAN1:1      CAN1:2      CAN1:3      </param>
</group>

However, the AMC board has onboard peripherals that can drive a motor in the same way the amcbldc does. So, in this PR we enable the amc2c binary, so far un-used, to exploit these peripherals and drive a motor.

For now we still use CAN communication between amc and amc2c . In the amc2c we have reserved the CAN2 peripheral to manage CAN frames exchange with the amc that uses CAN1 peripheral. Also, we have configured the amc2c to to behave as an amcbldc with CAN address equal to 3.

In this way, with the amc2c binary we shall be able to remove the amcbldc with address CAN1:3 by changing the connections in the following way and still retaining the same xml description.

                               MOTOR 1              MOTOR 3            
                                 |                    |                   
     -AMC----------              |                    |             
    | [amc]   CAN1 |o ---- o[amcbldc @ 1]o ---- o[amcbldc @ 2]o --
     --------------                                               |
    | [amc2c] CAN2 |o --------------------------------------------
     --------------    
          |
          |
        MOTOR 3

The next step will be to enable the amc and amc2c to use inter core communication (ICC) so that we can simplify the cabling in this way.

                               MOTOR 1              MOTOR 3            
                                 |                    |                   
     -AMC----------              |                    |             
    | [amc]   CAN1 |o ---- o[amcbldc @ 1]o ---- o[amcbldc @ 2]o
     --ICC---------                                               
    | [amc2c] CAN2 |o 
     --------------    
          |
          |
        MOTOR 3

The ICC however, will be the matter of further imminent PRs,, where I will give more details.

Tests

We have extensively tested the correct behavior running yarprobotinterface on a dedicated setup formed by an AMC board with a single motor and then directly on the wrist with an AMC board and two amcbldc boards.

Mergeability

The code of this PR is ready to be merged.

@marcoaccame marcoaccame marked this pull request as draft October 17, 2023 09:36
@marcoaccame marcoaccame marked this pull request as ready for review October 17, 2023 11:34
@marcoaccame marcoaccame merged commit 1df7ba4 into robotology:devel Oct 17, 2023
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.

2 participants