Go Down

Topic: Arduino, CANBus shield motor control?? (Read 759 times) previous topic - next topic

cristybbb

Hey I am new to arduino and its programming... I'm doing a project that entails communicating with the arduino through C and using a CANBus shield to control a robotic hand. My problem is that I have a pretty basic understanding of C++ language and need to be able to send messages to the hand in the format of 0x101, 0x102... which refers to the mailbox ID for each digit.

I don't know how much more info you guys would need to help me but it has a message payload of 2 words (2 x 16 bits)
the HIGH word contains the direction of the digit (0=stop, 1=close digit, 2=open digit)
and the LOW word contains the PWM level to apply to the motor to adjust speed (100-700)

My goal is to write a code that can move the hand into a certain number of positions by moving individual digits. I'm thinking of connecting the Arduino to the shield using pins 10-13 and I dont know if each pin somehow corresponds to the digits individually. Matlab has a toolbox that has simple functions to code the messages in the format that I have them in except I can find similar ones for C.  ANY help would be great!!
THANKS!!

PaulS

Quote
I'm doing a project that entails communicating with the arduino through C

Communicating from what to the Arduino? Two directional or one?

Quote
and using a CANBus shield to control a robotic hand.

Standard questions. Which shield? Which hand?

Quote
My problem is that I have a pretty basic understanding of C++ language

That's a problem?

Quote
need to be able to send messages to the hand in the format of 0x101, 0x102... which refers to the mailbox ID for each digit.

So, what's the problem?

Quote
I don't know how much more info you guys would need to help me but it has a message payload of 2 words

First thing would be knowing what "it" refers to.

Quote
I'm thinking of connecting the Arduino to the shield using pins 10-13 and I dont know if each pin somehow corresponds to the digits individually.

That seems unlikely. If I look at my hand, there are at least 15 joints in the fingers alone. If each joint used a pin, then you'd need a lot more pins that 10 to 13.

Quote
Matlab has a toolbox that has simple functions to code the messages in the format that I have them in except I can find similar ones for C.

Explain what the input (to Matlab) is, and what the message looks like, and I'll bet we can help you spot the pattern.

cristybbb

The Arduino is being used in conjunction with the CANBus shield (its from sparkfun... thats what they call it) to communicate with an ILIMB hand. I'm going to assume its a two directional one. The datasheet that we got with the hand says the hand has a message payload of 2 words...
I'm not entirely sure how we are connecting the arduino to the sheild bc we assumed that if we get something like that toolbox on matlab for C we don't need to control each joint with a pin but if that actually happens to be the case maybe stacking the shield and arduino will be the better option.

http://www.mathworks.com/products/vehicle-network/examples.html?file=/products/demos/shipping/vnt/demoVNT_BasicCAN.html   
this link has some of the example commnads I've seen that I'm looking to find replicated in C  (ex: msgTx100 = canMessage(100, false, 0);)

also if there are any libraries I'd need to upload in order to use the C functions let me know

thanks!!

Go Up