Flame On! SunRover Solar Powered Robot Raspberry Pi / Arduino Power Up

Power Up!

Flame On! SunRover Solar Powered Robot Raspberry Pi / Arduino Power Up

Power Up!
Power Up!

Today we did the first power up on SunRover.   We had hooked up the power distribution system (3.3V, 5V and GND) throughout the equipment bay (a redo to get rid of the electrical noise problems on the SunRover Robot and to expand the equipment bay to allow more sensors.  We like Sensors).

SunRover is a solar powered robot designed to be semi-autonomous (SunRover Robot Philosophy: Yes, I will move around by myself until I get confused or find a cliff.  Then I will ask for help from a human.  Or at least a cat).

Results

IMG_5756
Grounding system Good. Power Good.

First of all, no flames!   This is a good thing.   We had throughly checked the power distribution system so we were not expecting anything.  The Raspberry Pi worked flawlessly, picking up the I2C 4 Channel Mux immediately at I2C address 0x73 as expected.

The Arduino was more of an issue.  First, let us explain that we are using PlatformIO as our development environment for the Arduino.   In Project Curacao, the Arduino was only programmable by plugging a USB cable into a host computer using the Arduino IDE, which means we could not program the device remotely.   While we did a good job setting up the power management system, there have been things we would do differently given 4 months of experience that could be changed from 3500 miles away, much as we tweak the Raspberry Pi software remotely.

SunAirPlus Boards
SunAirPlus Boards

For SunRover, we decided to do things differently.  We are using PlatformIO as our Arduino environment and have the Raspberry Pi connected into the USB port on the Arduino.  Note:  We are not powering the Arduino from the Raspberry Pi.  As you can see in the picture above, the USB from the Arduino goes from the Arduino to the SunAirPlus Solar Power Controller (SAP2) for power and then uses the data pass though plug on the SunAirPlus board to send data back and forth from the Raspberry Pi to the Arduino.   It works like a champ.  Now we can program the Arduino power management system from the Raspberry Pi.  We are using the command line to do this, but with lots of terminal windows open, it is close enough to a graphical IDE and the benefits to our system are huge.  See below for the issues we found.

Next Up?

We will next hook up the SunAirPlus Solar Panel and battery systems and the Quad Power Management Boards.

The Problem

We decided to use an Arduino Due (32 bit much faster and more memory than other Arduinos), but after installation, we were able to  program the Arduino Due in our system, but could not get the serial monitor to work to verify the system was working.  We tried both the programming port and the native USB port, switching the PlatformIO development platform between the two.  After working with this for a couple of hours, we determined that it was not worth figuring this out at this point, so we replaced the Due with an Arduino Mega2650 and everything came up perfectly.   The output from the Arduino Mega is below.  Note:  The ONLY thing we have connected to the I2C bus at this point, is the I2C 4 Channel Mux, at address 0x73.  That is why you see various errors on the serial output.  The system is designed to have failures in sensors and keep going.

The only wiring error we found was that we had SDA and SDL reversed on the Arduino I2C bus interface.  When that was fixed, everything came up appropriately.

Below the Arduino output is the output from programming the Arduino Mega2560 using PlatformIO.  We can’t say good enough things about the PlatformIO development system for Arduinos.

 

--------------------------
SunRover WatchDog
Version 0.75082215
--------------------------
 07/27/2015
Compiled at:01:18:18 Sep 17 2015

------------------------------
QPMBOARDs Reset
------------------------------
QPMBOARDS reset
I2CMux1 configured
RTC is NOT running!
MDY=Sep172015
tm=2015-09-17 01:18:00
Ok, Time = ::, Date (D/M/Y) = 17/9/2015
getDate true
timeStatus =0
<<<<<<<<<<<<<>>>>>>>>>>>Time taken from Arduino
<<<<<<<<<<<<<>>>>>>>>>>>Time taken from Arduino
timeStatus =1
----internal arduino clock
0:00:00 0 0 1970
----internal arduino clock
Starting Compass.
Constructing new HMC5883L
Setting scale to +/- 1.3 Ga
Entered scale was not valid, valid gauss values are: 0.88, 1.3, 1.9, 2.5, 4.0, 4.7, 5.6, 8.1
Setting measurement mode to continous.
Entered scale was not valid, valid gauss values are: 0.88, 1.3, 1.9, 2.5, 4.0, 4.7, 5.6, 8.1
Starting OLED-1 Display
displayMode=0
Updating Lines
QPMBOARDS reset
setting Power Channel=  QPM, Channel Number, State: 2, 1, 1
setting Power Channel=  QPM, Channel Number, State: 2, 2, 1
setting Power Channel=  QPM, Channel Number, State: 4, 0, 1
setting Power Channel=  QPM, Channel Number, State: 4, 1, 1
setting Power Channel=  QPM, Channel Number, State: 2, 0, 1
--------------------------
------------------------------
------------------------------
Bus 0 Control Register:1
I2C device found at address 0x73
done

------------------------------
Bus 2 Control Register:4
I2C device found at address 0x73
done

------------------------------
Bus 3 Control Register:8
I2C device found at address 0x73
done
<\pre>

 

The PlatformIO Output

pi@SunRover ~/Arduino/SunRoverWatchDog $ platformio run --target upload
[Thu Sep 17 01:19:02 2015] Processing megaatmega2560 (platform: atmelavr, board: megaatmega2560, framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
BeforeUpload(["upload"], [".pioenvs/megaatmega2560/firmware.hex"])
Auto-detected UPLOAD_PORT/DISK: /dev/ttyACM0
"/home/pi/.platformio/packages/tool-avrdude/avrdude" -v -p atmega2560 -C "/home/pi/.platformio/packages/tool-avrdude/avrdude.conf" -c wiring -b 115200 -D -P /dev/ttyACM0 -U flash:w:.pioenvs/megaatmega2560/firmware.hex:i

avrdude: Version 6.1-svn-20130917, compiled on Nov 30 2013 at 16:47:29
Copyright (c) 2000-2005 Brian Dean, https://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is “/home/pi/.platformio/packages/tool-avrdude/avrdude.conf”
User configuration file is “/home/pi/.avrduderc”
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/ttyACM0
Using Programmer : wiring
Overriding Baud Rate : 115200
AVR Part : ATmega2560
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
———– —- —– —– —- —— —— —- —— —– —– ———
eeprom 65 10 8 0 no 4096 8 0 9000 9000 0x00 0x00
flash 65 10 256 0 yes 262144 256 1024 4500 4500 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : Wiring
Description : Wiring
Programmer Model: AVRISP
Hardware Version: 15
Firmware Version Master : 2.10
Vtarget : 0.0 V
SCK period : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9801
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as FF
avrdude: reading input file “.pioenvs/megaatmega2560/firmware.hex”
avrdude: writing flash (43140 bytes):

Writing | ################################################## | 100% 7.61s

avrdude: 43140 bytes of flash written
avrdude: verifying flash memory against .pioenvs/megaatmega2560/firmware.hex:
avrdude: load data flash data from input file .pioenvs/megaatmega2560/firmware.hex:
avrdude: input file .pioenvs/megaatmega2560/firmware.hex contains 43140 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 5.54s

avrdude: verifying …
avrdude: 43140 bytes of flash verified

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as FF
avrdude: safemode: Fuses OK (E:FF, H:D8, L:FF)

avrdude done. Thank you.

======================================================================================== [SUCCESS] Took 27.30 seconds ========================================================================================
<\pre>