Tuesday, January 26, 2016

Added GPS to bot

I got the GPS positioning up and running!

I received the Adafruit GPS Hat I ordered, which is this https://www.adafruit.com/products/2324.

I also ordered the stackable header  https://www.adafruit.com/products/2223, so that I can plug the ribbon into the HAT board now, instead of the Pi.

I ordered the SMA to uFL adapter:
https://www.adafruit.com/products/851,

the external GPS antenna:
https://www.adafruit.com/products/960,

the coin cell battery:
https://www.adafruit.com/products/380,

the standoffs https://www.adafruit.com/products/2336

I soldered the stackable header, installed the board with no issues.  I installed the gpsd daemon that Adafruit detailed in the nice online guide, and I used the python code from Dan Mandle's blog here:
 http://www.danmandle.com/blog/getting-gpsd-to-work-with-python/.

In order to bring the data into Codesys, I wanted to pass the data values into the Codesys Pi's Modbus server, so I installed the pymodbus library from here:
 https://github.com/bashwork/pymodbus

Using the library's payload builder and client's write registers function, I was able to successfully get the data from the GPS into the Codesys.

This is the same method I will eventually use for the Phidget modules I will need as well eventually, since there is a ton of python code out there for that as well.  I could end up compiling and running it in C, but I like the simplicity of using the Python, and speed in this case isn't an issue.  We'll see what works out better later.

Here are some pictures...

Adafruit Hat GPS plugged into Pi




Screenshot of GPS Data












Saturday, January 23, 2016

Voltage / Current sensing added

Last night and today, I added the voltage sensing circuit, and current sensing circuits.  Not happy about the current sensing, turns out my sensors are rated too high (600A) sensors, to get enough resolution sensing the low current of the bot.  Oh well, I have to price out some smaller ones.  I had these laying around and hoped I could use them.

I've also been looking at the frame.  I knew the swivel was more or less temporary, but I have a plan now.  I will go ahead and mount the 2nd part of the frame above the box height, and connect the two frames by 4 connecting beams.  I will attach the swivel bracket to a cross member attached to both frames.  This should double the strength and rigidity, and also double my mounting space on the rover.  I will need this room up top for the detector control enclosure and the other hardware.

Below are picts of the new wiring and sensors, and a new screenshot.


New voltage and current sensors

Latest screenshot without meters and more info

Tuesday, January 19, 2016

Added the Estop and power switch circuit

Hi folks!

I've added the Estop and Power On/Off circuit.  With this I can run the bot on the ground (hopefully).

Here are some new pictures of the mods.  Below are videos I posted also..

Estop and Power Contactors with Estop button and Power On/Off.

Rear view Left

Right side lid open


Rear View Right

cell phone browser GUI screen





Friday, January 15, 2016

Rover update

Hi folks,

I haven't updated in a while, so I thought I would post some of the latest pictures and info.

I have changed the rover setup somewhat from the original plan.  Originally, I was going to use an onboard generator, to power a 120V power circuit, since I had lots of 120V powered hardware.

I have modified that a bit.  I added two, 12V batteries in series for 24V.  I also added a 24V inverter to power the onboard electronics, along with a battery tender charger, that is designed to be left in the circuit all of the time.  This allows independant, "quiet" running off of batteries, and still retain the ability to charge off a generator for long term field use.

I have several power supplies running for 12V, 5V, and low power 24V (isolated from batteries), on the 120V power circuit.  Without much of a load, the power supplies only pull 32VA on the power circuit, or 0.28A.  The inverter can supply up to 600W so I should have plenty of room.

I am using a puresine type inverter, to give me the cleanest AC power I can get.  I had a modified sine wave type earlier, and one of my power supplies was wining about it, so I changed over to the true sine wave.  No more wining from the power supplies.

I also have the SoftPLC with the Codesys running on my base board installed.  I am driving the Sabertooth 2X25 motor drive board from 2 of the DAC outputs on the baseboard.  This seems to work really well.  The base board is running the Adafruit 10DOF IMU, which gives me pitch, roll, and yaw, with Heading.  I also have temp and barometric pressure with altitude from this as well.

I have a Pi camera embedded in the control GUI, to steer by, if needed.  I have also upgraded the Wifi Router to an uptodate TPLink AC1750 Dual Band Gigabit router.  This gives me plenty of range, and bandwidth for streaming video and control.

I still have to install my main power on/off circuit, and my ESTOP circuit before I can run on the ground.

Still to do is adding the ROS computer.  I had originally planned on the Zotac HTPC, but I will be changing over to an Intel NUC or equivalent, and run ROS from that.  The plan is to bring in ROS-specific sensors such as the Kinect, and run a Modbus server, to pass data from the SoftPLC based Pi.

