robotology / icub-firmware

iCub Firmware
Other
12 stars 30 forks source link

The motor temperature are sent by 2FOC and propagated by EMS toward the YRI #418

Closed valegagge closed 1 year ago

valegagge commented 1 year ago

As per title. We need to define a new CAN periodic message and its period, but the ETH protocol is fine. The 2FOC and EMS fw should be updated according.

DoD The temperature values are stored in the EmbObjMotionControl. To test this feature, we need a test module that reads the motor temperature.

valegagge commented 1 year ago

How to develop on 2foc: IDE and compiler

valegagge commented 1 year ago

Regarding the message containing the temperature value, I suggest using the ADDTITIONAL_STATUS.

Currently, ADDTITIONAL_STATUS message contains only the interaction_mode in the first byte.

In the canBusMotionControl devices I noticed that the parser gets the interaction_mode without any check on the message length. see here

In the firmware:

MSECode commented 1 year ago

Update regarding the parsing of the CAN frames:

Here the section of the code that does the parsing of the message sent by the 2FOC code:

image

As you can see, we are parsing the CAN frames using the for loop over the only 2 joints that the FOC can control. Therefore, we are taking the third and fourth bytes of the frame and saving to the temperature of the first motor entity. Then the fifth and sixth bytes (being the temperature a typedef int16_t) are saved to the temperature of the second motor entity.

MSECode commented 1 year ago

Done. Remains only to define the conversion factor from V diff to Celsius

MSECode commented 1 year ago

The activity has been completed and tested. The temperature values are stored in the embObjMotionControl class in this array: double *_temperatureValues and a yarp module for retrieving the motor temperature and sending it to a user-defined yarp port has been developed and published here: https://github.com/MSECode/motionControlModule/tree/feature/temperatureManager.

It is possible to check the output of the test in this issue

valegagge commented 1 year ago

Dod satisfied. closing