getting a sensor data from ATI mini45/Net FT board using Seeed CAN-Bus shield

Hello everyone. I am Soichiro (Sam), an university student working in a robotics lab.

I am working on a project of humanoid robot’s low level controller right now. The current objective is to obtain a sensor data from ATI mini45 with Net F/T board using Arduino + Seeed CAN-BUS shield v1.2.

mini45: https://www.ati-ia.com/products/ft/ft_models.aspx?id=Mini45

Net F/T board: https://www.ati-ia.com/app_content/documents/9620-05-NET%20FT.pdf

CAN shield: http://wiki.seeedstudio.com/CAN-BUS_Shield_V1.2/

What I am trying to do is to make a board to send a sensor data to Arduino. The Net F/T board is supposed to return a sensor data when Arduino sends a message request through CAN network.

However, currently it is not working the way it’s supposed to. After Arduino receives a few messages from Net F/T board, it receives nothing. Also indicator LED flashes greeen, which means CAN connection is not established. (I also attached a few details about this issue.)

As I’m no expert about CAN protocol, I am doing what I can do. But I cannot figure out how to make this work. Can anyone help me with this issue? I would really appreciate it.

code_running.ino (1.65 KB)

Your code sends a continuous stream of requests with no time gap to allow the F/T board to respond.

The documentation says "If a data request message is received during an ongoing transmission, the ongoing transmission will be terminated and the new request processed."

Therefore after sending a request you need to wait for a response before sending the next request.

Thank you very much for the quick reply mikb55 and clear advice! Since I was totally out of the idea to fix it, this is really helpful.

I modified my code so that it can allow the iteration to wait for 100ms and 1000ms. But the arduino still does not collect the data continuously.

I attached the code I ran below. Do you see what’s casing an error…?

Again, I really appreciate your help. Thank you very much.

code_running_modified.ino.ino (1.73 KB)

Your code needs to do the following: Send a request message. Sit in a 'while loop' repeatedly checking to see if any data has arrived. Only once you have received a message should you exit this while loop and send the next request.

There is no need for delay(). This just limits the rate at which you can send requests.

Thank you mikb55.

I have tried to wait the response with while loop under the condition below:

    unsigned char smtp[1] = {0x01};

    CAN.sendMsgBuf(0x1B0, 1, 1, stmp);

    while (CAN.checkReceive() != CAN_MSGAVAIL) ;
    //wait until there are available messages coming in

    CAN.readMsgBuf(&len, buf);
    //read a data coming in

But it does not seem like it’s working.

What I’m getting from the board is:

CAN.checkReceive() gives the int value 4
CAN_MSGAVIAL gives the int value 3

Do you see what is going on behind this code?

I really appreciate your help.
Thank you.

code_running_modified.ino (1.86 KB)

Need {}

https://www.tutorialspoint.com/cprogramming/c_while_loop.htm

Sorry it’s been a while.

I have finally fixed the problem. The thing was the configuration setting of the Net F/T board. After I changed the communication protocol, CAN_BUS communication got working.

Thank you very much for the help.