Roboscraptor

Update 10/23/17 - 8:05 AM

Hey everyone! It’s good to be back.

So I’m looking over my disassembled Roboraptor, and am going to give “her” another go when the weather gets better (most likely next year...).

I’ve done quite a number on the leg motors, having crimped/hot-glued them. I think I’ll just use the original motors again (and properly re-solder them).

Also, I plan to eventually replace the plastic leg pieces I unintentionally destroyed. If that ultimately means Roboraptor will have mismatched legs, that’s okay- I can always repaint them.

In other news (yes, there’s more,) I have changed my mind about neural networks and am now currently experimenting with spiking neural networks (SNNs)- quite unlike traditional ANNs, they are more biologically accurate. And since researchers are programming SNNs on microcontrollers(!), I have decided I might be able to use one of my new-or-newly-repaired Arduino Unos instead of a MicroPython board. Exciting stuff!

I’ll keep you all posted on future updates.

Edit 1 - 3:42 PM

I've also decided to research possible Utahraptor behaviors to make Roboraptor act more like a real raptor might have. However, I'm still keeping one aspect of Jurassic Park/World velociraptors (and possibly real Utahraptors): Roboraptor might one day have a "pack"! I have one potential "pack member," and I also have another in mind...

But that will be for a future time.

Edit 2- 11:32 PM

Hmm, I didn’t find a lot on theorized Utahraptor behavior... maybe a “more realistic” robot Utahraptor is beyond reach right now.

Oh well. Yay, creative license!

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

Update 3/29/17 - 9:15 AM

Hi everyone! I'm finally able to upload the video that sw0rdm4n requested. I must apologize in advance for the watermark covering the video. I don't think Windows 8.1 has a free Movie Maker version, so I had to download a different movie editor online.

I had also completely forgotten about another editor I could've tried. D'oh!

Oh, well. Hope you guys enjoy the video!

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

Update: 3/28/17 - 10:23 AM

So I have recently looked into behavior-based robotics- a field everyone else in the AI field seems to have moved away from. After reading a Quora answer by Steve Grand (an A.I. researcher, and the same guy who brought us the Creatures artificial life games,) I realize now that ANNs pretty much only recognize patterns, and therefore don't meet all of the requirements for being a generic unit of intelligence.

So right now, for the upteenth time, I have again changed my plans for my AI architecture (yes, I am seriously that indecisive!). Behavior-based robotics is now the way I'm going, with a sprinkle of the Global Workspace theory and a memory, of course! :-) Edited 3/28/17 3:08 PM

Edit 2: 3/28/2017 10:47 PM

Sorry everyone, I'll have to work on the video tomorrow, since it's getting late here. I'll make sure it gets posted sometime tomorrow.

Good night, everyone! Thank you for your continued interest.

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

The title, I am aware, is quite misleading... the robot hardly uses any scrap parts outside of the RoboRaptor itself (save for some motors from a fairly-recently bought kit). "She" (I think my robots are more personable, but not too much so, with an assigned "gender"... and yes, I know it doesn't really have a gender) doesn't have a name yet, but when I find one, I will change this page's title accordingly.

Now onto the *real* interesting stuff- the building of the actual robot. I don't remember too much about what I've done to "her" in the past, but I will recount what I've done to the fullest extent possible.

First, I took RoboRaptor's chassis apart, starting with her legs. I then removed the two halves of RoboRaptor's body... and left her like that for months, thinking about how to hack her from that point on (1st attached pic). I have just recently come back to work on RoboRaptor more, thinking I could somehow get her to walk better (whether aesthetically or efficiently). At the time I tried removing the brackets from the plastic pieces inside Roboraptor's legs, and have replaced them with springs that I got from detaching the pieces that held the legs on (2nd attached pic).

I then (foolishly) sanded down some of the screw holes on the pieces that held the legs on, trying to see if I could attach the legs in a different way (3rd attached pic)... Long story short, it didn't work the way I wanted it to (4th attached pic. Painful, ain't it? ;-) ). In the meantime, I detached RoboRaptor's circuit board, initially wanting to replace it with an Arduino Uno (but since I need a little more computing power, I am now going to use a MicroPython board. Hope it works!).

