Forum

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

   

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
86Duino Powered Meccanoid G15 Project
2016 年 01 月 13 日
23:49:04
George Andrews III
Moderator
Forum Posts: 56
Member Since:
2015 年 03 月 13 日
Offline

Hello everyone,

I will shortly begin my first humanoid project. I will use the Meccanoid G15 kit and connect the servos to the 86Duino One. For obstacle detection I will use an ultrasonic sensor. More details on the robot will be forthcoming.

Very Respectfully,
George Andrews III

2016 年 01 月 14 日
22:57:09
Android_Lin
Moderator
Forum Posts: 211
Member Since:
2014 年 04 月 01 日
Offline

Cool Cool
I look forward to seeing your robot. Kiss

2016 年 01 月 14 日
23:56:46
George Andrews III
Moderator
Forum Posts: 56
Member Since:
2015 年 03 月 13 日
Offline

Thanks. Maybe you all could give me suggestions on what functions I should have the robot do in my code?

2016 年 01 月 20 日
07:27:32
George Andrews III
Moderator
Forum Posts: 56
Member Since:
2015 年 03 月 13 日
Offline

Hello,

I have finished the Meccanoid G15 build itself today. Next I will add the 86Duino One and the sensors.

Very Respectfully,
George Andrews III

2016 年 01 月 21 日
20:34:44
George Andrews III
Moderator
Forum Posts: 56
Member Since:
2015 年 03 月 13 日
Offline

Good day,

I have successfully built the robot, configuring it with the 86Duino One, and programmed it to raise its arm and light up its eyes red. So far it is working well. I just have one question. How do you submit an image or video in this forum? I have never done so before and wish to share my project with all of you.

Very Respectfully,
George Andrews III

2016 年 03 月 03 日
09:43:30
George Andrews III
Moderator
Forum Posts: 56
Member Since:
2015 年 03 月 13 日
Offline

Hello everyone,

I have started trying to log messages to the SD card as a form of debug output, however, it is not working and my servos no longer move. Unfortunately, I see no way of sharing my code here. Cry It could be a hardware problem that I overlooked. I know that the SD card file never got created. I think that the 86Duino One may have tried to boot from the SD card and ignored the program in the built-in Flash, thus making the program not run. Are there any suggestions about how I can fix this problem? Maybe I have just taken the wrong approach using my own code, libraries, and the Arduino standard libraries and should try a more comprehensive approach such as ROS to avoid trouble. After doing some research on ROS, I found out that it has a system for sending messages (contained in five categories). Maybe this would be a better approach, especially as my robot gets more complex and I start adding machine vision and learning.

2016 年 03 月 06 日
03:00:54
George Andrews III
Moderator
Forum Posts: 56
Member Since:
2015 年 03 月 13 日
Offline

Hello fellow hackers,

