View unanswered posts | View active topics It is currently Mon Nov 24, 2014 9:51 pm






Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
AMX 13 bridge layer 
Author Message
Novice

Joined: Sat Sep 15, 2012 11:28 am
Posts: 68
Post AMX 13 bridge layer
Hello

please find below pictures and videos of an AMX13 bridge layer ;

It use Firgelli actuators , three NXTBee and three NXT bricks ;

One brick is master with a PSP receiver , and two are slaves on the AMX ;

The bridge can carry 5 KG ;

The two joysticks and 11 buttons of the PSP are used ;

The robotc programms use several drivers from bot bench ;

didier



please clic on the five pictures to see the video ;

-----------------------------------------------------------------------


Image

[img=http://images3.photomania.com/3567533/1/_radE3045.jpg]


---------------------------------------------------------------------------------------

Image

[img=http://images3.photomania.com/3570684/1/_radE3641.jpg]

---------------------------------------------------------------------------------------------

Image

[img=http://images3.photomania.com/3570704/1/_radE0E30.jpg]

------------------------------------------------------------------------------------------------

Image

[img=http://images3.photomania.com/3570748/1/_rad7DF41.jpg]

------------------------------------------------------------------------------------------------
Image

[img=http://images3.photomania.com/3570766/1/_radD68D2.jpg]


*********************************************************************


Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
--------------------------------------------------------------------------------------


Tue Dec 04, 2012 9:45 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3289
Location: Rotterdam, The Netherlands
Post Re: AMX 13 bridge layer
Wow, that thing looks amazing! Nice job! You should make a video of it and post it on YouTube :)

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Tue Dec 04, 2012 3:26 pm
Profile WWW
Novice

Joined: Sat Sep 15, 2012 11:28 am
Posts: 68
Post Re: AMX 13 bridge layer
thanks

it will be done on youtube with my son next week ;

please clic on the first five pictures to see videos

it would be better if the actuator could be stop where we want by the program in order to do a robot ;

and if there were no problems with NXTBee ( sometimes the AMX start randomly ... )

but it is fun

didier


Tue Dec 04, 2012 4:28 pm
Profile
Expert

Joined: Thu Sep 29, 2011 11:09 pm
Posts: 184
Location: Michigan USA
Post Re: AMX 13 bridge layer
That's pretty cool!

Why use a NXTBee (or two? I can't really tell if there is one connected to the left NXT)?

You know, if you want to communicate withing a robot (no need for it to be wireless), you can just connect the NXT's using an NXT cable (between sensor port 4 of each), and communicate using RS485 (at up to about 8 times the max speed that the NXTBees support).

_________________
Matt


Tue Dec 04, 2012 7:10 pm
Profile WWW
Novice

Joined: Sat Sep 15, 2012 11:28 am
Posts: 68
Post Re: AMX 13 bridge layer
You know, if you want to communicate withing a robot (no need for it to be wireless), you can just connect the NXT's using an NXT cable (between sensor port 4 of each), and communicate using RS485 (at up to about 8 times the max speed that the NXTBees support).



fine !

the second NXTBee is behind the AMX , on the other side , you can not see it ;


well ; it is the idea I am looking for years and each time I ask the question to experts they say it is not possible to link with wires
two NXT ;


but using RS485 needs some programs or API or others like that ?

would you tell me or give me the link to an exemple ?

thanks a lot

didier


Wed Dec 05, 2012 2:37 am
Profile
Novice

Joined: Sat Sep 15, 2012 11:28 am
Posts: 68
Post Re: AMX 13 bridge layer
viewtopic.php?f=1&t=3141

I found that with google

but if I look for RS485 in " search for " I get no answer ;

is there other post about RS485 on the site for robotC ?

thanks

didier


Wed Dec 05, 2012 2:57 am
Profile
Novice

Joined: Sat Sep 15, 2012 11:28 am
Posts: 68
Post Re: AMX 13 bridge layer YOUTUBE
Hello

please find the youtube video

ouf!!!!!!!!!!!!!! :programmer:









didiezr


Wed Dec 05, 2012 5:09 am
Profile
Novice

Joined: Sat Sep 15, 2012 11:28 am
Posts: 68
Post Re: AMX 13 bridge layer under fire
Below a video of the AMX13 under fire



to do more fun

it is a test to do a video under fire with lego light ( sensor ligth red blue green )

I wrote a random program but it stops random light after about 20 second ;

then I have to unplug the sensor and to plug it again and start again the program ;

may be I done a big mistake ?

may there is an other way to do that ?

thanks

didier

Code:
#pragma config(Sensor, S2,     colorPort,      sensorCOLORFULL)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

int incr = 0;

int min = 1;
int max = 4;

int time = 0;
int minT = 10;
int maxT = 100;

//*************************************************************


//*****************************
task main()
{


   srand(nSysTime);  // generate seed for rand() from current system time

    while (true)
  {

  incr = (rand() % (max-min)) + min;

       switch (incr)
       {
       case 1:     SensorType[colorPort] = sensorCOLORGREEN;       break;
       case 2:     SensorType[colorPort] = sensorCOLORBLUE;        break;
       //case 3:     SensorType[colorPort] = sensorCOLORFULL;        break;
       case 3:     SensorType[colorPort] = sensorCOLORRED;         break;
       //case 5:     SensorType[colorPort] = sensorCOLORNONE;       break;
         //default:
         }

         time = (rand() % (maxT-minT)) + minT;

         wait1Msec(time);
   }

}


//********************************************************


Wed Dec 05, 2012 6:37 am
Profile
Expert

Joined: Thu Sep 29, 2011 11:09 pm
Posts: 184
Location: Michigan USA
Post Re: AMX 13 bridge layer
The official RS485 support in NXC (I would assume ROBOTC would be similar), does not take care of any sort of SW layer network protocol. Basically you can send and receive raw bytes, but you need to design your own SW protocol. Usually I use a master/slave setup, where the mater initiates any communication, and the slave only "talks" if the master requests something.

As far as the HW, all I do is connect a cable between sensor port 4 of the NXTs.

_________________
Matt


Wed Dec 05, 2012 12:19 pm
Profile WWW
Expert

Joined: Thu Sep 29, 2011 11:09 pm
Posts: 184
Location: Michigan USA
Post Re: AMX 13 bridge layer
Check out this blog page. It covers several of the questions I had several years ago.

_________________
Matt


Wed Dec 05, 2012 12:25 pm
Profile WWW
Novice

Joined: Sat Sep 15, 2012 11:28 am
Posts: 68
Post Re: AMX 13 bridge layer
Bonsoir

Thanks for all about your answer on RS485 ;

I tries to use the programs on this post

viewtopic.php?f=1&t=3141

I have a master and a slave connected from 4 to 4 ; I use the last robotC ;

the debug window gives only

SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1
SMALL 1

it means the link between the two nxt do not works ????

below the code

Code:
Re: NXT to NXT Communication HELP!!!
This is the slave:
      
   
Code:
int counter = 0;
task main () {
  int num;
  int chksum;
  ubyte incoming[16];
  nxtEnableHSPort();
  nxtHS_Mode = hsRawMode;
  nxtSetHSBaudRate(9600);
  wait1Msec(2000);
  writeDebugStreamLine("slave alive");
  while(true) {
    num = nxtGetAvailHSBytes();
    if (num > 0) {
      nxtReadRawHS(incoming[0], num);
      if (num == 16)
      {
        chksum = 0;
        for (int i = 1; i < 15; i++) {
          chksum ^= incoming[i];
        }
        if ((chksum == incoming[0]) && (chksum == incoming[15]))
        {
          counter++;
          writeDebugStreamLine("%d %d", counter, incoming[0]);
        }
        else
          writeDebugStreamLine("BAD CHKSUM");
      }
      else
      {
         writeDebugStreamLine("SMALL %d", num);
      }
    }
  }
}
   
      


This is the master:
      
   
Code:
task main () {
  int num;
  ubyte outgoing[16] = {15, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
  //memset (outgoing, 0x00, 16);
  nxtEnableHSPort();
  nxtHS_Mode = hsRawMode;
  nxtSetHSBaudRate(9600);
  wait1Msec(2000);


  for (int i = 0; i < 100; i++) {
    outgoing[0] = i;
    nxtWriteRawHS(outgoing[0], 16, 0);
    wait1Msec(100);
  }
}
   
      



it would works because it works on 2010 ????

but robotc in not the same ???

thanks for your ideas about that ;

didier


Wed Dec 05, 2012 1:02 pm
Profile
Expert

Joined: Thu Sep 29, 2011 11:09 pm
Posts: 184
Location: Michigan USA
Post Re: AMX 13 bridge layer
ROBOTC 3.x introduced many changes.

After a really quick glance, I suggest you add a delay of 20 or so ms between

if (num > 0) {

and

nxtReadRawHS(incoming[0], num);

in the slave program.

_________________
Matt


Wed Dec 05, 2012 3:25 pm
Profile WWW
Novice

Joined: Sat Sep 15, 2012 11:28 am
Posts: 68
Post Re: AMX 13 bridge layer
thanks

I add 20ms

and get

SMALL 1
SMALL 15
SMALL 1
SMALL 15
SMALL 1
SMALL 15
SMALL 1
SMALL 15
SMALL 1
SMALL 15
SMALL 1
SMALL 15
SMALL 1
SMALL 15
SMALL 1
SMALL 15
SMALL 1
SMALL 15
SMALL 1
SMALL 15
SMALL 1
SMALL 15
SMALL 1
SMALL 15
SMALL 1
SMALL 15
SMALL 1
SMALL 15
SMALL 1
SMALL 15

the last

SMALL 15
SMALL 1
SMALL 15

are flashing

the same with 50 ms

when I compile , there is a yellow cross with :

*Warning*:Comparison between 'signed' and 'unsigned' operands.
if ((chksum == incoming[0]) && (chksum == incoming[15]))


didier


Wed Dec 05, 2012 3:41 pm
Profile
Expert

Joined: Thu Sep 29, 2011 11:09 pm
Posts: 184
Location: Michigan USA
Post Re: AMX 13 bridge layer
Try this on the slave NXT.
Code:
int counter = 0;
task main () {
  int num;
  ubyte chksum;
  ubyte incoming[16];
  nxtEnableHSPort();
  nxtHS_Mode = hsRawMode;
  nxtSetHSBaudRate(9600);
  wait1Msec(2000);
  writeDebugStreamLine("slave alive");
  while(true) {
    num = nxtGetAvailHSBytes();
    if (num > 0) {
      wait1Msec(20);
      num = nxtGetAvailHSBytes();
      nxtReadRawHS(incoming[0], num);
      if (num == 16)
      {
        chksum = 0;
        for (int i = 1; i < 15; i++) {
          chksum ^= incoming[i];
        }
        if ((chksum == incoming[0]) && (chksum == incoming[15]))
        {
          counter++;
          writeDebugStreamLine("%d %d", counter, incoming[0]);
        }
        else
          writeDebugStreamLine("BAD CHKSUM");
      }
      else
      {
         writeDebugStreamLine("SMALL %d", num);
      }
    }
  }
}
I don't think any of the checksum stuff is even implemented in the master, so you should see a consistent "BAD CHKSUM" on the debug stream of the slave.

_________________
Matt


Wed Dec 05, 2012 3:53 pm
Profile WWW
Novice

Joined: Sat Sep 15, 2012 11:28 am
Posts: 68
Post Re: AMX 13 bridge layer
thanks

I do not understand what you say ( my poor english and computer knowledge )

but it gives :

slave alive
SMALL 127
BAD CHKSUM
BAD CHKSUM
BAD CHKSUM
BAD CHKSUM
1 15
BAD CHKSUM
BAD CHKSUM
BAD CHKSUM
BAD CHKSUM
BAD CHKSUM
BAD CHKSUM
BAD CHKSUM


Wed Dec 05, 2012 4:08 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 25 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: Jarrod FTC 8737 and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.