collapse

Welcome!



Welcome to Robot Rebels, an online robot maker community.

Register today to post your projects, ask questions, share knowledge and meet like-minded people from around the world.


The RobotRebel.org Community

Recent Posts

Pages: [1] 2 3 ... 10
1
I'm on Unity / Blender, let me know if you need any help / is stuck ;)

I am keeping a mind note of this.
2
General Discussion / Re: My name is Frits and I am Making a Game called TIXITAXI
« Last post by fritsl on July 05, 2019, 03:51:46 AM »
Oh, sweet (welcome to the dark side of virtual stuff) ;D

I found that learning physical robots first made it a LOT easier to learn virtual stuff!

OK, not that I have tried to learn it the other way around too for comparison, but I mean that I often drew on what I learned in respect of physics, time, those dimensions, and then programming.

Programming something like a spreadsheet editor or a find-a-hotel-ap you just want things to happen FAST and NOW.

Programming Robots and Games, you want things to happen with respect to inertia, animation, waiting for inputs etc.. :)

I'm on Unity / Blender, let me know if you need any help / is stuck ;)

If popular, maybe we can ask admin to open up a dedicated part of site?!
3
Technically I am still building robots, but I still have built nothing yet.
I'm trying to make a game too, in Unity.
I had followed couple of tutorials I found and have found couple of guyz on Discord to make a 2D platformer.
4
General Discussion / Re: My name is Frits and I am Making a Game called TIXITAXI
« Last post by fritsl on July 04, 2019, 01:57:44 PM »
Hi KA :D
Yer, this is puetty much eating up all my hours ;P
Are you all doing robots still?
5
Welcome,

so that's what you have been up to.
6
Suggestions and Vision / Re: Pictures on the front page!
« Last post by tinhead on June 30, 2019, 02:55:35 PM »
True! I second that!

I would also think of having an https certificate added, https://letsencrypt.org/ provide free ones.
7
Suggestions and Vision / Re: Pictures on the front page!
« Last post by Brassfly on June 30, 2019, 01:07:32 PM »
I would second that notion. I always enjoyed seeing the pictures of everyone's projects when I would login. I think it also helped spark discussion within the shoutbox as well.

I also think think it was a large part of why new people would come to visit the site as well.

Uhh just my thoughts...

And hello everyone. Hope you are all doing well!
8
Suggestions and Vision / Pictures on the front page!
« Last post by fritsl on June 30, 2019, 09:12:25 AM »
That was 100% what drove LMR.. Pictures on the front page! and shoutbox. But you have that.

Not saying it's easy or anything, just filed humbly under "Suggestions and Vision" ;)

PS: Thanks a bunch for keeping the fire alive :D
9
General Discussion / My name is Frits and I am Making a Game called TIXITAXI
« Last post by fritsl on June 28, 2019, 07:28:05 AM »

Hi old (and new?) friends :D

After a couple of years in the basement, I am sticking up my head to see if anyone's interested in what I have ben cooking.

It's robots all right, but they are virtual.

Android for now.

Alpha state, but playable :)

http://www.tixitaxi.com/
10
Tutorials / Re: Coding a Nano i2c Slave
« Last post by AmandaG on June 11, 2019, 02:48:03 PM »
In a distributed system using intelligent leg modules and a central controller, each 4-motor leg module could be addressed as an i2c slave. The Nano is reasonably compact, has 18 usable I/O pins and is very cheap.

For earlier projects I used various PICAXE chips but needed higher mathematical capability.  Transitioning to the Arduino IDE I wrote master i2c bit banging code for a Nano as a learning exercise. It worked well enough to interface to IMU chips etc and to teach me to watch out for semicolons and double equals.

Of course the slave chips use hardware to detect fast edges and it is quite difficult to use software loops for the same effect. I had also missed the chapter on i2c in the Atmel datasheet because it is headed TWI.

It turns out writing code for an i2c slave is a lot easier using the Atmel registers.

Using the Hardware

First load the slave address (hex 50 say):

    TWAR = 0x50;                 //slave address to Atmel

Then turn on the hardware i2c function using the control register:

    TWCR = B01000100;            //set TWEA, enable Atmel i2c
    TWCR = TWCR | B10000000;     //hit the flag to get it going

Now wait for the status register to see what has occurred:

    while (!(TWCR & B10000000)); //wait flag to read status

Let’s assume the master is going to write (send data to us):

    if (TWSR == 0x60) {          //test status for addr + W found
                                 //the address found is in the data register

We hit the flag and wait for the first data byte:

    TWCR = TWCR | B10000000;     //hit the flag
    while (!(TWCR & B10000000)); //wait flag

    if (TWSR != 0x80)            //test status for data received ok
    goto error_handler;

    inbyte = TWDR;               //the first byte is in the data register
    }

Continue as required. Obviously things are a little more complicated but the detail can be added once you get the idea. The Atmel datasheet is a must read and pay special attention to the protocol of Nacking the last byte.

Trimming the Protocol

My quadruped project has specific needs so the i2c protocol can be tailored to suit the need for speed etc.

Each of the four motors needs byte values for:

    Actual position in degrees  (read only)
    Next setpoint in degrees    (read/write)
    Current duty cycle 0 to 255 (read only)
    Maximum duty cycle 0 to 255 (read/write)

