TX-2/RX-2: Heart of the cheap RC Toys from China

January 9th, 2011 § 12 comments § permalink

As I was trying to hook up the motor to Arduino, I realized that there wasn’t any H Bridge and it was way too cold to go out and get it. Hmm… I figure there must be some H Bridge on the control board I just rip out of the car. IMG_0216.jpg As I located the two H bridge on the board, I notice the RX-2 chip. Out of curiosity, I decide to google for this chip. To a pleasant surprise, I found RX-2/TX-2 Datasheet in Chinese and guide for exactly the board in the car and remote. IMG_0215.jpg untitled.jpg Decide to replace RX-2 in the car with Arduino so the H-Bridge on board can be reused and the RF for the remote can still work. Still trying to figure out what I am going to do with those remote control signal. A few facts about RX-2/TX-2 chip I found is that the RC frequency can be adjusted by different resistance from 100K to 500K Ohm between OSCI/OSCO pins. untitled.jpg]]>

ART Telemetry wireless solution

January 9th, 2011 § 2 comments § permalink

Been researching wireless solutions to transmit in real-time sensor and decision information from ART in addition to possibly enabling minimal controls (on/off/behavior switch) and perhaps even wireless firmware updates.

My criteria:
  • Low-cost (<200RMB, preferably <100RMB)
  • Simplex or half-duplex OK
  • Low-bandwidth (>1,200 bit/s)
  • Low-power (<100 mAh)
  • Medium-range (500m-1000m)
  • TTL or SPI interface
One of the main issue is that I cannot find a clear reference to the spectrum allocation in China (The US has a very convenient Frequency Allocations Chart: http://en.wikipedia.org/wiki/Frequency_allocation).
I know that 2.4Ghz is good worldwide (such as what the Nordic nRF240L uses) but that has a very limited range (50m-100m). So is Bluetooth and to a certain degree Wifi (and they are pretty expensive too).
There are these:
Last one actually looks better than the Nordic on paper, but from what I gathered the price is pretty high.  I wonder about the price and why I can’t find it on Taobao…
]]>

新车间开放日:休闲机器人的时代 Robot Contest Kick Off- Xin Che Jian Open House: the coming of entertainment robots

January 7th, 2011 § 0 comments § permalink

新车间开放日:休闲机器人的时代 时间: 2011年元月十六日,下午一点到五点 地点:徐汇区永嘉路50号新单位(近陕西南路) 费用: 免费 随着数字零件价格的降低加上丰富的开源机器人软件,DIY机器人已经可以当做事一个假日的休闲活动。这次的新车间开放日我们将介绍几个会员DIY的机器人和介绍一个将要举办的积极人竞赛。如果你对机器人有兴趣,请在这个周日加入我们,一起了解现代机器人的发展,一起讨论如何玩机器人。如果有小孩的话,非常欢迎他们一起来参加这个的活动。 – 关于HC Robot http://code.google.com/p/hcrobot/ – 关于A.R.T. http://xinchejian.com/?p=289 在这里注册 Robot Contest Kick Off- Xin Che Jian Open House: the coming of entertainment robots Time: 13:00 – 17:00, Jan 16, 2011 Location: Xindanwei, 50 Yongjia Rd Cost: Free, Open house Building robots is fun and building robots to race is doubling the fun! The era of robot building as hobby has come and we plan to celebrate the beginning of this era with a festive robot contest. At this Xin Che Jian open house, we will present a few home built robots and the plan for a contest for discussion. Come and see how you can get involved! If you are a parent, bring the kids! We are sure they will love the robots! Robots on site: – HC Robot: open source home help robots http://code.google.com/p/hcrobot/ – A.R.T. http://xinchejian.com/?p=289 Register for the event here]]>

A.R.T. Glamour

January 6th, 2011 § 1 comment § permalink

A.R.T.
A.R.T.
A.R.T. ]]>

ART Platform v3, Control v4 and the future platform v4

January 3rd, 2011 § 3 comments § permalink

many iterations of both the software (the controller) after updating the platform (sensors+chassis) itself to have an additional ultrasonic sensor looking backward. So now, when I rotate the ultrasonic sensor, I read values in front (right side, angle looking right, looking forward and at angle to the left) and towards the back (left-side, side angle looking backward towards the left, angle straight on towards the back and angle looking backward towards the right). So six values in total… Having the servo rotate the sensors is necessary right now so as not to go over budget on the digital pins of the Arduino Dueminalove board as each of the two sensors require two signal cable (one for trigger and one for echo). I’ve done many changes and many tests but I’m not yet satisfied with the controller for that particular configuration and I still have ideas that I need to implement to make the robot behavior interesting… However, in the meantime, I’m also preparing for the next platform. I’m thinking of designing a circuit to select one ultrasonic sensor at a time out of four. Since two sensors cannot be triggered simultaneously (they would interfere with each other) I would want to trigger one at a time and then wait for the echo. To help with that task, I’ve discovered two wonderful OpenSource software:

  • Fritzing: a very good design software that lets you design breadboard, schematic and final PCB layout with a library of parts (or very easy to create custom parts) in an optimized workflow
  • Logic Gate Simulator: create and test logic gates design
