Search This Blog

Showing posts with label inexpensive. Show all posts
Showing posts with label inexpensive. Show all posts

Thursday, 8 May 2014

Further Progress on framing my RepScrap 3D printer.

Well, this is what the RepScrap looks like today.



I finished the Y-Axis table late last week, and tested the moment.  It's a little sluggish with the printer motor driving the bed, but will do for now.  I foresee burning this poor motor out, so will probably have to replace it with a gear motor at some point in time. 

The Y-Axis bed is the glass top of the all-in-one printer's scanner.   The aluminum cross bars come from the bottom track of a sliding closet door.


 As I mentioned in my previous posting, the frame for this was scavenged from exterior railing extrusions.    

Here, I am truing up frame that houses the Z-axis ball bearing slider rail, shown below.  These drawer sliders seem to be very tight, as in, there doesn't seem to be much slop at all. 








 At the top of the Z-Axis frame, I am placing the two DC-Motor /Encoder assemblies used for the paper feed on the inkjet printers. 

I am opting to run a threaded rod through each to drive the Z-axis gantry.  It had been suggested over on Reddit, that I might have success with a taught wire or line looped around the rough tubing of the sheet feed roller, but I think the threaded rod will be easier to design and troubleshoot.

  

And below, is my test circuit for the motor/encoder interface.

One thing that I am doing instead of having a separate Optical Endstop for each axis, is that I am making a larger black bar at each end of the linear optical encoder strip.  This can then be identified as a discrepancy during the encoder interrupt routine, and trip the endstop routine.




And a few more pictures of the Z-Axis gantry assembly with the X-Axis rail attached.






Tuesday, 15 April 2014

Quick Update on PenguinBot


I've moved the MaxSonar EZ1 onto a panning servo, and attached it to the outside of the electronics enclosure.



I've also added a "BlinkM"  intelligent LED to give PenguinBot some personality.  I haven't written the code for it yet, so it's currently just scanning through it's default pattern... but there's always tonight....

I've added Serial Control to drive it tethered via USB, my expectation is that I will get a BlueTooth-FTDI  adapter...

I've broken the Arduino code out into separate tabs according to their role, ie: motion control, serial interface, sound...



This project is growing legs.....













References:

BlinkM datasheet


Monday, 10 March 2014

Success! OSLRF01 (LIDAR) successfully Scanning and providing accurate results.


I've been working on getting the OSLRF01 (Open Source Laser Range Finder)  to provide Distance Readings, using an Arduino Fio, running at 8Mhz.  My objective was to create a library to communicate with the OSLRF and make the interface easier for the end user.

After several iterations of my own, I exchanged emails with Tim Eckel, who wrote the NewPing Library for Ultrasonic Rangefinders , and have successfully created a version that will manage the signals from the OSLRF01.

Below are some images of multiple "pings" of the OSLRF sampled through the ADC of the Arduino.


At first, I had a problem with Ghost images.  This turned out to be a problem with the way I was managing my timers during interrupts.

Similarly, once I got a handle on the overall timing structure, I found I was still getting some sporadic samples...  Time to move away from "Arduino Code".  The "price" for digitalRead(PIN) and analogRead(PIN)  is many cycles...  Tim's NewPing code  cured this with converting to bitmasks, and doing bit manipulation of the ports.    Significantly faster....



So now, we have a 100 ADC samples of  41 iterations, all neatly stacked on top of one another.

And here is an image of the "Zero" pulse (The outgoing Laser Pulse) superimposed on the Return Echo "Signal".
This represents 64 "pings" of 59 ADC samples.   In here you can see I only had two bad samples, which are easy to remove with a median filter.


Now, using a slightly modified version of the NewPingExample Sketch 

// ---------------------------------------------------------------------------
// Example NewPing library sketch that does a ping about 20 times per second.
// ---------------------------------------------------------------------------

#include <NewPing.h>

#define SYNC_PIN  2  // Arduino pin tied to SYNC pin on the OSLRF01 RangeFinder.
#define ZERO_PIN     A1  // Arduino pin tied to Zero pin on the  OSLRF01 RangeFinder.
#define SIGNAL_PIN     A3  // Arduino pin tied to Signal pin on the  OSLRF01 RangeFinder.
#define MAX_DISTANCE 1000 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 900-1000cm.

NewPing oslrf(SYNC_PIN, ZERO_PIN,  SIGNAL_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
unsigned long int syncWidth;                  // Retrieve Sync PulseWidth - used for calculating Timebase
unsigned long int zeroRise;                      //  Retrieve Strating edge of outgoing Laser Pulse - Trigger...

void setup() {
  Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.
  syncWidth = oslrf.sync_width();
  zeroRise = oslrf.zero_rise();
}

void loop() {
  delay(50);                      // Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.
  unsigned int uS = oslrf.ping(); // Send ping, get ping time in microseconds (uS).
  Serial.print("Ping: ");
  Serial.print(uS / US_ROUNDTRIP_CM); // Convert ping time to distance in cm and print result (0 = outside set distance range)
  Serial.print("cm       "); 

We get the following result...  Very consistent and clean.  

=~=~=~=~=~= PuTTY log 2014.03.09 22:11:53 =~=~=~=~=~=~=~=
Ping: 129cm  
Ping: 82cm     
Ping: 78cm      
Ping: 82cm       
Ping: 82cm      
Ping: 82cm      
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 83cm       
Ping: 82cm       
Ping: 83cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm  
Ping: 82cm      
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 83cm       
Ping: 82cm       
Ping: 83cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm       
Ping: 82cm     

Tonight I will take all of my "commentary" out of the Library code, and push it up to Github for anyone else who wants to play with this Wonderful Laser Rangefinder!

Did I mention it's only $100USD  !!!


Next up:   Writing the code to retrieve and display Cartesian Coordinates of echo returns while scanning.

Next, Next up:   Re-work all of this to fit on an ATtiny84 so I can finish my daughterboard I2C version....







References:
LightWare Optoelectronics ...
Open source, TOF laser rangefinder
 NewPing Library
Google Code: arduino-new-ping
Example of driving ADC and DAC from timer for regular sampling
Advanced Arduino ADC – Faster analogRead()