Strong side ready

My robot hand's strong side is now ready and tested. It moves well and fast. Its commendable over serial using python program.

Visual representation of 3 byte communication.

I'm using 3 byte packets for communication. First bit of each byte shows what type of byte it is. The whole packet contains address byte, and  two number bytes. The address consists of two parts: 3 bit MCU address and  4 bit function address. I need address because I want to put several mcu-s on same communication line. The function address shows what function I want to use. Possible functions include: move x joint, ask where joint X is. Ask how much current the servos are using and so on. Number bytes are used to send one 14 bit number. So numbers from 0 to 16384 are supported. I could have used 7 bit numbers but I thought that 7 bit is not precise enough.

The hardware has potentiometers in each joint for feedback. I send the desired position over UART and software on atmega tries to move joint to there. I use soft acceleration and breaking but the software isn't perfect yet. Idea is to implement ROS support in it so I could use massive amount of inverse and forward kinematics code and 3D support in ROS.

The latest code can be downloaded from here.

2 thoughts on “Strong side ready

  1. Mmmm, I love the lab setup. It really looks pretty and neat! Mutch better than mine was before the storage compartments. 😀 Now... maybe equal. not sure though.

  2. cool, I used a similar protocol. my software current does PI control, I'll get to PID sometime. I only support 10 bit values tho. Although the addressing is individual, I put 4 loop controllers on one avr, currently they mimmic 4 individual controllers. this is so I can make larger or smaller controllers and its transparent to the software. I use rs232 comms, everything is split and merged to/from all the avrs so the protocol ensures that only one controller can reply at once.

    good project!

    Servo Recieves:

    [0][c3][c2][c1][c0][v2][v1][v0]
    [1][v9][v8][v7][v6][v5][v4][v3]

    c0-c3 are command
    v0-v9 are value

    Commands:
    0 listen (servo number) 256 = all {always obey command} // sticks through listen once
    1 ignore (servo number) 256 = all {always obey command} // overrides listen once
    2 One Time listen (servo number) {always obey command}
    3 set flags (flags) (+toggle debug) { bitwise obey }
    0 enguage cached position {always obey command}
    1 turn servo on {obey if listening}
    2 turn servo off {obey if listening}
    3 set cmdpos to curpos {obey if listening}
    4 set servo position (position) {obey if listening}
    5 set cached position (position) {obey if listening}
    6 get servo current (servo number) {servo number}
    7 get servo position (servo number) {servo number}
    8 send device model (servo number) {servo number}

Leave a Reply

Your email address will not be published. Required fields are marked *