For Fritzing, I also took the time to create a custom part for the HC-SR04 Ultrasonic Sensor. I’ve done so by first drawing vector graphics for the breadboard view, schematic view and PCB board in Inkscape. I then created a new part, imported the just created images and then placing connections “squares” overlaid on the imported images. Relatively easy, but I spent a lots of time getting the fonts right before discovering that the easiest way was to convert all text to paths (Path > Object to Path). I’ve uploaded the HC-SR04 Fritzing part in the relevant “user-contributed parts” bug if you need it. For Logic Gate Simulator, I first wrote down the truth table for the sensor selector (“when pin1 and pin2 are at 1, send trigger signal to sensor4 and receive echo from sensor4”) and tested it, but I’m unsure on how to proceed next in terms of buying the necessary IC that would provide me with the AND/NOT logic gate that I need. I also have to investigate how to change the simplistic Ultrasonic code that’s been provided with the sensors to instead generate interrupts so I don’t have to block the Arduino loop while waiting for the echo to come back. Same for getting the “stop now” button to actually work! [gallery] ]]>

ARTv2 goes Ultrasonic!

December 30th, 2010 § 1 comment § permalink

Me: …since we don’t have many working sensors, I’m waiting for the ultrasonic sensors we ordered… BTW, Xu, any news about them? Xu: Oh, they’re at my desk! Me: screams like a little girl Xu: … ok, I’ll go get them now… So yeah, I finally got my 10 (!) ultrasonic sensors (HC-SR04) this evening, just in time as I had worked out how to control the servo to do sensor sweeps (left and right on 180 degrees).  BTW, if you’re a Xinchejian member, please feel free to borrow one or two to try them out. They’re affordable (37RMB on Taobao or 5.60$USD), ridiculously easy to install and seem to work as advertised, although I haven’t benchmarked much. I’ve also spent quite a bit of time this evening on a reasonably workable controller with a state machine but only had time to test it once before I had to call it a day. I can probably use more sensors (on the sweeper, sideways, looking backward), but I’m thinking that I really need to combine them with infrared sensors as there’s a longer delay than infrared in detecting obstacles and they can work at angles simultaneously. Anyway, more testing and experiments are in order. [gallery]]]>

RoboMaster: a new robot contest for kids in Shanghai

December 30th, 2010 § 0 comments § permalink

Photos from the new robot contest for kids in Shanghai called RoboMaster. Looks a lot of fun! DSC00165.JPG IMG_4183.JPG IMG_4194.JPG]]>

A.R.T. Version 2 (with instructions!)

December 30th, 2010 § 0 comments § permalink

Today I built a second new A.R.T. to test new configurations.

It’s also because it is a bit frustrating not to have a working version at all times for demos while I’m trying out new mechanical layouts… I took the opportunity to write down a detailed list of parts, tools and steps that I’ve checked in to github (note that I have not finished as I still have to solve the ranging sensor and write a new program):

https://github.com/rngadam/ART/blob/master/ART_Control3/BUILD.txt

See gallery for pictures…

[gallery link="file"] ]]>

First successful autonomous run of A.R.T.