I have tested my program again and found out that my power supply does not have enough current. After evaluating all that I needed to hook up, I found out that I need around 2A at least (3A would be very nice). I have decided to use ROS to control my network of sensors and actuators (I'll make an event-driven system using it) along with some libraries that I created for the robot myself (I improved the MeccaBrain library from Meccano and created a class hierarchy for the different parts of the body). My code is starting to come into shape and I will expect to finish for my current hardware setup after a few more months. Any suggestions are appreciated.

Thank you,
George Andrews III

2016 年 03 月 12 日
02:31:13
roboard
Admin
Forum Posts: 135
Member Since:
2013 年 10 月 05 日
Offline

Hi, you can post images using HTML img tag (http://www.w3schools.com/tags/.....ag_img.asp), such as [img src="http://www.roboard.com/temp/vortex86ex_vga.jpg"] shows the following image:

and post a youtube video by directly key-in the video's link, such as "https: //www.youtube.com/watch?v=gTknwah3xy8" shows the following video:

Source code can be pasted using the "code ... /code" BBcode, such as

digitalWrite(HIGH);
digitalWrite(LOW);
2016 年 03 月 15 日
00:15:54
George Andrews III
Moderator
Forum Posts: 56
Member Since:
2015 年 03 月 13 日
Offline

Thank you for the info. I am busy currently learning how to use the ROS API and organize my robot's functions and variables into classes based on body parts. There is one piece of code, however, that is causing me trouble.

//
// Class Objects
//
LeftFoot MainLeftFoot;
RightFoot MainRightFoot;
LeftArm MainLeftArm;
RightArm MainRightArm;
Eye MainEye;
Body MainBody;
Foot MainFoot;

The following compiler output is generated.

Arduino: Coding 211 (Windows 7), Board: "86Duino ONE"

Deep_Think_0_0_0_4.ino:105:1: error: 'LeftFoot' does not name a type
Deep_Think_0_0_0_4.ino:106:1: error: 'RightFoot' does not name a type
Deep_Think_0_0_0_4.ino:107:1: error: 'LeftArm' does not name a type
Deep_Think_0_0_0_4.ino:108:1: error: 'RightArm' does not name a type
Deep_Think_0_0_0_4.ino: In function 'void setup()':
Deep_Think_0_0_0_4.ino:123:7: error: 'MainLeftFoot' was not declared in this scope
Deep_Think_0_0_0_4.ino:125:9: error: 'MainRightFoot' was not declared in this scope
Deep_Think_0_0_0_4.ino:128:11: error: 'MainLeftArm' was not declared in this scope
Deep_Think_0_0_0_4.ino:130:13: error: 'MainRightArm' was not declared in this scope
Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

I don't think this is a problem with the code itself since I declared my class objects correctly, or so I think. It seems as if there was a problem with linking the Body_0_0_0_2.h library with the main program file. However, the library is within the folder of the project, so I don't really know. I will see if I can find more information by setting the compiler output to verbose output.

2016 年 07 月 08 日
01:49:10
KellyVivek
New Member
Forum Posts: 1
Member Since:
2016 年 07 月 08 日
Offline
10

Hi..i am new user here. As per my knowledge It could be a hardware problem that I overlooked. I know that the SD card file never got created. I think that the 86Duino One may have tried to boot from the SD card and ignored the program in the built-in Flash, thus making the program not run. Are there any suggestions about how I can fix this problem? Maybe I have just taken the wrong approach using my own code, libraries, and the Arduino standard libraries and should try a more comprehensive approach such as ROS to avoid trouble.

2016 年 07 月 11 日
09:55:28
Android_Lin
Moderator
Forum Posts: 211
Member Since:
2014 年 04 月 01 日
Offline
11

Hi, KellyVivek,
There are two approaches to do:

1. If want to boot from built-in Flash and save the files in SD card: we need to format the SD card as "none boot sector", that let the BIOS not to boot from the SD card (the SD card will be see as a storage device), then the program in built-in Flash can access/create the file on SD card.
2. If want to boot from SD card and save the files on SD card: we can download SysImage and restore it to SD card. The Arduino development environment have been built in SysImage, so after booting from SD card, we can write a program with SD library to access/create the file on SD card.

2016 年 12 月 20 日
03:52:13
George Andrews III
Moderator
Forum Posts: 56
Member Since:
2015 年 03 月 13 日
Offline
12

While working on the code for the 86Duino One I ran across the below error list.

86Duino: Coding_300 (Windows 10), Board: "86Duino ONE"

In file included from DeepThinkMotorWrapper_0_0_0_1.ino:19:0:

C:\Users\CPY\Documents\86Duino\libraries\meccanoid-library/MeccaBrain.h:48:23: error: flexible array member 'MeccaBrain::servo1Positions' not at end of 'class MeccaBrain'

int servo1Positions[];

^

C:\Users\CPY\Documents\86Duino\libraries\meccanoid-library/MeccaBrain.h:13:7: note: in the definition of 'class MeccaBrain'

class MeccaBrain{

^~~~~~~~~~

exit status 1
Error compiling for board 86Duino ONE.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

The error came from a library that I was using provided by Meccano for the Arduino. (See the below link and click on "Download" under "Arduino Library" to get the library.)

http://www.meccano.com/meccanoid-opensource

I switched boards to Arduino Uno and for some odd reason it compiled fine using that board. What is wrong with the library that it compiles fine for the Arduino but not for the 86Duino? I looked at the errors and saw that they were referring to the initialization of the flexible length arrays (of the form insert_data_type myarray[];) and was wondering if maybe this is not a valid array declaration for the 86Duino in particular. What are your thoughts? Thanks in advance.

George

2016 年 12 月 21 日
11:56:58
cucubutter
Moderator
Forum Posts: 84
Member Since:
2014 年 04 月 10 日
Offline
13

arduino use avr-gcc 4.9.2 and 86Duino Coding 300 use Djgpp 6.1.0, I use Djgpp 4.9.2 to compile MeccaBrain library is work. I think gcc make some change between 4.9.2 and 6.1.0 cause that compile fail.86Duino Coding 213 use Djgpp 4.9.2.

If you want use 86Duino Coding 300(Djgpp 6.1.0) to compile, maybe you can delete servo1Positions, servo2Positions, servo3Positions, servo4Positions, inputBytes, and function inputBytesInfo(), i think other code don't use these variable and function.

cucubutter

2016 年 12 月 22 日
05:34:44
George Andrews III
Moderator
Forum Posts: 56
Member Since:
2015 年 03 月 13 日
Offline
14

So as is it doesn't work on 86Duino Coding 300 (because of Djgpp 6.1.0) but on the 213 version it does?

2016 年 12 月 22 日
09:29:43
cucubutter
Moderator
Forum Posts: 84
Member Since:
2014 年 04 月 10 日
Offline
15

yes, but i don't have the product of Meccanoid, so i only try to compile MeccaBrain library.

2016 年 12 月 22 日
09:40:06
George Andrews III
Moderator
Forum Posts: 56
Member Since:
2015 年 03 月 13 日
Offline
16

OK, thanks for your response. I will test it myself and get back to you on the results.

2016 年 12 月 22 日
22:35:55
George Andrews III
Moderator
Forum Posts: 56
Member Since:
2015 年 03 月 13 日
Offline
17

Below is the modified code.


//
// servo1Positions[], servo2Positions[], servo3Positions[], and
// servo4Positions[] are removed because the 86Duino Coding 300
// compiler for the 86Duino One does not support array
// declarations of the type "int servo1Positions[]" and also
// because those arrays are never used in the code.
//
// inputBytes[] and inputBytesInfo() are also removed because they
// are never used in the code either.
//

#include "Arduino.h"
#include "MeccaBrain_86Duino_0_0_0_1.h"

/****** Initialization of the "MeccaBrain" to a specific I/O pin *****/
MeccaBrain :: MeccaBrain(int pmwPin){
pinMode(pmwPin, OUTPUT);
_pmwPin = pmwPin;

for (int x = 0; x sets the color and transition/fade time of the Meccano Smart LED module
The bytes RED, GREEN and BLUE should have a value from 0 - 7 = a total of 512 options.
There are 8 levels of brightness for each color where 0 is OFF and 7 is full brightness.

The byte FADETIME should have a value from 0 - 7.
These are preset time values to transition between the current color to the new color.
The bytes are as such:
0 - 0 seconds (no fade, change immediately)
1 - 200ms (very very fast fade)
2 - 500ms (very fast fade)
3 - 800ms (fast fade)
4 - 1 second (normal fade)
5 - 2 seconds (slow fade)
6 - 3 seconds (very slow fade)
7 - 4 seconds (very very slow fade)

end */

void MeccaBrain :: setLEDColor(byte red, byte green, byte blue, byte fadetime){
// values from 0-7
LEDoutputByte1 = 0 ; LEDoutputByte2 = 0;
LEDoutputByte1 = 0x3F & ( ( (green<<3) & 0x38) | (red & 0x07) );
LEDoutputByte2 = 0x40 | ( ( (fadetime< sets the color of the Meccano Smart Servo module
The byte SERVONUM refers to the order of the servo in the chain. The first servo plugged into your Arduino is 0.
The next servo is 1. The third servo is 2. The last servo in a chain of 4 servos is 3.

The byte COLOR is a value 0xF0 - 0xF7 which has 8 possible colors (including all off and all on)
0xF7 = R, G,B – all On
0xF6 = G, B - On; R – Off
0xF5 = R, B - On; G – Off
0xF4 = B - On; R, G – Off
0xF3 = R,G – On; B - Off
0xF2 = G - On; R, B – Off
0xF1 = R – On, G, B – Off
0xF0 = R, G,B – all Off

For example, if you want to set the servo at position 0 to Red and the servo at position 2 to Blue-Green, you would send the following two commands
setServoColor(0,0xF1)
setServoColor(2,0xF6)

end */

void MeccaBrain :: setServoColor(int servoNum, byte color){
if(moduleType[servoNum] == 'S'){
outputByte[servoNum] = color;
}
}

/* setServoPosition(int servoNum, byte pos) -> sets a specific servo to a certain position
The byte SERVONUM refers to the order of the servo in the chain. The first servo plugged into your Arduino is 0.
The next servo is 1. The third servo is 2. The last servo in a chain of 4 servos is 3.

The byte POS refers to the servo position 0x00 - 0xEF, which equals to a full 180 degree range.
0x00 = full clockwise
0xEF = full counter clockwise

end */

void MeccaBrain :: setServoPosition(int servoNum, byte pos){
int servoPos = 0;
if(moduleType[servoNum] == 'S'){

if(pos 0xE8){
servoPos = 0xE8;
}else{
servoPos = pos;
}

outputByte[servoNum] = servoPos;
}
}

/* setServotoLIM(int servoNum) -> sets a specific servo to LIM mode
The byte SERVONUM refers to the order of the servo in the chain. The first servo plugged into your Arduino is 0.
The next servo is 1. The third servo is 2. The last servo in a chain of 4 servos is 3.

LIM stands for Learned Intelligent Movement. It is a special mode where the servo IC stops driving the motor and just sends back the position of the servo.

end */

void MeccaBrain :: setServotoLIM(int servoNum){
if(moduleType[servoNum] == 'S'){
outputByte[servoNum] = 0xFA;
}

}

/* getServoPosition(int servoNum) -> returns a byte that is the position of a specific servo
The byte SERVONUM refers to the order of the servo in the chain. The first servo plugged into your Arduino is 0.
The next servo is 1. The third servo is 2. The last servo in a chain of 4 servos is 3.

First you must set the specific servo to LIM mode. Then use this command.
The returned byte POS is the servo's position 0x00 - 0xEF, which equals to a full 180 degree range.
0x00 = full clockwise
0xEF = full counter clockwise

end */

byte MeccaBrain :: getServoPosition(int servoNum){
int temp = 0;
if(moduleType[servoNum] == 'S'){
if (moduleNum > 0){
temp = moduleNum - 1;
}
else{
temp = 0;
}

if(temp == servoNum){
return inputByte;
}
}
return 0x00;
}

/* communicate() - this is the main method that takes care of initializing, sending data to and receiving data from Meccano Smart modules

The datastream consists of 6 output bytes sent to the Smart modules and one return input byte from the Smart modules.
Since there can be a maximum of 4 Smart modules in a chain, each module takes turns replying along the single data wire.

Output bytes:
0xFF - the first byte is always a header byte of 0xFF
Data 1 - the second byte is the data for the Smart module at the 1st position in the chain
Data 2 - the third byte is the data for the Smart module at the 2nd position in the chain
Data 3 - the fourth byte is the data for the Smart module at the 3rd position in the chain
Data 4 - the fifth byte is the data for the Smart module at the 4th position in the chain
Checksum - the sixth byte is part checksum, part module ID. The module ID tells which of the modules in the chain should reply
end */
void MeccaBrain :: communicate(){

sendByte(0xFF); // send header

for (int x = 0; x < 4; x++){ // send 4 data bytes
sendByte(outputByte[x]);
printOutputByte[x] = outputByte[x];
}

checkSum = calculateCheckSum(outputByte[0],
outputByte[1],
outputByte[2],
outputByte[3]);

sendByte(checkSum); // send checksum
inputByte = receiveByte();

if (inputByte == 0xFE){ // if received back 0xFE, then the module exists so get ID number
outputByte[moduleNum] = 0xFC;
}

if (inputByte == 0x01 && moduleType[moduleNum] == '_'){ // if received back 0x01 (module ID is a servo), then change servo color to Blue
outputByte[moduleNum] = 0xF4;
moduleType[moduleNum] = 'S';
}

if (moduleType[moduleNum] == 'L'){

if(ledOrder == 0){
outputByte[moduleNum] = LEDoutputByte1;
ledOrder = 1;
}else{
outputByte[moduleNum] = LEDoutputByte2;
ledOrder = 0;
}

}

if (inputByte == 0x02 && moduleType[moduleNum] == '_'){ // if received back 0x01 (module ID is a LED), then change servo color to Blue
LEDoutputByte1 = 0x00;
LEDoutputByte2 = 0x47;
outputByte[moduleNum] = LEDoutputByte1;
ledOrder = 1;
moduleType[moduleNum] = 'L';
}

if(inputByte == 0x00){
for(int x = moduleNum; x 3) {
moduleNum = 0;
}

delay(10);

}

void MeccaBrain :: sendByte(byte servoData){
pinMode(_pmwPin, OUTPUT);
digitalWrite(_pmwPin,LOW);
delayMicroseconds(bitDelay); // start bit - 417us LOW

for (byte mask = 00000001; mask>0; mask <0; mask < 400){
tempByte = tempByte | mask;
}
}
return tempByte;
}

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 < Preferences.

I am not sure what the issue here is. The original code does work fine on Coding 213 though.

2016 年 12 月 23 日
09:57:31
cucubutter
Moderator
Forum Posts: 84
Member Since:
2014 年 04 月 10 日
Offline
18

for (int x = 0; x sets the color and transition/fade time of the Meccano Smart LED module
The bytes RED, GREEN and BLUE should have a value from 0 - 7 = a total of 512 options.
There are 8 levels of brightness for each color where 0 is OFF and 7 is full brightness.

The code look strange, is it different from your code after copy paste?

2016 年 12 月 23 日
19:30:56
George Andrews III
Moderator
Forum Posts: 56
Member Since:
2015 年 03 月 13 日
Offline
19

That's a weird copy/paste error when I put it in my post. This is the code you were referring to.

for (int x = 0; x < 4; x++){
outputByte[x] = 0xFE; // initialize output data
moduleType[x] = '_';
}

I think I got a garbled paste in the actual post because the amount of code was too much. Is there an alternative way of sending the code (such as attaching files like in the Arduino forum)?

2016 年 12 月 27 日
09:51:10
cucubutter
Moderator
Forum Posts: 84
Member Since:
2014 年 04 月 10 日
Offline
20

Have other error because copy/paste. Can you correct the code? And paste header file.

Forum Timezone: Asia/Taipei

Most Users Ever Online: 66

Currently Online:
2 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Dinosaur: 27

leutenecker: 13

mrZagg: 10

lukeross: 8

tomka: 8

smeezekitty: 8

hippy: 8

Ekkehard: 8

UIdahoCIT: 8

blaxxun: 7

Member Stats:

Guest Posters: 0

Members: 1541

Moderators: 14

Admins: 5

Forum Stats:

Groups: 2

Forums: 10

Topics: 239

Posts: 1082

Newest Members: nhollywoodmarli, bat869cube672, lenggeleranto, iknowesp, dimka, elihu, Woodrowcercraby, Robertnalty, Homerwoppy, RonaldLew

Moderators: Glaux: 70, uaa: 11, guigra: 17, asian55: 22, Android_Lin: 211, bcarroll: 12, cucubutter: 84, recycled-air: 12, stevemork: 16, zerozaber: 52, pongraczi: 20, George Andrews III: 56, poto: 11, garpastym: 20

Administrators: eveshih: 1, anthony: 31, viky6: 0, roboard: 135, hcl: 0