What Adurino do I need for Meccanoid?

Adruino, Arduino. OK got it. XD
I was thinking like the sensor would connect to the input and as a output I could program it to move. Like if it detects something with a ultrasonic, it'll raise it's hands or something like that.

Darwin7:
I was thinking like the sensor would connect to the input and as a output I could program it to move. Like if it detects something with a ultrasonic, it'll raise it's hands or something like that.

You can do that with an Arduino but not with the MeccaBrain.

As I've mentioned a couple of times, the MeccaBrain appears to only play back recorded moves or move with response from the motion capture app. It doesn't look like it can be programmed to take action based on sensor input (other than voice commands).

Well, if there is an Arduino library for the MeccaBrain, then there is very good reason to believe that the MeccaBrain is Arduino compatible. Which means that I can write to and read from I/O pins in the MeccaBrain. It's not an elegant solution, but I can get low-level functionality that way.

goodinventor:
Well, if there is an Arduino library for the MeccaBrain,

The Arduino library is so you can use Meccanoid servos and LEDs with with an Arduino. You can't load your own program onto the MeccaBrain.

You can't really "program" the MeccaBrain. You can only record movements and sound.

Hello everybody.
I suppose there a several way to use Arduino on Meccanoid:

-(1) Using Arduino in place of MeccaBrain: Arduino<->Smartmodule, in this case the link is serial, using the library provided by Meccano. In this case, you can use a smartmodule (servo or led) from Meccano, and to drive it with an Arduino board. You do not use your MeccaBrain.

-(2) Using a non-Meccano servo (standard servo) and Arduino: Arduino<->Servo. Use standard library, but no link with Meccano on anay side. I suppose it's not the goal :slight_smile:

-(3) Using a non-Meccano servo to connect it to MeccaBrain. The Arduino is used to "translate" the link:

MeccaBrain <-- Meccano protocol -> Arduino <- standard serial or anything else -> Standard servo

