Fail to start sync loop - can't write to register

I’m working with a Poppy Arm based on the 6-DOF arm that can be found here:

My version has four MX28 servos (12V) and four XL320 servos (7.4V).
My python script is the following:
import pypot.robot arm = pypot.robot.from_json('poppy_longarm.json') print(arm.motors)

The json file is nearly identical to the poppy_right_arm.json provided in the 6DOF project documentation, but with different ID values for the XL320 servos, and with separate USB2dynamixel controllers for the XL320s and MX28s.

When I run my python script, it fails in set_register (line 92 of pypot/dynamixel/controller.py), with a KeyError: ‘pid’.

Can anyone help me find out what my issue is?

The code has run successfully one or two times, but is very unreliable.

Hi, are you using in the json file "protocol": 2, for the controller that drives the XL-320 motors?

Can you also give some details about the physical interface you are using? Sometimes this unreliable communication can come from faulty interface or cables.

Hi, thanks for the fast reply.

I am using protocol 2 for the XL320 servos, yes.

In the above diagram, the power board is based on the LM317 voltage regulator, as used in the 6DOF project. The board is made with stripboard.
Every servo in the arm is connected to the data bus (when I connect only one USB2Dynamixel to the data line, and use Dynamixel Wizard, all servos are detected reliably).

I’ve just had a small amount of success.

I did the following:

  1. Disconnect the two data lines, the MX-28 and XL-320 now are connected to separate data buses, each with it’s own USB2Dynamixel (and therefore dxl1.0 and dxl2.0 are separate)

  2. Set:
    "sync_read": true
    For the XL-320s in the .json file.

The result is still not entirely reliable but it is better. I’ll work on making my hardware more robust.

For the first point - yes you need to separate the busses for MX and XL servos and use separate controllers. In principle it would work to have them mixed on the same data bus (as the version 2 will ignore the version 1 packets as they miss the extra 0xFD preamble, while the version 1 will ignore the version 2 packets unless you have one servo with ID 0xFD which is very unlikely). BUT the way Pypot is designed the protocol usage is defined at the controller level and it is not really possible to mix the packets for the same controller.

I would also not use the LM317. The LDO is rated 1.5A and, depending on how many MX-28s you actually have on the bus that might be not sufficient. The MX-28 is rated 1.4A at stall at 12V. If the usage is 25% of the maximum and you have 4 on then bus you are at the limit. Any additional effort will stress the LDO that might cut of the power. Try using a dedicated power supply for that (12V are very easy to find at very good prices on eBay; get a 5A or more if you can), or use a 3S LiPo - those have no problem to provide 10 times the rated capacity (10C).