Baby Orangutan B-328 Robot Controller (POLOLU-1220)

This is a placeholder topic for “Baby Orangutan B-328 Robot Controller” comments.



The Baby Orangutan B-328 is a very compact but complete robot controller, packing a high-performance ATmega328P AVR microcontroller (with 32 KB of program memory and 2 KB of RAM) and two motor drive channels in the same 24-pin form factor as competing units that include just a microcontroller. You can connect your battery, sensors, and motors directly to this small module to make a miniature robot, or you can use the Baby Orangutan as an auxiliary controller in larger robots.

Read more

A post was split to a new topic: NiMH VH4000 4/3A Battery

Is there a physical layout diagram for this somewhere? I’m trying to make a pcb with eagle for this to plug into but can’t find the dimensions for the pin layout.

Recently bought 2 of these. Nice little boards; built in motor driver is a good feature.
Thought I would post my experience with getting the boards running, which may help someone.
Welcome comments from anyone who has used these boards as well.

My design is a micro robot cart with 4 sensors. It moves related to input from the sensors. This will be my first true robot; the program is the only control for the robot. Previous designs have been closer to remote control carts rather than a true robot cart.

Sensors are, IR distance, PIR motion detector, LDR forward looking, LDR upward looking.
The robot will look for motion and attempt to move towards that motion.
If no motion detected it will turn to look in another direction.
If no motion in 360 degrees it will attempt to find the darkest place in the room and wait for motion to be detected again.
The IR Sensor is to avoid obstacles.

Anyway that is what I am attempting to do. Further posts will list specific problems encountered and how they were resolved.
Cheers
Jim

Both Motors Full Speed.

Initial investigation of the board: I used the Arduino IDE, an AVR ICSP Programmer and the Pololu Libraries. Both motors would run ok up to a certain speed, beyond which the board would constantly reset. One motor full speed was ok, but not both. If motor speed was increased gradually both would eventually run at full speed ok.

Solution was to remove the reset line capacitor to GND. Checking the Pololu Forum an employee said it was not needed and could be removed. The forum post was talking more about serial programming via a bootloader and the capacitor interfered with this process.

The post detailed cutting the track to the capacitor.

Reset Cap Circuit Reset Cap Board

The reset line is also connected to the standby line of the motor driver. My theory is the sudden demand for current by the motor driver caused a small spike which was enough to reset the Atmega328P via the capacitor. Unsure if that is the reason, but removal of the capacitor allowed both motors to run at full speed immediately.

NOTE: The Pololu Forum post was in 2011 and the employee stated the capacitor had been removed from the design. The boards I purchased in 2020 still have the capacitor; maybe they are old stock or maybe the information is incorrect.

Also the full speed motor problem could be related to the board I am working with, I have not tested the second board at this time.

Cheers
Jim

Bootloader Install

I have 2 Arduino Atmega328P programmers, both have worked perfectly on other projects.
uino Atmega328P programmers, both have worked perfectly on other projects.

USB AVR ISCP Programmer (plus 8 pin to 6 pin adaptor)


USB FTDI Serial Programmer
284-00

Using the ICSP programmer I loaded code into the Baby Orangutan. The FTDI did not work because the micro did not have a bootloader. (loading code via an ICSP programmer destroys the bootloader anyway) FTDI programming is my preferred method as it allows debug via the serial() function. With ICSP there is no access to the serial port, very hard to see what sensor values are and where the micro is in the program code. Pololu recommend use of their ICSP programmer which has connections for the TX/RX pins of the Atmega328P.

I was able to get this working on the Baby Orangutan using both programmers. The ICSP as the program load device; the FTDI as a serial port. But the wiring was messy and it used 2 USB ports. Previously I have loaded many different bootloaders using the ICSP programmer successfully. Then switch to the FTDI to load and debug program code. I didnt want to buy the Pololu programmer, just to program the Baby Orangutan, as I already had 2 perfectly working programmers. So the solution was to install a bootloader and use just the FTDI programmer. Its a much simpler interface using the TX/RX, RST and GND pins. The ICSP interface uses more pins (MOSI, MISO, RST, SCK, VCC, GND) which could interfere with circuit design. In the case of the Baby Orangutan the MOSI pin is used to drive one side of motor 2.

The second problem is the clock frequency. Most Atmega328P (Arduinno) devices run at 16MHz, so bootloaders are setup to produce a serial clock based on this CPU speed. The Baby Orangutan clock is 20MHz, meaning the serial port will not work at the baud rate specified in the Arduino IDE board.txt file. The file can be modified specifying a rate that will work. (the formulae in the Atmega328P datasheet allows you to calculate what that will be)

example: specifying 144,000 baud in the boards.txt file will allow the Arduino IDE to work at 115,200 baud for a 16MHz bootloader and clock of 20MHz such as the Baby Orangutan. Pololu suggest doing this. In my opinion it is messy and confusing.

In my searching for a 20MHz bootloader I came across the Mini Core bootloader libraries. This is a collection of many bootloaders that will work at many clock frequencies on many different version of the Atmega. I highly recommend installing this if you are using different clock rates and different micros. You can select the particular micro, clock and other settings in the Arduino IDE; very easy to use and works.

With Mini Core installed I used the ICSP programmer to load the appropriate bootloader for the Baby Orangutan and am now loading and debugging code using only the FTDI programmer.

Note: you need a 0.1uf capacitor between the RTS line of the FTDI and the RST pin of the micro. This is something I seem to forget when making custom Atmega circuits. A real gotcha !!!

A note on the Pololu libraries:
I abandoned use of these libraries because they made too many changes to the Arduino IDE that were incompatiable with other libraries. But the Pololu routines use direct inline code which would make for faster operation. Pololu recommend use of their own development IDE which should work ok.

Conclusion: Pololu have designed the Orangutan series to run as fast and as efficiently as possible with the use of minimal code. 20MHz clock, no bootloader, custom inline code libraries. But this takes away compatablity with the Arduino IDE, other libraries and similar devices.

Hope this information may be of use to someone some day.

Cheers
Jim