I still have to build the detector array, as well as the Main Operator Console which I havent started on yet.  I could use a laptop for this, and run everything from the broswer GUI, but I really like actual hardware.  I had planned on using another Pi with the 7" touchscreen display, running another SoftPLC and Codesys - using the Pi hardware, and perhaps another base board for this.   However, I would use the laptop with Windows 10 and run another gui with a SQL database historian from it.  I can run a USB server on the ROS machine, and have access to Phidgets and other USB based hardware in the rover from the Windows machine.  This would allow me to use my Phidget GPS and other boards I bought.

I guess that's it, I'll post more later. :)

Below are some pictures of the various hardware, and a screenshot of  a basic rover motor control GUI.

Screenshot of Motor Control GUI

Right side view of Rover with lids open

Left control bay showing batteries, inverter, and charger.

Left bay again

SoftPLC running Codesys on the Pi and baseboard with Sabertooth 2x25 and Wifi router

Sunday, September 13, 2015

Working on MD code a bit

Well,  I worked on my detector coding a bit this weekend.  Finally.

Using the Teensy is pretty fun, I will have to admit.

In less than a page of code, I had the PWM set up for the TX pulse at the frequency and duty cycle I wanted, and I then had the interrupt service routine set up to sample with the A to D, after the end of the TX pulse.

I really like the libraries available for the Teensy.  Even though it's still Arduino sketch coding, it can do what a  normal Arduino just can't.

I have the main sample pulse at 15uS past the end of the 50uS TX pulse.  I then delay 20uS past the end of the main sample pulse, and sample again for the Ground balance sample and average the two before exiting the ISR.

All in one page of code.

No setting up ISR registers, no setting up A/D, no setting up PWM, other than a few simple defines.

Screenshot of TX pulse, Main Sample, and Ground balance sample.

Monday, September 7, 2015

Fully Assembled board

Here's the fully assembled board.  I have the Pi sandwiched between the Base board and the Grove Pi.  I like this setup, since it gives me more I/O and adds two more serial channels for me to use, even one straight from the Pi.  I also might like to try my Logi-Pi Spartan 6 board this way with the PMOD ports, if I can figure out the FPGA side.

The Grove is just another I2C address to the Codesys.  It has a simple little command protocol mechanism that I can talk to any of the Grove Modules via the on-board ATMega 328 mcu.

I intend to use the Grove I/O mainly for the Operator Interface that won't exit the enclosure, and use the industrial 24V out on the external I/O.  It could be a really good fit in my opinion.

I am seeing weird performance from the Grove Temp/Humidity sensors though.  Seems like a bug in their firmware, since I get the same readings in Codesys as I do the Python test code.

Base Board with Grove Pi+
Base Board with Logi Pi

Sunday, September 6, 2015

Board is done and it works!

Ok.  It's done, and it works, but I had to do some jumpering to make it work.  I originally designed the board with 2 I2C buses, but with the Teensy I had to step back a bit, and not use the 2nd I2C bus.  Turns out the I2C bus library that supports 2 I2C buses, is not compatible with the Adafruit libraries for the IMU.

This just means one I2C bus with all of the I2C traffic control from Codesys and my custom driver profile (actually 2).

I had to mount a riser to the IMU so that it cleared the Pi ribbon, and the DAC adapter did indeed turn out to be horrendous.  But it works, which for a prototype board is good.  I didn't even have to cut traces, which to me is a win.

There are are a lot of milestones I met with this board.

  1. Board layout software (Eagle 6.6.0) worked well, and generated good Gerber files.
  2. OSHPark did a phenomenal  job on making the board.  I can't say enough good things about them.
  3. The design worked.  Yes, I forgot some missing jumpers, but the design is now proven to work.
  4. Through hole is still king for me right now for ease.  That single SSOP16 to DIP adapter for the DAC  has proven the most work.  I know I should have checked, but I would ASS U ME, that the nice, wonderful, super cheap adapter you bought, isn't screwed up right? **cough Sparkfun**.   I will avoid SMT until I get my reflow oven built, and get setup for it.
  5. My several parts I made were perfect, and I am very happy with the overall look and layout of the board.
  6. I last designed a board using Ultiboard in 2002.  Ultiboard and Ultirouter cost $10000, and getting a board made cost between $1000 tooling and setup and $50-$100 each per board.  Now I use Eagle at $200, and it cost me $95 for 3 boards.
Brand new PCBs from OSHPark

Assembled Board running.

FAIL SSOP to DIP adapter fix