December 27th, 2010 § 1 comment § permalink

  • First time I made holes in a piece of wood with a Dremel
  • First time I bought tie-wraps in China
  • First time I blew up the fuse for Xindanwei putting everyone in the dark when I tried to solder
  • First time I’ve connected the Vin for an Arduino Dueminalove (instead of the external power header or USB)
  • First time I’ve read values from an infrared sensor (E18-D80NK with a Chinese only datasheet)
  • First time I got an autonomous robot to be, well, autonomous – by myself! (video)
  • [gallery link="file"] It’s neither very nice looking or very impressive when it runs, but I’m still very happy with the results.  I planned something electro-mechanical with a tiny bit of embedded software all by myself (with some help from Niko with the Dremel and Héqíchén / 何琪辰 to buy the tie-wraps!). I planned, executed and… got the results I wanted! The simplistic code that I used:
    const int FORWARD =  2;
    const int REVERSE =  3;
    const int LEFT = 4;
    const int RIGHT =  5;
    const int INFRARED_FORWARD = A0;
    const int INFRARED_REVERSE = A1;
    const int MINIMUM_INFRARED_READING = 500;
    int current_reverse = LEFT;
    int alt_forward = RIGHT;
    char current_state;
    void setup() {
      pinMode(FORWARD, OUTPUT);
      pinMode(REVERSE, OUTPUT);
      pinMode(LEFT, OUTPUT);
      pinMode(RIGHT, OUTPUT);
      pinMode(INFRARED_FORWARD, INPUT);
      pinMode(INFRARED_REVERSE, INPUT);
      Serial.begin(9600);
    }
    char update_state(char state, int reason) {
      char previous_state = current_state;
      if(state != current_state) {
        current_state = state;
        Serial.print(current_state);
        Serial.println(reason);
      }
      return previous_state;
    }
    void loop(){
        // always check if we can go forward
        int value = analogRead(INFRARED_FORWARD);
        if(value >= MINIMUM_INFRARED_READING) {
            // maybe we were correcting, so check that
            char last_state = update_state('F', value);
            digitalWrite(current_reverse, LOW);
            digitalWrite(REVERSE, LOW);
            if(last_state == 'R') {
              // we just successfully exited a bad loop, turn for a bit for half a second
              digitalWrite(alt_forward, HIGH);
              digitalWrite(FORWARD, HIGH);
              delay(1000);
              digitalWrite(alt_forward, LOW);
            }
            digitalWrite(FORWARD, HIGH);
        } else {
          // otherwise, still correcting, keep off
          digitalWrite(FORWARD, LOW);
          // we want to try to find an alt path
          int value = analogRead(INFRARED_REVERSE);
          if(value >= MINIMUM_INFRARED_READING) {
            //still have some ability to go backward
            update_state('R', value);
            digitalWrite(current_reverse, HIGH);
            digitalWrite(REVERSE, HIGH);
          } else {
            // whooaah, even backward is not possible, we're stuck
            digitalWrite(current_reverse, LOW);
            digitalWrite(REVERSE, LOW);
            update_state('S', value);
          }
        }
    }
    Wins:
    • Wooden board and tie-wraps work exceptionally well to prototype the physical arrangement
    • Using the breadboard to prototype the electronics also works well
    • The Arduino “Vin” to provide current in the board header works very well (and can seamlessy switch between USB and that without resetting!)
    • Sticking the RF transmitter board directly on the robot and controlling the motors with that from the Arduino works well
    • The LED that comes on when an obstacle is detected by the infrared sensors is very useful for debugging (need to keep that in mind when using other  sensors)
    • It works!
    Losses:
    • Uses Alkaline AA batteries (I want to switch to the exact same Rechargeable NiCad as the car uses)
    • I spent too much time working with Sketchup instead of manually testing the mechanical design first (and then Sketchup)
    • There’s not much around Xindanwei in terms of computer, electronic or small mechanical stores, so I should plan ahead to shop on Beijing road
    • The infrared sensors that I found in the pile of stuff in Xinchejian work, but more like “on/off” sensors (don’t seem to have any linearity in the distance)
    • No bumper (the infrared sensor was crashing into the walls…)
    • Making an obstacle course big enough is annoying
    • I had forgotten to make the holes to attach the sensors (more holes == better)
    • No on/off switch so have to manually remove the connections to turn off power
    • You can never have enough tie-wraps… We only had four at Xinchejian before I bought a pack of 500 for 15RMB (but really, worth about 5RMB)
    • I need to learn how to solder… without blowing fuses…
    ]]>

    RC Transmitter reverse-engineering attempt

    December 26th, 2010 § 1 comment § permalink

    TX2C ATS302T which is available on Taobao) , so I thought I would try to figure out the circuit by looking at it.  Kind of inconvenient because the components are on one side while the circuit trace is in the other. Flipping over the board constantly is annoying and it’s rather hard to follow.  Best would be to see both sides at the same time, no? So this is what I did:

    1. took a picture of both sides in macro mode
    2. cropped both pictures
    3. created layers using GIMP (a cross-platform OpenSource software similar to Photoshop)
    4. Put each image on their layers
    5. Change opacity of top layer
    6. “Image > Transform > Flip Horizontally” one of the image
    7. Move one of the image until screw holes on both align
    [gallery link="file"] Much easier then to figure out what is connected to what, but still difficult… Anyway, I decided to try instead to buy a TX2C and follow its datasheet to re-create the circuit.  In the meantime, I’ve removed the board entirely from the remote control body and I’ll connect to that directly with the Arduino.]]>

    Where Am I?

    You are currently browsing the robot category at 新车间 [XinCheJian].