Code Monkey home page Code Monkey logo

Comments (9)

jtragtenberg avatar jtragtenberg commented on September 28, 2024

Another mistake in the parts:
C9 isn't a 0.1 uF capacitor as listed in the 0.1uF IMU parts list

from motioner.

itotaka avatar itotaka commented on September 28, 2024

the frizzing image tells you have to put the capacitor between the 5V and the Reset... that is dangerous... it missed one hole, its between GND and Reset.

It's fixed. Thank you!

Another mistake is in the parts list, it says that for the IMU that the 10kOhm resistors are the R5-9, while they are only from R5 to R8.

Fixed.

And another thing I noticed is that the mbed code is the only one missing in the github. You only put the binary, and I really want to understand what is going on and maybe improve it a bit if I can. Can you please put it there?

Sorry, I'm checking this right now, wait for a bit.

One last thing: You added a calibration process in the making tutorial but forgot to put the referred folder in gitHub: "Open the MOTIONER/Arduino/calibration folder and open calibrationServo.ino"... there is no calibration folder there...

Fixed, Please check here again.
https://github.com/YCAMInterlab/MOTIONER/wiki/Make-MOTIONER-IMU-and-Controller

C9 isn't a 0.1 uF capacitor as listed in the 0.1uF IMU parts list

Fixed.

Thanks!!!!

from motioner.

jtragtenberg avatar jtragtenberg commented on September 28, 2024

Thanks Takayuki!

just noticed one other thing: the controller battery connectors aren't in the buying list either.
I noticed you used in the picture two lipoly batteries and on the buying list you chose the 6 AA battery pack instead, but since I prefer the lipoly, I put the connectors there. The problem was that I put a 90˚ model of the connector, and the only way it fit was with the opposite polarity... Only after almost burning my board I read the eagle file and noticed the right polarity.
It would be nice to add to the parts list a straight jst connector and the barrel connectors too.

Thank you!

Here is a video of my first working IMU. Haven't calibrated them yet and is already very good!
https://youtu.be/LNvjPWxWtFw

I am planning on making an app for mapping the gestures from motioner to sound, I'll send you my updates!

from motioner.

jtragtenberg avatar jtragtenberg commented on September 28, 2024

You could also put in the buying list the servo motor and mdf boards for calibration...
And you could put as an alternative to the Silhouete for cutting the solder stencils a laser cutter. I made mine with these and they have worked great!

from motioner.

itotaka avatar itotaka commented on September 28, 2024

Here's MOTIONER mbed code, the place will be changed.
For now, please use this mbed repository.

https://developer.mbed.org/users/FalconOnishi/code/MotionerController/

and yes, we chose 6AA battery pack when we published, since Lipo battery is sometimes a bit dangerous. But maybe it's good to add description for who wanna use it.

Here is a video of my first working IMU. Haven't calibrated them yet and is already very good!

Thanks for sharing your video.
it's really good to see it's working at your place!!

You could also put in the buying list the servo motor and mdf boards for calibration...
And you could put as an alternative to the Silhouete for cutting the solder stencils a laser cutter. I made mine with these and they have worked great!

Great! We'd love to add these.
Thanks, it's very helpful!!

from motioner.

jtragtenberg avatar jtragtenberg commented on September 28, 2024

One other thing, Ito
I just realized that one of the components isn't specified in the buying list. The XBee Wifi has two models, the S6 and a new version: S6B. I bought the second one and just realized from the picture that you used S6. They seem to be compatible, but I don't know if the mbed code has to change at all.
All the configurations from S6 configuration file can be set on the S6B. There are, though some 20 configuration items that are new in this version that don't seem to make much of a change.

Since my board isn't sending any OSC messages (I checked with the motioner app as well as with PureData and also with OSC data monitor) I don't know if the problem is in the Controller Board, in the mbed code or in the XBee itself. There seems to be something going a lot wrong since the voltage regulator and the CAN controller are heating up a lot! After some seconds the four mbed leds 1 and 4 start blinking alternately with the leds 2 and 3, which is a mbed code error alert. I checked the voltage in all the power elements, and the 5v for mbed and 3.3v for xbee are fine.

Since I've never used mbed or xbee wifi before its taking a lot to understend the mbed code, but I hope I find a way to fix this problem.

Can it be a problem that I'm using only one IMU sensor to test? Does the mbed code break if all the sensors aren't connected? That wouldn't make sense, and the code doesn't seem to have anything like that. I want to, at first, use only 3 IMUs to monitor just one arm, so I just bought enough components to make these 3. Hope I can make them work soon...

It would be nice to specify in the list you used XBee Wifi S6

Thank you!

from motioner.

XianWorld avatar XianWorld commented on September 28, 2024

I have read all the three codes of IMU, Controller and Motion App, the message from IMU is include velocity and the control message is 'q':

void MotionerIMU::updateCAN()
{
    switch (getCANControlMessage()) {

        case 0: break; /// no message

        case 'q':
            //Serial.println("StartTransfer");
            digitalWrite(LED, HIGH);
            sendCANDataQuaternion();
            sendCANDataAux();
            digitalWrite(LED, LOW);
            break;

        default: break;
    }
}