Driving the motors at twice normal voltage is good for torque but if a 50% duty cycle is exceeded for too long the motors or drivers will cook. This calculation needs a 64-byte fifo for a one second moving average of the PWM value. The motor power is removed for each period the maximum value is exceeded. It sounds like braking on gravel in a car fitted with an ABS system.

All data transfers will be four bytes long. Makes the thinking simpler.

The four parameters will not use a separate register address byte; the extra two bits can be a subset of the leg address.

Atmel got there first with the TWAMR bit-masking of the TWAR:

    TWAMR = 0x0C;                //mask out lower bits (Reg address)

So there is no switching from writing the register address, sending a restart, then reading the data bytes.  Whether reading or writing, transfers can be completed in less than 150uS.

Synchronising the Processes

Each slave Nano has to calculate four PID equations compensating for non-linear potentiometers, update duty cycle values, scale for each PWM and control the half bridges. This may take 12-13mS of the 15mS cycle time.  Keeping the cycle-time constant simplifies the calculus because the .dt elements can be removed.

Once its housekeeping is done, the slave will be ready to listen to the i2c bus. The master can then send or receive i2c instructions to each slave before the cycle restarts.

Neither process is interrupted but we do need to keep them meshing together.

The Atmel hardware can be configured for a ‘general call’ address 0x00.  The LSB of the TWAR register is set to enable the slave to respond to its own address and the general call address:

    TWAR = i2cadd | 0x01;        //slave address to Atmel, allow general call

Once the address is seen the slaves will start their own processes and will not listen to the i2c bus for a while:

    if (TWSR == 0x70)            //test status for general call
    goto house_keeping

The master is also free for a time to do its own thing.  Then when millis() counts out 13mS it must converse on the i2c bus. At 15mS it must send the general call address, finishing with a stop bit to keep everyone happy.

Thank you very much, helped me through everything.

Regards,
Amanda
Pages: [1] 2 3 ... 10

* Search


* Recent Topics

My name is Frits and I am Making a Game called TIXITAXI by Killer Angel
[July 08, 2019, 04:01:58 AM]


Pictures on the front page! by tinhead
[June 30, 2019, 02:55:35 PM]


Coding a Nano i2c Slave by AmandaG
[June 11, 2019, 02:48:03 PM]


repetierHost 2.1.6 not working? by MEgg
[June 09, 2019, 03:11:34 PM]


Servo Calibrator by Bajdi
[May 24, 2019, 04:01:10 AM]


MKS Gen L 1.0 by Bappi
[May 21, 2019, 07:22:54 PM]


ESP32 "Life is Life" 64x32 flexible P4 RGB LED by jinx
[May 18, 2019, 11:19:44 AM]


Warco HV-4" Rotary Table by jinx
[May 08, 2019, 03:12:58 PM]


Warco WM14 milling machine by jinx
[April 28, 2019, 09:41:40 AM]


MKS GEN L Servo Issue by Reywas
[April 22, 2019, 09:10:08 PM]


Meowth Abandoned by Nemesis
[April 11, 2019, 11:08:00 AM]


Bench Power: Help a rebel out by jinx
[April 03, 2019, 04:20:10 AM]


Just a short intro... by MEgg
[March 18, 2019, 05:49:28 PM]


Yes I am alive! by jinx
[March 10, 2019, 04:38:53 AM]


CZ-1 2.0: problems, calibration and printing, part2 by MEgg
[February 26, 2019, 03:35:15 PM]

* Recent Posts

Re: My name is Frits and I am Making a Game called TIXITAXI by Killer Angel
[July 08, 2019, 04:01:58 AM]


Re: My name is Frits and I am Making a Game called TIXITAXI by fritsl
[July 05, 2019, 03:51:46 AM]


Re: My name is Frits and I am Making a Game called TIXITAXI by Killer Angel
[July 05, 2019, 03:06:49 AM]


Re: My name is Frits and I am Making a Game called TIXITAXI by fritsl
[July 04, 2019, 01:57:44 PM]


Re: My name is Frits and I am Making a Game called TIXITAXI by Killer Angel
[July 04, 2019, 03:33:22 AM]


Re: Pictures on the front page! by tinhead
[June 30, 2019, 02:55:35 PM]


Re: Pictures on the front page! by Brassfly
[June 30, 2019, 01:07:32 PM]


Pictures on the front page! by fritsl
[June 30, 2019, 09:12:25 AM]


My name is Frits and I am Making a Game called TIXITAXI by fritsl
[June 28, 2019, 07:28:05 AM]


Re: Coding a Nano i2c Slave by AmandaG
[June 11, 2019, 02:48:03 PM]


repetierHost 2.1.6 not working? by MEgg
[June 09, 2019, 03:11:34 PM]


Re: Servo Calibrator by Bajdi
[May 24, 2019, 04:01:10 AM]


Re: Servo Calibrator by jinx
[May 22, 2019, 02:28:13 AM]


Re: MKS Gen L 1.0 by Bappi
[May 21, 2019, 07:22:54 PM]


Re: MKS Gen L 1.0 by jinx
[May 21, 2019, 03:27:08 PM]