I then tried to make several cams, none of which worked out that well. I plan now on trying to put her legs back on those plastic pieces, which were meant to hold the legs on in the first place. Hopefully, it won't be too painful...

While that was going on, I actually managed to replace two of RoboRaptor's on-board motors with medium-speed, medium-torque motors from the RadioShack Robotics Gear Motor Kit (5th attached pic)! I have recently received my MicroPython board, and plan on testing it with RoboRaptor's body before putting an AI "mind" into it (and no, I'm not expecting it to be human-level). More info (hopefully) coming soon- Stay tuned!

Act like a real (with a pinch of Jurassic Park/World) raptor

  • CPU: arduino uno
  • Programming language: Arduino ide
  • Sensors / input devices: IR, buttons
  • Target environment: indoor

This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/roboscraptor

Adding AI

How complex do you want your behaviors to be? Python is great but you’d be surprised the amount of behaviors you can get from an Arduino. I’ve been able to put a subsumption machine on one of my robots using a stock Arduino.

-Rich

 

Hi!
I have actually tried working with Arduino before this project, but… prepare for my epic fails… I have bricked both of my Arduino Unos trying to get the serial monitor to display the neural networks’ output! So embarrassing. But if you have a solution to make the serial monitor work, I’d love to hear it. I’ll look up a way to restore the Arduinos without using a third.

As for the AI, it will hopefully be a little complex, given that it runs on (greatly simplified, but still powerful) feedforward neural networks. It’s based off of one of the Global Workspace papers, so I would imagine it would need a lot of computing power. Though seeing as I had previously used tens of simplified MLPs and Gated Recurrent Units in my Arduino Uno AIs, maybe not.

Thank you for any help you can give me! :slight_smile:

What are the behaviors you’re looking for?

I have actually tried working with Arduino before this project, but… prepare for my epic fails… I have bricked both of my Arduino Unos trying to get the serial monitor to display the neural networks’ output! So embarrassing. But if you have a solution to make the serial monitor work, I’d love to hear it.

>> You bricked two Arduinos with Neural Network code!?!?  Is it accessing the flash memory somehow?

>> What’s the code look like? Is it yours from scratch, or did you get it as an example from some place?

 I’ll look up a way to restore the Arduinos without using a third.

>> Arduinos bootloaders are not hard to reprogram but in general you need an ICE or something. 

>> Sparkfun,  Adafruit, Atmel and the Adruino site are all good resources for that.

As for the AI, it will hopefully be a little complex, given that it runs on (greatly simplified, but still powerful) feedforward neural networks. It’s based off of one of the Global Workspace papers, so I would imagine it would need a lot of computing power.

>> Global Workspace?!?! Last I heard of that, was that it was still pretty theoretical.  What papers are you looking at? Has someone done some sort of implementation?

Though seeing as I had previously used tens of simplified MLPs and Gated Recurrent Units in my Arduino Uno AIs, maybe not. Thank you for any help you can give me! :slight_smile:

>>What kind of behaviors are you looking have your raptor exhibit? I see it has two motors to make it walk, but what sensors does it have for input to your AI?

 

>>If you’re looking for behavior based robotics, you may want to check out Arkin, Behavior-Based Robotics or some of Rodney Brook’s early papers at MIT on subsumption.

-Rich

Hmm…
>> You bricked two Arduinos with Neural Network code!?!? Is it accessing the flash memory somehow?

Perhaps it was… I was trying to save space, so maybe that was what backfired. I’ll try and look into the proper use of Arduino flash memory.

What’s the code look like? Is it yours from scratch, or did you get it as an example from some place?
Global Workspace?!?! Last I heard of that, was that it was still pretty theoretical. What papers are you looking at? Has someone done some sort of implementation?

I used Murray Shanahan’s paper below as an example to base my code off of.

Arduinos bootloaders are not hard to reprogram but in general you need an ICE or something.

Sparkfun, Adafruit, Atmel and the Adruino site are all good resources for that.

Thank you. I will take a close look at those sites.

What kind of behaviors are you looking have your raptor exhibit? I see it has two motors to make it walk, but what sensors does it have for input to your AI?

I now realize I didn’t answer this the first time around. Sorry about that. I… honestly haven’t thought about it, but I think I know where to start. I think, in behavior-based style, I will start with basic movements (which I will be playing around with) in response to stimuli, much like the original toy, except it will be slightly more complex (and involve “hunting”). I plan on slowly working my way up to a reptile-esque intelligence, with some established elements of modern AI (i.e. long-term memory, the Global Workspace, etc.). Human level would not be a good place to start in my opinion- most AI researchers, I now realize, are trying to run before they can walk!

As for sensors, it has a lot of them already built in, such as leg pieces that register when the leg motors have turned to the greatest allowable extent, IR sensors, and touch sensors. It can’t “see” properly right now, but maybe as a future upgrade.

And last but definitely not least, I will certainly be looking up Brook’s work.

Thank you so much for your help and suggestions! :slight_smile:

I think, I started to fall

I think, I started to fall in love with you NeoGirl, Can you post some videos so I can see the mechanism ?

btw isn’t this your twitter ? https://twitter.com/neogirl101

Hey sw0rdm4n!
I’m not sure what you mean by mechanism… but I’ll gladly post the leg motors running for you!

As for the twitter account, nope! I personally don’t have a twitter account… it’s just someone who ironically has my username. :slight_smile:

I know what you meant now!

The walking mechanism that came with the toy involves switches that must give feedback on how far the motors have turned. And sadly, the switches are a crucial part of how the legs work, since if the switches are disconnected/not giving feedback, the motor will be strained and ultimately burn out (which, as you’ll see in the video, certainly smells like they’re burning out already!).

I’m working on the video I promised right now! :slight_smile:

AI architecture (Well this turned more into thinking aloud :wink:

I think it’s no wonder you are indecisive, I can relate. I am studying it for years trying to get an overview, adding my own ideas, and trying to fit it into an overall framework. There are always new theories and it’s mostly academic papers that introduce approaches, and this quickly makes you go down the rabbit hole of learning specialized terminology and concepts, before you can even get what the idea is really about and if it’s worth pursuing.

Examples and intuitive insights or easy to use software are not academia’s strength.

I still haven’t found an overarching framework that tries to model all the basic concepts and show how it could work from end to end. Usually it stays too abstract or focuses on one perspective. Then you go from this and extrapolate, to try and explain everything with a theory that was birthed from a very specific domain (like statistics, finance, logic, behavior, etc.).

So what was once grounded in real world problems and made sense, becomes a tool that is applied abstractly to new problems, without understanding how it really works or why. The quality of the representation then becomes doubtful. The properties of the mapping between technical representation and real world problem stays mysterious, due to complexity or lack of structure, and distance between real world representations/goals and technical ones.

It’s a bit like trying to do all with assembler. When compilers lower high level language to assembler, information is lost that cannot be recovered (provably impossible). To recover it you must know what machine instructions are usually used together to form a higher level instruction/concept, but there is no guarantuee that a sequence you see really means what you think, it is just more or less likely. Context can help to disambiguate. But in general you cannot say what a program does (halting problem).

So this information needs to be added manually when you create higher level structures/concepts. Those are decisions that have been made at some point in time (evolution, culture, personal preference, etc.), which are somewhat arbitrary and could have turned out differently.

That’s why throwing an uninformed algorithm at it (machine learning), that will try to magically learn this missing information, is unlikely to work well. The time and amount of data needed is just huge, and for many problems, the available data is little, especially for the untypical cases. Still, ignoring them would not make sense.

Imagine building a long fence which has only one door to enter. The rule would be to put wire mesh almost everywhere, but the little spot where the door will go. Statistically the door seems like an outlier or error. If you are unlucky while “sampling” over the whole fence, you will not even “measure”/notice the door. If you know why you build the fence (place where somebody lives and therefore wants to enter), you know you have to look for an opening, and you will know this is not an error.

What we do currently is use “assembler” and just make statistical sequences of instructions without really knowing what kind of squences/structures/control flow would be good to use. It’s informed trail and error, with no theory for the structure which we want to get, so it’s a bit aimless or only clear for specific problems.

Neural nets being a black box are a good example of this. Nobody really knows the properties and structure of things in the middle level, only very low and very high level. Things like Google’s Deep Dream try to get some insight on learned structures of the neural net, by letting them “draw” their internal representations. Maybe that can be driven further, but it wont be enough on it’s own when you consider the example above.

Personally I think that we need to make this more structured. When you make programs, if you don’t have a design that goes through all levels of abstraction, low, middle, high level, usually you run into problems. You always have to figure out details as you go, but the big design can’t be a black box, like a neural network.

Some work in this direction can be found in opencog, it’s not easy to digest, though.

AI just isn’t a mature technology, so it’s hard to decide what’s a good design. Current approaches excel at technical capabilities, but the vision on how to achieve something and know why it works, or how it could be constructed with confidence, is not there yet.

I would think the best approach is to just try out simple examples that interest you, not overengineer/design, and just see how far it goes. Then realize what you are missing from a qualitative point of view, search what could do that, and do the next iteration. I think this is faster, than trying to imagine and theorize all possible outcomes. Nothing is better than reality to cut down on the huge “search space” of possible designs or solutions.

It might be obvious, but,

It might be obvious, but, have you checked the baud rate settings match? Both in your sketch and the serial monitor?

Just wondering how you could brick an Arduino, if it isn’t through over voltage/current? Only thing I could think of would be writing to the flash memory too frequently.

Thank you.
I am so glad that I’m not the only one struggling with finding an AI architecture. I will take your suggestion to heart- building it up, testing each piece as I go, seems to be an excellent way to go! Thank you again. :slight_smile:

Edit: Just realized that “viable” means something different.

"The walking mechanism that

"The walking mechanism that came with the toy involves switches that must give feedback on how far the motors have turned" , it’s pretty much the mechanism of a servo motor. I’ve seen the roboraptor on youtube, so the mechanism involves only 2 servo motors but it can move it’s head, arms and feed, it looks like complicated, but since you already unpacked the toy, this should be continued, If you’re really willing to finish this, then you should create a timeline for this. In case the timeline has passed you should try to make another robot with simpler mechanism.

Question :

“the motors can’t run too long since it’s getting too hot, then the volt is too high. what’s the voltage regulator ? is it the switch ? how many volt(s) do you supply ?”

 

If I were you, my first step is to fix the electronic parts,

- My very first step is separating the electronic parts from the mechanical parts in order to test whether it works perfectly or not.

- probably I will use single wire cable instead the original cables

- I will try to add 100 nF ceramic capacitor to help reduce the noise of the motor dc (decoupling capacitor)

- I don’t know why the switch didn’t give feedback, maybe I will try to replace the circuit with newer one (before that, I will check the cable connection, I will make sure the soldering is strong by adding some glue gun above the soldering, if only by repairing the cable connection it works I don’t need to replace the circuit).

- once the motor is working as expected, and there is no problem with cables and electronic, I will plug it again into the body,

- my next step is trying to finish the mechanism. (however since I don’t have one, I can’t really figure out how the geering works)

- Once everything works as expected, I will plug all peripherals, then do the coding.

and then I’m done ! yes ! I’ve finished the raptor … but wait … it’s just my imagination since I’m not the one that will finish this raptor

Hey!
Just wanted to say thank you for your input! :slight_smile:

PS. The switches were just taken apart from from the legs, so that’s why there’s no feedback- they are still in great working condition. Sorry for not being more clear.

Motor voltage and wiring

Hi NeoGirl101,

I just watched your video and had a couple comments/questions:

- What voltage are you running those motors at?  Most of the yellow gearbox style motors are 3V or 6V motors.  The ones Radio Shack sold were 6V (I believe).  Don’t run them higher than their rated voltage, or they will burn out fairly quickly - possibly within minutes.  I have work experience with -many- of these motors, and have built test fixtures to do long term failure testing of them…

- Although crimping and hot glue seem like quick solutions, I don’t recommend you use those methods to connect to the motor terminals.  Solder the wires.  Also, for strain relief, I cross the wires under the plastic strap holding the motor to the gearbox.  The motor terminals are fairly weak.

–Jay

Wow.
So my motors are 6v. Thank you so much for telling me that! I’ve been using a single 9v battery to test them- no wonder they’re burning out! Thank you for the soldering suggestion, too. :slight_smile:

Motors burning out

That gives me the opportunity to ask why electrical motors can burn out.

They are just coils, right, what can burn? Is it too much strain on the gears? What if you removed them, would you still have this issue and would the motor heat up too much?

I think it has to be more than the gears, because I observed a servo heating up while it was loaded too much, but the gears did not slip.

When the current flows through the coil somehow the non moving shaft must represent some electrical resistance. But it’s just a field, where does the heat come from? I don’t fully get it.

Re: Motors burning out

For these small DC brush motors (check out wikipedia if you need to), the brushes are what tend to burn up.  They are thin pieces of metal and do wear out over time from regular use.  If you over-voltage the motor, two things happen… you put more current through the brushes, and the motor runs faster than it was designed.  Both result in more heat build-up in the brushes, and they break down.

It’s possible other problems will happen running the motors too fast - mechanical issues due to heat (i.e. if plastic is used as a bushing, and it melts), or you could eventually burn out a coil wire, although I suspect you’ll lose the brushes first.

Brushless motors avoid the problems with brushes, but still can suffer from heat problems (melting coil wires, or mechanical issues).

Unless something is a superconductor, it will have resistance.  The wire coil has resistance, the brushes have resistance, etc.  Power = current(squared) * resistance.  When you calculate power for a resistive element (coil, brushes), that power is translated into heat.  That’s where the heat comes from.  Since the DC motor has a fixed resistance (mostly the coil), you can roughly get the current using ohm’s law current = voltage / resistance  …  If you double the voltage feeding the motor, you’re doubling the current,  and SQUARING the power.

That’s a really rough summary - I’m sure there are plenty of websites and videos that could explain these things better!

–Jay

 

Thanks, that’s an excellent

Thanks, that’s an excellent explanation.

Now I am only wondering why a servo would heat up when it is stalling. Does it try to increase the current (and therefore power, since voltage stays the same) and therefore dissipate more heat? And the resistance is still from the coil wire only, in case of a brushless motor, but the magnetic field is not a factor relevant to the heating?

After a web search with better terms (due to the given reply) I found a partial explanation:

http://physics.stackexchange.com/questions/108100/why-does-an-electric-motor-burn-up-when-you-physically-stop-it

http://physics.stackexchange.com/questions/96572/why-do-electric-motors-draw-current-even-when-they-are-not-moving

http://physics.stackexchange.com/questions/191628/electric-motors-why-do-they-draw-more-current-when-stalled-and-less-when-movin?noredirect=1&lq=1

It’s still not entirely clear if the resistance caused by a magnetic field may cause heating up. I am thinking of inductive reactance, but maybe there are other kinds of resistance caused by magnetic fields.

I ignored the back-EMF component in my explanation

The links you provided discuss the back-EMF generated by the motor (motors can work as generators too, and when operating they will work as both).

When you apply voltage to a stopped motor, current flows (based purely on coil resistance), genates a magnetic field, causes magnets to move, and the motor starts spinning.

As the motor spins, the moving magnets cause an opposing current to flow in the coils.

Ultimately, the current in the coil is the difference between the two currents (externally applied and internally generated), and will be less than the current of a stopped (or stalled) motor.

The heating issue is the same: (resistance of the coil) * (total current)

I’m definitely oversimplifying… but I hope you get the idea.  I’ll need to pull out my motor textbook to refresh my own memory soon!

When you start getting into Impedance (Z), you are looking at both Resistance ® and Reactance (X)

Z = R + jX

Z is a complex number (that’s what the j is, square root of -1)

Anyways… yes, it comes into play at some point (like you stated, the coil has inductance and resistance), but for simple analysis I wouldn’t worry about it.  And I’ll really need to pull out the textbook if you are worried about it :slight_smile:

–Jay

Additionally

Additionally you can think about it this way, every electrical device is designed, rated and made to operate under certain power conditions. As you exceed those power conditions the device will shed the extra power as heat. You shed enough heat you get smoke, even more and you get fire because the device cannot shed the heat fast enough. Put on some heat sinks and you can extend the power limit.

For a deeper understanding, as you’ve done, you can search the web. Or, a book I recommend is Practical Electronics for Inventors by Paul Scherz and Simon Monk (I have no affiliation with the authors).

-Rich