But Controller only read the quaternion and send it to Motioner App:

                // 0to18 Joints and RX buffer*2(quaternion xy or zw) and 8 byte CAN data
                if (nodeId < N_JOINTS && slot < 2 && msg.len == 8) {
                    //gPc.printf("%x, %x\n\r", nodeId, slot);

                    for (int q=0; q<2; q++) { //quaternion x, y or z, w
                        for (int f=0; f<4; f++) { //float byte 0 - 4
                            //[node id][quaternion x, y or z, w][float bytes 0 - 4]
                            gTmpQuat[nodeId][q+slot*2].b[f] = msg.data[f+q*4];
                        }
                    }
                }

And I don't understand why did you add the position vector to the data length, but not send anything of it:

#define N_JOINTS (18)
#define DATA_LEN (4*4*N_JOINTS+3*4+4) //18*quaternion*float bytes + position vector*flot bytes + delimiter
void updateXBeeWiFi()
{
    IPv4TransmitRequest data;

    //XBee WiFi Transmit
    //IPv4TransmitRequest data;
    //int len = 2*4*18+2*3; //18*quaternion+3*vector q // short
    //int len = 4*4*18+4*3; //18*quaternion+3*vector // float
    //int len = 8; //18*quaternion+3*vector // float
    //char buf[len];

    // debug
    //for (int i=0; i<len; i++)
    //buf[i] = (char)('0'+i%70);

    for (int i=0; i<N_JOINTS; i++) {
        if (gReceived[i][0] && gReceived[i][1]) {
            for (int j=0; j<4; j++) {
                __gQuat__[i][j] = gTmpQuat[i][j].f;
            }
        }
    }

    uint8_t *buf = (uint8_t *)__gQuat__;

    buf[DATA_LEN-4] = (char)'a';
    buf[DATA_LEN-3] = (char)'b';
    buf[DATA_LEN-2] = (char)'c';
    buf[DATA_LEN-1] = (char)'d';


    IpAddr addr(192, 168, 2, 1);
    data.setAddress(addr);
    data.setDstPort(9750);
    data.setSrcPort(9750);
    data.setProtocol(PROTOCOL_UDP);
    //data.setPayload((uint8_t*)buf);
    //data.setPayloadLength(strlen(buf));
    data.setPayload(buf);
    data.setPayloadLength(DATA_LEN);
    data.setFrameId(gXBee.getNextFrameId());//0
    gXBee.send(data);

    //gPc.printf("len:%d\r\n",strlen(buf));
    const int r = gXBee.getWiResponse(TX_STATUS_RESPONSE, data.getFrameId());

    /// error
    if (r==-1) {
        gPc.printf("Fatal error! XBee WiFi didn't responce!\r\nTrying to reset modem again.");
        if (initXBeeWiFi(20)) {
            gPc.printf("Failure...");
            error("");
        } else {
            gPc.printf("succeed\r\n");
        }
    }
}

And the CAN control message send from Controller to IMU is 'b' and 'e', not 'q':

void beginTransmitQuaternion()
{
    sendCanMessage('b');
    for (int i=0; i<N_MBED_CAN; i++)
        sendMbedCanMessage(i, 'b');
}

//--------------------------------------------------------------
void endTransmitQuaternion()
{
    sendCanMessage('e');
    for (int i=0; i<N_MBED_CAN; i++)
        sendMbedCanMessage(i, 'e');
}

And the Motioner App read velocity from the message sent from Controller:

    const int    FLOAT_BYTES = 4;
    const int    QUATERNION_DIM = 4;
    const int    IMU_DATA_DIM = 5;
    const int    UDP_MESSAGE_LENGTH = IMU_DATA_DIM*FLOAT_BYTES*(NUM_JOINTS-N_END_SITE)+4;
    const string UDP_PACKET_DELIMITER = "abcd";
            for (int j=0; j<IMU_DATA_DIM; j++) { /// quaternion xyzw + velocity
                for (int k=0; k<FLOAT_BYTES; k++) { /// float bytes
                    /// i*4*5 + i*4 + k
                    const int idx =
                    (i-nEndSite)*IMU_DATA_DIM*FLOAT_BYTES + j*FLOAT_BYTES+k;
                    mData[i][j].b[k] = udpMessage[idx];
                }
                //if (ofGetFrameNum()%60==0)
                //    cout << mData[i][j].f << ",";
            }
            //if (ofGetFrameNum()%60==0)
            //    cout << endl;


            /// get velocity
            if (mData[i][4].f!=0.0f) {
                //cout << i << ":" << mData[i][4].f << endl;
                frame.velocity.at(i) = mData[i][4].f;
            }

According to all above, I judge that the code of Controller from mbed is old(or testing) version.

Please check it, thank you.

We are making the Motioner system according to your way, and now debug each parts together.

from motioner.

XianWorld avatar XianWorld commented on September 28, 2024

The Controller code is old version, would you pls upload new version.

Thx a lot.

from motioner.

gongyuzhen avatar gongyuzhen commented on September 28, 2024

The new version?

from motioner.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.