Let's Make Robots!

Things that drive you mad!

Have you ever been stuck on a problem for hours or even days and then find that the answer was so simple?

I would like to make a collection of robot tips and tricks for when you get stuck. A list you can look at of all the stupid things you might have done. Hopefully by creating this list then in the future when you get stuck on a problem that just doesn't make sense you can read through it and solve your problem in just a few minutes.

I'm hoping everyone will add their experiences here to create a comprehensive list of silly mistakes to be avoided. To get the ball rolling I will start with some simple problems that had me stumped at first.

Software Problem: I was writting code for an Arduino Mega which has 4 serial ports but the compiler complained if I used anything other than the first serial port. I checked all my code twice, nothing was wrong.
I had the "board" setting set for an Arduino board that had only 1 serial port.

Software Problem: I was getting weird behaviour from my robot, the code was fine but values of a variable were jumping around a bit.
Solution: I had initialised a variable as a byte to save memory and then later changed the way I used that variable so that it's value exceeded the 0-255 limit of a byte. Changing the variable to an integer solved the problem.

Hardware Problem: My Spider controller worked fine with 16 servos but not 17 or more. I assumed the problem was my code or the board.
Solution: My battery holder and power cable were not heavy duty. Changing to a batterypack with heavy duty wires fixed the problem.

Software Problem: The Arduino IDE keeps complaining I have an invalid octal constant (WTF!!)
Solution: I had defined an IO pin with a 0 in front like this: "#define IOpin  09" instead of "#define IOpin  9"
The compiler saw the 0 in the front as an indication that the value was octal in which case 9 is an invalid number.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Endian problems... most serial is little endian, if you are using big endian displays or other parts be aware you need to reverse the bits!

New Hardware:

After successfully testing an MP3 serial comm circuit on a PICAXE 14M with a 10K pull-down on the BUSY line, per PICAXE expert design, it failed to transfer to a 20X2. After 5+ hours of CALBFREQ nonsense and assorted code headbanging, I found a 4.7K pull-down finally let the line go low. My Gawds, it works at last. Again. For now lol

Old Hardware:

See here. In my mind, sinking current is not the natural way for chips to behave. Sourcing is. The prolem is some things just don't agree with my logic. Such as was the case with my IO expander that just wouldn't light my LEDs bright enough. Only 4mA per channel? Not enough juice. That's until I threw the current sink at them!!

I was building a stepper motor control circuit about 12 years ago. In those days I had a book of data sheets, no Internet. There was a misprint in the book that had 2 IC pins swapped over. It took a day of frustrated fault finding to realize the book was wrong. My clue was that the IC pins usually have some pattern to their arrangement. These two pins broke the pattern.

I could not drive servos off a picaxe 28x and after a little bit of trouble shooting I search LMR and learned that I forgot to put in the resistor array.  So the lessons learned was to a)Remember to check why something is there and b)LMR Rocks.

Software: I use the old servo library a lot in conjunction with the newsoftserial library. This means you can only use 2 servos on specific pins. Well when you are done, remember to put the new servo library back in the library folder and remove the old one. I forgot to do this and could not figure out why, after uploading a new program, my hexapod's servos would not work. I never guessed it was a software problem and ended up taking all the hardware apart before realizing it. There is the story to why I am making my hexapod V2. Sad I know. :P


Who was the brain trust that decided to put the data pin in the center?

On the "standard" picaxe 28x board, the ADC pins are arranged with pwr and gnd on the outsides and the signal pin is in the center. No other "servo connector" is set-up like this. This design mistake is responsible for blue smoking no less than (4) sharp sensors in my house alone. Terrible.

Hardware: not understanding why my l298n motordriver was'nt working properly, and after a few days of soldering and searching.. I found 2 NEW motor drivers that I ordered because I had a broken one before... I had soldered the ALREADY BROKEN h-brigde into my pcb! damn.. so a tip: throw away your defect components intermediately.

Ha! That's a good one. If you are going to keep the old parts around, try marking them. Maybe you could use dead parts as decoration on some sort of junk bot, so there's at least one reason not to throw them out. ; j

I love this type of blog, where people share their (sometimes embarrassing) mistakes for the benefit of others. I did something similar with my Ignoble Idiocy blog, but this one is perhaps more constructively focused.

My most recent 'thing that drove me mad' was an Arduino Brown Out Detection (BOD) issue. On my way to a show to demonstrate my robot Venux, it stopped working. Thinking it was low on battery power, I grabbed some spares and headed off to the show. When I got their, new batteries were no help. It powered up, but didn't do anything.

Back home the next day, I reloaded the code and everything worked fine. It turns out the BOD defined in the Arduino bootloader was disabled. When the power to the Arduino dips too low, it can wind up corrupting memory, including the stored code. The BOD feature tells the processor to reset if the power dips below a selectable threshold. Since my chip didn't have a BOD threshold set, I lost the program code.

I have had this happen once or twice. I did not realise the BOD was not enabled in the Arduino bootloader. How do you enable it?