Go Down

Topic: What Adurino do I need for Meccanoid? (Read 36699 times) previous topic - next topic

mtwannabe

I'ld love to know if you have done any more with your Meccanoid.  If so, if you be willing to post it.  We just bought a Arduino Mega and H-bridge and would like to see ho to connect it up so that we to can have a Meccanoid running like you did in the video.  Thanks a bunch.  Hopefully, you have gotten further with yours and can post some more info

laluciol6990

Hi

I consulted this forum a while ago to learn about Meccanoid and Arduino.
Using T. Volkova's code on the smaller robot, here is a draft tutorial if people want to do the same thing.
(it will also help me to rebuilt it when i will do something else)

Regards


Shaurya

Hi

I just set up a daisy chain of 2 meccano servos to my arduino and set one of the servo to LIM mode.

when i printed the servo positions to the serial montor using this command:

servo.communicate();
  servo.setServotoLIM(0);
    Serial.println(servo.getServoPosition(0));

I am getting this output:

18
0
18
0
35
0
78
0
136
0
168
0
239
0
240
0
130
0
65
0
0
0
0


i don't know why i am getting 0 after each correct position?

any help will be appreciated.
Regards

Ishang

If I buy this kit from smraza will the arduino clone mega board by them work with meccanoid?

I have the 4 feet meccanoid and would like to program it.

https://www.amazon.ca/Smraza-Complete-Ultimate-Tutorials-Controller/dp/B075TYRG72/ref=redir_mobile_desktop?_encoding=UTF8&psc=1&ref_=ox_sc_act_image_2&smid=AMIHZKLK542FQ

Is this a good kit or any other recommendations?

jlsilicon

#95
Jan 09, 2019, 09:44 pm Last Edit: Jan 09, 2019, 10:09 pm by jlsilicon
Just an update for MeccaBrain / Servo Motors Users :

* Looking at the code,
 I see that the Module Number (moduleNum) is included in the CheckSum () :
Code: [Select]
byte MeccaBrain :: calculateCheckSum(byte Data1, byte Data2, byte Data3, byte Data4)
{
  int CS;

  CS =  Data1 + Data2 + Data3 + Data4;  // ignore overflow
  CS = CS + (CS >> 8);                  // right shift 8 places
  CS = CS + (CS << 4);                  // left shift 4 places
  CS = CS & 0xF0;                       // mask off top nibble
  CS = CS | moduleNum;    // <<--**

  return CS;
}


I would take an educated guess that the Servos - do not recognize the Communicated Packets - unless the CheckSum + moduleNum matches it.
Initialize might be an exception though - how do the Servos identify their own Module Num ?
... Maybe the Servos block Output to the next Servo - and only output their own reply, if they are not initialized yet.

It may be possible to communicate to a single Motor,
without rotating through the other 3x Motors (present or not)
by simply specifying the ModuleNum in the CheckSum,
- and so Speed up the Control of the Motor(s).

Would suggest testing this, by setting the ModulNum in the SetServoPosition() func :
Code: [Select]
void MeccaBrain :: setServoPosition(int servoNum, byte pos)
{
  int servoPos = 0;

  /// MOD - JLC : ///
  moduleNum = servoNum ;

  if( moduleType[servoNum] == 'S' )
  {
 
    if(pos < 0x18)
    {
      servoPos = 0x18;
    }
    else
    if(pos > 0xE8)
    {
      servoPos = 0xE8;
    }
    else
    {
      servoPos = pos;
    }
 
    outputByte[servoNum] = servoPos;
 }
}


Has anyone see this or test this ?

-

Note - to fix the misread Servo as LED lockout, suggest adding this mod:
Code: [Select]
    /// SERVO MODULE IN : ///
    if (
inputByte == 0x01
/// REMOVED - Not Needed : ///
// && moduleType[moduleNum] == '_'
  )                 // if received back 0x01 (module ID is a servo), then change servo color to Blue
    {
    outputByte[moduleNum] = 0xF4;
    moduleType[moduleNum] = 'S';
    }


-

bmd1103

For anyone playing with these, I've done a bit of research and produced the attached.

Go Up