In the last case, the Arduino has to "speak Meccano" to the MeccaBrain, and is connected to the servo as usual (using standard library). The main work to be done is to program the Arduino as an interface, so it has to receive the MeccaBrain frames (serial), and to answer to it (reading the protocol, it's still serial, but looks like Manchester Protocol: 1 or 0 s coded by the "High" time, the bit time is constant. For the received frame, it looks like standard serial: 1 is High level, 0 is Low level.
As conclusion, the Meccano library has to be "reversed", as the library is for case (1). in case (3) you have to receive Meccabrain frames and to send "servo" frames, it's just the opposite direction as the library. But I think it's not so hard to program.

But at the end, even if your Arduino is "concidered" as a smartmodule by the MeccaBrain (and it's what I want to do!), we still not have any way to program the MeccaBrain! When Meccano advertises on "open source", it's a trick: they do not yet give any way to program MeccaBrain! I hope they will produce a "programming tool" once a day. But I'm waiting for it!

Well, I hope to have been clear enough.
By the way, sorry for my "frenchglish" :slight_smile:

DuaneDegn:
The Arduino library is so you can use Meccanoid servos and LEDs with with an Arduino. You can't load your own program onto the MeccaBrain.

You can't really "program" the MeccaBrain. You can only record movements and sound.

Yeah, it's most likely Arduino would be like another brain for Meccanoid, which is fine as well. Speaking of, a Meccano blog hosted on their site has released new models promising more memory and enhanced features for the MeccaBrain. They've also said that it should be ready to work with Arduino with no need to rebuild it if you already built it in its humanoid form.

F4HFM:
But at the end, even if your Arduino is "concidered" as a smartmodule by the MeccaBrain (and it's what I want to do!), we still not have any way to program the MeccaBrain! When Meccano advertises on "open source", it's a trick: they do not yet give any way to program MeccaBrain! I hope they will produce a "programming tool" once a day. But I'm waiting for it!

Well, I hope to have been clear enough.
By the way, sorry for my "frenchglish" :slight_smile:

Don't worry about the frenchglish, you explained it well! :slight_smile:
I was actually pretty upset when there was absolutely no way to program him open-source, until now thankfully.

F4HFM:
Well, I hope to have been clear enough.
By the way, sorry for my "frenchglish" :slight_smile:

I also thought you did a good job summing up the options of using an Arduino with the Meccanoid.

I suppose releasing the communication protocol is what makes this project "open source". I sure don't see any sort of information about programming the MeccaBrain.

If you actually looked at the documentation on the MeccaBrain and the Smart Modules, there is plenty of information on how the MeccaBrain responds to different kinds of signals. They wouldn't give all that detailed information unless they intended for users to be able to program the MeccaBrain. Otherwise the documentation would be completely pointless.

goodinventor:
If you actually looked at the documentation on the MeccaBrain and the Smart Modules, there is plenty of information on how the MeccaBrain responds to different kinds of signals. They wouldn't give all that detailed information unless they intended for users to be able to program the MeccaBrain. Otherwise the documentation would be completely pointless.

I think you are misinterpreting what you're reading.

I didn't see any indication the MeccaBrain responds to signals at all, other than to record positions.

I see absolutely no evidence to suggest MeccaBrain can be programmed (unless you count recording movements as programming).

Did you watch the "programming" videos? The only programming is recording movements (and sounds).

The documentation isn't completely pointless for the reasons F4HFM pointed out. I thought F4HFM did a good job summing up the ways the Meccanoid hardware can be used with an Arduino.

Go to this link:

Now read sections VI through VIII. This is the information I am talking about.

goodinventor:
Now read sections VI through VIII. This is the information I am talking about.

I don't see anything in those sections suggesting you can program the MeccaBrain.

They provide the protocol so people can use an external microcontroller in the ways suggested by F4HFM. F4HFM's methods #2 and #3 are possible because Meccano has provided the protocol.

With knowledge of the smart servo protocol, you can use a joystick to enter position information rather than entering positions by moving the robot directly. You could also make your own devices to work with the Meccanoid. By using an Arduino to translate the protocol, you could have Meccanoid app to control NeoPixels rather than the LEDs which came with the Meccanoid.

There NO indication from the protocol pdf the end user will be able to program the MeccaBrain. If you want the Meccanoid to respond to sensors (other than voice commands), you'll need to use an Arduino (or other microcontroller) as the brain for he Meccanoid. This isn't really a big deal since microcontrollers are so inexpensive.

You're of course not limited to using an Arduino with the Meccanoid. A Teensy, Raspberry Pi, Propeller, XMOS, TI LaunchPad or other controller could be used as the brain and since the protocol is available any of these controllers could interact with the smart servos, motors and LEDs. You might need level shifters with some of the controllers I mentioned.

Again, I see absolutely no indication the MeccaBrain can be programmed other than by recording motions and sound and playing back these motions and sounds (I think LEDs can be recorded too).

When the author of the document talks about the 'data stream' for sending and receiving data to and from the servos and other modules, he says 'to' or 'from the MeccaBrain'. Because the MeccaBrain is explicitly mentioned as doing these operations, it is logical that the author intends for this information to be used with the MeccaBrain (although other boards can be used as well).

goodinventor:
Because the MeccaBrain is explicitly mentioned as doing these operations, it is logical that the author intends for this information to be used with the MeccaBrain (although other boards can be used as well).

As a Meccanoid owner, DuaneDegn is right. Yes, the "lax" way to program him is by moving his arms around to playback the recording (which is actually pretty neat), and controlling him through the mobIle app where you can drive him around or program him.

I think GoodInventor means is that the servos get data from the MeccaBrain, such as when he's dancing. When the servos send back data is probably when you're asking Meccanoid for a high five. When his shoulder is turned back from the high five, the servos send data back to the MeccaBrain.

When the MeccaBrain realizes that the the shoulder has been turned, it sends data back to the servos which causes the arm to go forward like a high-five, while sending data to the LEDs to flash yellow.

I don't know if the Arduino would be able to send data to the MeccaBrain. To be honest, Arduino is like a another brain for Meccanoid. He'll have one for voice commands and one for my PC projects, such as working with the ultrasonic sensor. It would be nice to connect the Arduino to the MeccaBrain and use it as a loudspeaker. Still I can't think of any way MeccaBrain could work with Arduino. It may work with the other microcomputers metioned.

OK. So in that case as a precaution when I hook up other sensors I will use the Arduino instead of the MeccaBrain to control it.

Although DuaneDegn is right that there is no formal way to program the MeccaBrain, it does seem like you could simulate the Learned Intelligent Movement signals that the servos send to the MeccaBrain. Use an arduino or RPi to capture the signals sent back to the MeccaBrain from the servos and then use them as building blocks.

The smartphone app does something similar with recording a series of movements and then sending it via bluetooth. If they publish the protocol, you could even use an external arduino with a bluetooth shield to control the Meccanoid.

Meanwhile, I'm going to work with a hard-wired arduino as an alternate brain.

Could everyone please post examples as they get this working? (why did Meccano post a library without examples?). Thanks.

I will post further details once I get the project going in a separate thread.

I made an example, see the video.

The code for the example I published on GitHub.

It also contains a number of wrapper functions, so that the library became easier to use. What I didn't try is LIM feature. Thanks to DuaneDegn for pointing out that any pins can drive servo modules (not only pwm pins)

Several observations:

  1. Weird thing. To initialize the modules, you have to communitcate the chains for many times, like 50 times. If you do it for less times, like 10, some of the modules stay undiscovered. I hope Meccano will correct it
  2. You can use any motor shield. I used a cheap hand-made L293D based motor shield and it worked OK.
  3. You do not need any voltage dividers. I simply plugged Meccanoid's battery into VIN and it was OK because charged battery gives you 7 volts.
  4. Meccanoid servos can be driven from 5V as well, they even work from my PC's USB and it doesn't disconnect, it means that the power consumption is less than 500 mA.

Well done! I like your video. I have already ordered the Meccanoid G15 and an ultrasonic sensor so soon I will be experimenting with obstacle detection on the Meccanoid. By the way, the board I will be using is not an Arduino, but an Arduino-compatible board. http://www.86duino.com/?p=70

volkova_ta:
they even work from my PC's USB and it doesn't disconnect, it means that the power consumption is less than 500 mA.

That's not necessarily true. PC USB ports don't always protect themselves if too much current is drawn. You can easily burn out a USB port by powering servos from it (I've killed an USB port this way).

It's a really good idea to use a powered hub is you're powering servos from USB. I've killed a hub doing this but it was better than killing the USB port on the PC.

volkova_ta:
To initialize the modules, you have to communitcate the chains for many times, like 50 times. If you do it for less times, like 10, some of the modules stay undiscovered. I hope Meccano will correct it

I think this is the fault of the Meccano library. They have an awful software serial in their library. It bit bangs the serial protocol using digitalWrite. The library has a lot of room for improvement. I think simply rewriting it to use the normal software serial would likely improve the communication between the Arduino and the smart servos. Ideally, you'd want to use the hardware serial for at least some of the smart servos (probably the ones you need to controller the most often).

Very cool video! Thanks for uploading it.