Author Archives: paynterf

How to update the ACP Pyramid

The first thing to understand about updating the Pyramid is that you don’t have to unless there is something wrong with your current Pyramid version (i.e. there is a
a bug or problem) that has been addressed in the latest version available on the ACP website).  As each new version is placed on the ACP website, a ‘change log’ entry is also uploaded, so you can tell what changed from your current version to the one that is on the website. If none of the listed changes affect your practice, then there is no real need to update.

the second thing to understand about updates is that, even if you download the latest version from the ACP site, there is no need to immediately update all your client Pyramid files – it is completely reasonable to update client Pyramids to the latest version only when you next deal with a particular client file, and this is done by simply importing the client’s Pyramid data into the new (blank) version using the ‘Import from File…’ button on the Inventory page (don’t forget to use ‘Save As…’ to save the updated client file back to the client folder while leaving the new version file unchanged).  Here’s a video tutorial showing the update procedure

Charging Station System Integration – New Sunshade Testing

Posted 19 May 2017

While working with John Jenkins on the modulated IR beam idea, I decided to run some tests with the current 4-detector design, to see how the new sunshade with center divider was affected by ambient IR on a bright sunny day.  So, I disabled Wall-E2’s motors and then placed it at several different critical spots in the entry hallway.  At each location I used my little IR test generator to mark the beginning and the end of the test for that location, and then moved on to the  next one.  The locations are shown in the following photos, in the order that the tests were run.

Position 1: Near where Wall-E2 transitions from wall-tracking to IR beam homing

Position 2: This is where Wall-E2 has been winding up when it homes on the outside sunlight instead of the IR beam

Position 3: Here Wall-E2 should be firmly fixated on the IR beam

These results, combined with my earlier IR response tests with a single phototransistor are encouraging, because it is clear that at least in this case, Wall-E2 should have no difficulty discriminating between the ambient IR and the charging station IR beam.

I ran some homing tests, which Wall-E2 handled with ease; unfortunately God had already turned the lights out on this side of the world, so the tests weren’t in the presence of daylight IR interference.  I’ll do some more real-world discrimination testing tomorrow, and I am hopeful that the new sunshade-with-divider version will be successful, at least for this part of the house.

Stay tuned,

Frank

 

 

IR Light Follower for Wall-E2, Part XI – Center Divider Investigation

Posted 16 May 2017

One of the suggestions John Jenkins made during his visit, in addition to the idea of modulating the IR beam to suppress ‘flooding’ from ambient IR sources, was the idea of placing an opaque divider between the left and right halves of the detector array.  He thought that I might even be able to reduced the detector array from four to two phototransistors and still get good homing performance, assuming that each of the two detectors had sufficiently wide beamwidths to accommodate off-axis IR beam intercepts.  The current detectors have a +/- 12º beamwidth, but are arrayed in such a way as to provide well over 60º aggregate coverage.  To do the same thing with just two detectors would require parts with considerably wider beamwidths.  the TAOS TSL267 (another one of JJ’s suggestions) has an approximately +/-30º beamwidth at the half-response points, so they seem almost ideally suited for this application.  As a major added bonus, the TAOS parts feature a photo-diode integrated with an op-amp to address the dynamic range issue mentioned by John.  The diode operates in its linear range, and the op-amp amplifies the IR signal to useful levels.  The only fly in the ointment is that the op-amp gain isn’t adjustable, and its output limits at fairly low light levels – bummer!

In order to investigate the opaque divider idea, I decided to run some bench angular response tests using my robot’s 4-detector array with and without a center divider.  I printed out a copy of the compass rose graphic I had hanging around from my magnetometer project (one of my more spectacular failures) and set up a bench test with Wall-E2 and my little IR test source, as shown below.

Angular response test setup

Closeup of the ‘sunshade’ cowling (black rectangular opening) around the 4-detector array

Closeup of sunshade with divider installed

The results without the center divider were about as expected, with about +/- 45º coverage, as shown in the Excel plot below

Response vs angle for 4-detector array, without center divider

+/- 60 deg response vs angle for 4-detector array, without center divider

With the divider, the response appears to be about the same (note here that the ‘with divider’ response is flipped left/right from the ‘no divider’ case – oops!)

+/- 30 deg response vs angle for 4-detector array, without center divider

Note in the above ‘detail’ view that the response curves for the two center detectors (DET2 & DET3) seem to be very symmetric about the 0º point, as expected.  What this also shows is that just these two detectors could probably be used for homing, if off-axis beam detection weren’t a consideration.

+/- 30 deg response vs angle for 4-detector array, with center divider

The ‘with divider’ plot above shows a significant difference from the ‘no divider’ plot, right at the center.  In the ‘no divider case, the DET1 & DET2 responses are very nearly the same, but in the ‘with divider’ case they are significantly different, and almost perfectly anti-symmetric about the center.  This should allow more precise detection of small left/right deviations from the beam centerline, and therefore more precise homing.

Stay tuned!

Frank

 

 

IR Phototransistor Sensitivity/Dynamic Range Study

Posted 05/14/17

In a previous post, I mentioned that John Jenkins, mentor and old friend, had some ideas regarding my Wall-E2 robot’s problems with homing in on an  IR beam in the presence of ambient IR sources like overhead incandescent lighting and/or sunlight streaming in through windows and doors.   John pointed out that this was really a system dynamic range issue, and it was likely that, as currently configured, the IR phototransistors were running out of dynamic range (saturating) well before the 10-bit A/D’s on the AtMega SBC.  In order to get the detector sensitivity up to the  point where Wall-E2 could ‘see’ the IR beam far enough (1.5-2m) away to avoid hanging up on the lead-in rails (see this post and this post for details), I had to use a very high value collector resistor (330K), which reduces the dynamic range significantly.

In a subsequent email conversation, John suggested that the proper way to handle this problem was to reduce the collector resistor to the point where the detector doesn’t saturate under the worst case ambient IR conditions, and then add amplification as necessary after the detector stage to get the required sensitivity.  John’s point was that as long as the detector response is relatively linear (i.e., it’s not saturated), then there shouldn’t be any loss of information through the stage, so a later linear amplification stage will allow the desired IR signal to be detected/processed even in the presence of interference.  However, if the detector stage saturates due to interference, then it’s basically ‘game-over’ in terms of the ability to later pull the desired signal out of the noise.

This wasn’t exactly what I wanted to hear, as adding the required post-detector amplification stage wasn’t going to be particularly easy – there’s not much left in the way of free real-estate on Wall-E2’s main platform (there’s plenty of room on the second level, but putting stuff there requires inter-level cabling and is a major PITA).  As I was thinking this, I had a flashback to similar conversations with John from 40-45 years ago, when we were both design engineers in a USG design lab; the usual outcome of such ‘conversations’ (to the uninitiated these might be mistaken for shouting matches) was that my circuit got ‘simplified’ by the addition of 50% more parts – but could then withstand a nuclear attack in the middle of a snowstorm at the South Pole!

Anyway, back in the present, John suggested I run some experiments designed to determine the ratio of IR field intensity to collector current for a the phototransistors I was using, so the proper collector resistor value to be computed to utilize the available detector dynamic range without driving it into saturation.  His suggestion was to not  use a collector resistor at all, but to simply connect the collector to +VDC through a current meter, and then expose the detector to worst-case ambient conditions.  I didn’t particularly like this idea, because I only have a manual non-recording multimeter, and I wanted to record the data for later analysis.  So, I decided to program up one of my small SBC’s with analog input capability (in this case, a Pololu Wixel), and set up to measure the voltage drop across a 10 Ω precision resistor in the collector circuit.  The hardware setup is shown in the following photo

Hardware setup for IR Phototransistor Response Experiment

Before and after collecting ‘field’ data, I made a collection run on the bench, using my IR LED test box, with the following results.  As can be seen in the plot, the maximum voltage drop across the 10Ω resistor was approximately 200mV, or about 20mA.

IR detector response bench test. Nose-to-nose with my IR test source

Bench test with IR LED test generator

 

To collect the ‘field’ data, I placed the SBC in different locations around the house, and recorded A/D values.  For these experiments I was using an example Wixel app that printed out the A/D values for all 6 analog inputs, scaled such that the maximum reading was equivalent to the SBC board voltage (3.3V) in millivolts.  In other words, the maximum A/D reading was approximately 3375, or about 3 mV/bit

Location 1: Looking out glass doors on south side of house

Location 2: Direct sunlight through window on south side of house

Location 3: Kitchen floor, looking toward entrance hall and atrium

Location 4: Entry hallway, looking toward atrium. This is the usual starting location for charging station homing tests

Location 5: Entry hallway near door to atrium

These results were not at all what I expected.  Either there is something wrong with the experimental setup, or the ambient light IR field intensity isn’t anywhere near as strong as expected.  If the data can be believed, the ambient conditions are significantly weaker than the bench-test conditions, which were basically nose-to-nose with my IR test LED.  So, if my planned double-check of the hardware doesn’t find any problems, then I’ll change the resistor value from 10Ω to 100Ω and repeat the tests.

17 May 2017 Update

After thoroughly reviewing the hardware setup, I concluded that everything was working properly, but that the 10Ω load resistor simply didn’t provide sufficient drop for reliable measurements.  So, I changed out the 10Ω resistor for 100Ω, and repeated the tests, with the following changes:

  • As before, I started the run by performing a ‘nose-to-nose’ test to verify proper operation, but this time I measured the detector current using a multimeter. The  result was about 15mA maximum current.
  • At each of the 5 locations, I started with a short nose-to-nose section (not shown in the plots) to make sure the detector was operating properly
  • At location 2 (the direct sunlight location), I physically oriented the detector for maximum response.
  • After location 5, I placed the detector on the charging station’s IR beam reflector boresight at about 0.5m distance, and physically oriented the detector for max response.
  • I calculated the detector current for each reading, and plotted that rather than the raw reading.  To calculate the detector current for each measurement, I subtracted the detector reading from the corresponding 3.3VDC supply voltage measurement and divided by 100.

The results of these tests are shown in the plots below:

 

These results are pretty interesting.  As I’m sure John would point out, the direct sunlight response of about 0.2 mA is about 20 times the value required to saturate the phototransistor with the current 330KΩ.  No wonder I was having interference problems – oops!

Stay tuned!

Frank

 

 

 

 

 

 

Charging Station Design, Part XIV – Modulated IR Beam Study

Posted May 10, 2017

A couple of weeks ago my old friend and mentor John Jenkins was visiting the area and stopped in for a couple of days.  Naturally I had to show him my Wall-E2 robot, complete with autonomous charging capability.  Just as naturally (if you believe in Murphy’s law), Wall-E2 refused to cooperate.  Instead of homing in on the charging station, it blissfully homed in on the sunlight streaming in through the atrium, bypassing the charging station entirely!

After John got through laughing, he mentioned that he knew of some other IR-following robotics projects where the designers used a modulated IR beam to allow the robot to discriminate between general IR background noise and the intended signal.  So, I decided to start a feasibility study to see if I could incorporate some sort of modulation into the design of the charging station, without completely overtaxing either the charging station, or the robot, or both!

I started with the idea that I could easily add square wave modulation to the IR beam by simply switching the LED off & on at some reasonable rate (say, 500Hz).  The problem occurs on the other end (the robot), as it will somehow have to a) detect the square wave signal, and b) still have the ability to home in on the modulated signal – i.e. still be able to determine signal variation across the four photo-transistor array.

To investigate,  I created a square wave generator using an Adafruit Trinket, and a square wave receiver using an Arduino Uno, as shown in the following photo

Adafruit Trinket SBC used for generating the square wave signal, and an Arduino UNO used as the receiver

Square wave signal from the Trinket

The first step was to see if the Arduino Uno was fast enough to accurately detect the square wave pattern, so I simply grabbed 100 samples from the input pin using digitalRead() with a delay of about 1/10 of the waveform period.  Then I plotted the data in Excel, as shown below:

Digital samples from Arduino Uno ‘receiver’

As can be seen from the plot, there are plenty of samples per cycle, well above the Nyquist rate for the dominant signal term.

Next, I moved the square wave signal to an analog input on the Uno, and reprogrammed to collect analog values vice digital ones, as shown below:

Analog readings with 500Hz square wave input

As can be seen, the analogRead() function is plenty fast enough to accurately reproduce the digital square wave signal, with about 10-13 samples/cycle.  So, at least in principle I should be able to detect a square-wave-modulated IR beam, and determine its ‘field strength’ (analog reading when the beam is ON) for homing purposes.

Stay tuned!

Frank

 

Charging Station System Integration – Part IV

Posted xx April 2017

While doing the hallway testing that led to the discovery of the overhead IR ‘noise’ problem and the design of a ‘sunshade’ to suppress that noise and implementation of the flashlight reflector idea for the IR LED, I discovered several other problems with the operating system, as follows:

  1. Once the software detects an IR signal, it switches in to IR homing mode, but the only way back out again is to either execute the avoidance routine if it isn’t in need of a charge, or by connecting to the charger and then disconnecting once the battery is fully charged.  There’s no provision for error cases, like getting stuck on on of the lead-in rails.
  2. The charging station disconnect maneuver needs work – it doesn’t back far enough away, and doesn’t turn far enough to actually get away from the charging station.
  3. The routine that monitors the charging state needs work. On several occasions it detected ‘end of charge’ when one of the chargers momentarily switched from ‘charging’ to the ‘finished’ state and back to ‘charging’.  The software should not declare ‘end of charge’ until both chargers’ status is ‘finished’, and the software should employ integration to handle momentary state changes.

Item 1 – Exit provisions for IR homing code

This item actually turned into a full-blown rewrite of Wall-E2’s operating system software structure.  As I looked at the code to determine the best way to implement the required error case detection/responses, it became apparent that the problem was ‘baked-in’ to the software system design, and would have to be addressed at that level.  So, I went ‘back to the drawing board’ (in this case to Microsoft Visio) and reworked the system design to allow Wall-E2 to detect and respond appropriately to error conditions in any mode, not just the normal wall-following one.  The revised structure charts are shown in the following PDF document:

In the revised structure, the system always returns to the ‘Determine Op Mode’ block after each pass through the system, without getting stuck anywhere.  This means that the ‘GetOpMode()’ routine has the opportunity on each pass through loop() to detect error situations (like the ‘stuck’ condition) and respond by switching to the appropriate branch of the structure tree.

Item 2 – Charging Station Disconnect Maneuver

This one was just a matter of tweaking the ‘degrees’ parameter to the ‘RotateCWDeg((bool bRotateCW, int degrees_to_rotate)’ function.  I started out with degrees_to_rotate = 90, but then tweaked it to 120 for better disconnect performance.

Item 3 – Charge State Monitoring

In the current operating system, a function called ‘MonitorChargeUntilDone()’ is called when the robot detects that it is connected to the charging plug.  This function goes into an infinite loop, waiting for the charging status to change from ‘charging’ to ‘finished’.  While in this loop, the charger 1 and charger 2 status lines are read in about once per second, until either both ‘finished’ outputs are TRUE, or the  BATT_CHG_TIMEOUT_SEC backup timer elapses.  This logic seems OK, but I have observed several inappropriate disconnect instances where only one of the two ‘finished’ outputs were TRUE.   I suspect that there is a period of time where these two status lines oscillate from FALSE (not yet finished) to TRUE (finished) and back again, before finally settling down on ‘finished’.

In my new strategy of eliminating all inner loops, the  ‘MonitorChargeUntilDone()’ function will no longer be used.  Instead, the ‘Charge Mode’ block of the new software structure chart (shown below) will be implemented.

Updated Charge Mode Structure Chart Detail

This block will be executed on each pass through the loop() function, as long as the ‘Determine Op Mode’ block returns with the current mode set to ‘MODE_CHARGING’.  When/If the ‘Both Cells Charged’ or the ‘Charger Timeout’ reached ‘if’ statements return TRUE, then the ‘Disconnect’ function will be triggered, which will cause the robot to immediately disconnect and back away from the charging station.  This in turn will cause the ‘Determine Op Mode’ block to output a different mode value (assumed to be, but not necessarily ‘MODE_WALL_FOLLOWING’), and the appropriate portion of the overall structure diagram will be executed.

I’m away from my robot at the moment, at a bridge tournament in Gatlinburg, Tennessee, so I can’t immediately implement and test the above changes.  However, I will be back home next week and hope to have everything running by the end of May. If everything works out, I may have a fully functioning charge station operational by then, and a ‘more-or-less’ fully autonomous Wall-E2 robot.  It will be interesting to see what kind of trouble Wall-E2 can get into with the much longer run times that should be possible with autonomous charging capability.

Stay tuned!! 😉

Frank

 

 

 

 

 

Charging Station System Integration – Part III

Posted 15 April 2017

In my previous post on this subject, I described some IR homing tests with and without the overhead incandescent lights, and the development of a ‘sunshade’ to block out enough of the IR energy from the overhead lamps to allow Wall-E2 to successfully home in on the IR beam from the charging station.  At the conclusion of that post, I had made a couple of successful runs using a temporary cardboard sunshade, and thought that a permanent sunshade would be all that I needed.

However, after installing the sunshade (shown below), I discovered that the homing performance in the presence of overhead IR lamps was marginal when the robot’s offset distance from the wall was more than about 50 cm.

Sunshade, oblique view

Sunshade, side view

Sunshade, front view

Apparently the IR interference was causing the robot to not respond to the IR beam until too close to miss the outer lead-in rail.  This issue was explored in an earlier post, but I have repeated the relevant drawings here as well.

 

Tilted gate option. The tilt decreases the minimum required IR beam capture distance from about 1.7m to about 1.0m

Capture parameters for the robot approaching a charging station

When the robot is ‘cruising’ at more than about 50 cm from the tracked wall,  the IR interference from the overhead lamps prevents the robot from acquiring the charging station IR beam until too late to avoid the outer lead-in rail, even in the 13º tilted rail arrangement in the first drawing above.

 

So, what to do?  I am already running the IR LED at close to the upper limit of the normal operating current, so I can’t significantly increase the IR beam intensity – at least not directly.  I can’t really increase the size of the ‘sunshade’ dramatically without also significantly affecting the IR beam detection performance.  What I really needed was a way of increasing the IR beam intensity without increasing the LED current.  As it turns out, I spent over a decade as a research scientist at The Ohio State University ElectroScience Lab, where I helped design reflector antenna systems for spacecraft.  Spacecraft are power and weight limited, so anything that can be done to improve link margins without increasing weight and/or power is a good thing, and it turns out you can do just that by using well-designed reflector dishes to focus the microwave communications energy much like a flashlight. You get more power where you want it, but you don’t have to pay for it with more power input; the only ‘cost’ is the insignificant added weight of the reflector structure itself – almost free!  In any case, I needed something similar for my design, and I happened to have a small flashlight reflector hanging around from a previous project – maybe I could use that to focus and narrow the IR beam along the charging station centerline.

LED flashlight reflector

So, using my trusty PowerSpec PRO 3D printer and TinkerCad, I whipped up an experimental holder for the above reflector, as shown below

Experimental 3D-printed flashlight reflector holder

Reflector mounted on experimental holder

IR LED mounted on reflector

A couple of quick bench-top tests convinced me I was on the right track; At 1m separation between the IR LED/reflector combination and the robot, I was able to drive the robot’s phototransistors into saturation (i.e. an analog input reading of about 20 out of 1024 max), where before I was lucky to get it down to 100 or so.  However, this only happened when I got the LED positioned at the reflector focal point, which was tricky to do by hand, but not too bad for a first try!

Next, I tried incorporating the reflector idea into the current charging station IR LED/charging probe fixture, as shown in the following photo. This was much closer to what I wanted, but it still was too difficult to get the IR LED positioned correctly, and this was made even more difficult by the fact that I literally could not see what I was doing – it’s IR after all!

New reflector and old charging station fixture designs

However, the reflector focusing performance should be (mostly) the same for IR and visible wavelengths, so I should be able to use a visible-wavelength LED for initial testing, at least.  So, I set up a small white screen 15-20 cm away from the reflector, and used a regular visible LED to investigate focus point position effects.  As the following photos show, the reflector makes quite a difference in energy density.

Green visible LED, hand-positioned near the focal point

Pattern without the reflector

Next, I used my Canon PowerShot SX260HS digital camera as an IR visualizer so I could see the IR beam pattern. As shown below, the reflector does an excellent job of focusing the available IR energy into a tight beam

IR beam visualized using my Canon PowerShot SX260HS digital camera

IR LED, without reflector

Next, I made another version of the reflector holder, but this time with a way of mounting the LED more firmly at (or as near as I could eyeball) the reflector focal point.

Reflector holder modified for more accurate LED mounting

With this modification, I was able to get pretty good focusing without having to fiddle with the LED location, so I set up some range tests on the floor of my lab.  With LED overhead lighting (not incandescent), I was able to get excellent homing performance all the way out to 2m, as shown in the following photos and plots

Range testing the IR reflector in the lab. Distance 2m

IR Detector response vs orientation at 2m from reflector, in the lab

IR reflector beam pattern at 2m, visualized using digital CCD camera

After this, I decided to try my luck again out in our entry hallway, with the dreaded IR interference from the overhead lighting and/or sunlight.   I installed the lead-in rails in the ’tilted’ arrangement, and then performed a response vs orientation test with the robot situated about 2.5m from the IR LED/reflector assembly, in natural daylight illumination with the overhead incandescents OFF.  This produced the curves shown in the plot below.

Robot response vs orientation test setup, 2.5 m from tilted lead-in rails & LED/reflector assembly

IR detector response vs orientation test, 2.5 m from IR LED/Reflector assembly

In the above Excel plot, the individual detector response minimums can be clearly seen, with minimum values in the 200-300 range, and off-axis responses in the 800-1000 range.  This should be more than enough for successful IR homing.

After seeing these positive responses, I ran some homing tests starting from this same general position.  In each run, the robot started off tracking the right-hand wall at about 50 cm offset.  One run was in daylight with the overhead lights OFF, and another was in daylight with the overhead lights ON.  As can be seen in the videos below.

Both of the above test runs were successful.  The robot started homing on the IR beam almost immediately, and was successfully captured by the lead-in rails.

So, it is clear the reflector idea is a winner – it allows the robot to detect and home in on the IR beam from far enough away to not miss the capture aperture, even in the presence of IR interference from daylight and/or overhead incandescent lighting.

Next step – reprint the IR LED reflector holder with the charging probe holder included (I managed to leave it out of the model the last time), and verify that the robot will indeed connect and start charging.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Charging Station System Integration – Part II

Posted 07 April 2017

After getting the wall-following mode re-implemented in the ‘new-improved’ Wall-E2 operating system, I re-enabled the IR homing part of the code, only to discover that Wall-E2 thought it could see the IR homing beam everywhere, in the atrium, even though the IR homing LED wasn’t even in the room (and was turned OFF, besides)!  This didn’t make a whole lot of sense, until I realized Wall-E2’s sensors were ‘seeing’ IR from the overhead floodlamps.  I confirmed this by having my ‘lovely assistant’ wife turn the atrium lights on & off and monitoring the detector outputs.  Same thing for the entry hallway (see data below)

I thought I had solved this problem way back when I first started working with the IR detection/homing idea back in October of last  year.  In that initial post where I investigated the OSEPP ‘IR Light Follower’, I found I had to turn OFF the LED track lights in my lab in order to avoid swamping the detector array.  Over the next month or so this project evolved into a custom designed array of Oshram SFH309FA-4 phototransistors (see http://fpaynter.com/2016/11/ir-light-follower-wall-e2-part-vi/), and as part of this I discovered that the Oshram devices weren’t at all sensitive to the LED track lighting in my lab.  From this I concluded (erroneously as it now turns out!) that I didn’t need a ‘sunshade’ at all, which allowed for a much simpler installation on the robot (see http://fpaynter.com/2016/11/ir-light-follower-wall-e2-part-vii/).  Finally, when this module was transferred from the 3-wheel test bed to the Wall-E2 and combined with the charging status display panel, we arrived at the ‘final’ arrangement shown in the following photo

IR detector module (red) shown beneath charging status display panel (blue)

This worked great for all my in-lab IR homing tests with my all-LED overhead track lighting, but as soon as I started testing out in the rest of the house, the overhead incandescent and halogen lamps swamped out the detectors. So, it was back to the drawing board – again :-(.

The first thing I did was to confirm that the IR detectors were indeed getting swamped by the overhead lighting, and that it was possible to prevent this by some sort of shielding.  I started with a wrap-around cardboard shield that completely covered the IR detector module, as shown below, and placed the robot on the floor of the entry hallway in a normal ‘wall-following’ position

Sunshade V0. Not very practical, but does set the baseline for the rest of the tests

Test position for 07 April 2017 sunshade tests

 

With this setup, Wall-E2 was pretty much deaf to the overhead lamps, showing no reaction to cycling the lights.  Of course, this configuration would also completely prevent it from detecting the charging station IR beam, but….

Next I modified the above V0 cover to allow a bit more visibility, as shown below:

Sunshade V1 oblique view

Sunshade V1 front view

This version is still a bit too restrictive for normal IR beam detection/homing, but was worth a shot for testing purposes.  With this setup, the overhead lighting is noticeable, as shown below.

Sunshade V1 at sunshade test position. Lights ON four times for 5, 5, 5 and 10 sec

As can be seen from the plot, the V1 sunshade responds to the overhead lamp IR with an average A/D reading about 700 out of 1024.

Next, I modified the sunshade again so that it would just allow the IR detector module to ‘see’ straight ahead, on the theory that that would be the minimum requirement for successful IR beam detection/homing.  With this setup, the overhead lamp response was stronger, but still not completely overbearing; the IR detector response to the overhead lights averages A/D values of about 600 out of 1024.

Sunshade V2 oblique view

Sunshade V2 front view.  Note IR detectors visible from directly in front

IR detector response to overhead lamps. ON three times for 5 sec each

When I ran a homing test with the V2 sunshade in my lab (with LED overheads, not incandescent), the robot homed successfully from about 1 m away, with the following IR detector/homing performance

In-lab (LED overhead lighting) charging station homing performance with V2 sunshade

In the above homing test, the IR detector values started out at approximately 900, 200, 450 and 750, respectively.  This means I could set the IR beam detection threshold at, say, 400 and still have a 200-count noise margin in both directions (200 down from the overhead IR flooding value, and 200 up from the typical 1-meter IR beam intensity).  From the movie it is obvious that the minimum IR reading is switching back and forth between at least two detectors, so I think it is safe to say that IR homing would occur even in the presence of a 600 unit noise level, as the 200 or lower reading switched between detectors.

Next, I moved the charging station into the entry hall so I could test IR homing performance with the overhead lights on and off.  My prediction was that Wall-E2 should be able to home successfully in both cases.  For the test, the charging station lead-in rails were oriented in the preferred ’tilted’ orientation, as that should give the best homing performance, as shown in the photos below:

Hallway IR homing test setup

Robot shown in captured position. Note lead-in rail ’tilt’ relative to the wall

I made three runs; Lights ON, lights OFF, and Lights ON, as shown in the three video clips below:

 

As can be seen in the videos, Wall-E2 successfully homed to the charging station with the overhead lights OFF, but not with them ON – bummer!

So, further testing will be required to determine the particulars of the two failed runs, and what – if anything – can be done about it.

After moving my laptop out into the hallway so I could capture telemetry from the robot while also filming the runs, and checking everything out, I made two successful IR homing runs – one with the overhead lights ON, and another one with them OFF.  I captured telemetry from both runs, and was clearly able to distinguish between the lights ON and OFF scenarios.  The videos and the telemetry plots are shown below:

08 April 2017 Hallway Test2 with V2 Sunshade – Lights OFF

08 April 2017 Hallway Test2 with V2 Sunshade – Lights ON

From the above plots, the lights ON & OFF conditions are readily recognizable.  In the ‘OFF’ condition, the ‘background noise’ is at about 600-700, and the IR beam is at 100-200.  In the ‘ON’ case, the noise level is higher (lower count), at about 150-250, but the IR beam is lower too – around 50-150.  I guess this makes some sort of sense, as the IR energy from the charging station beam is a separate, additive source relative to the overhead lighting.  Also, both plots show good motor response curves – the left & right motor speeds are obviously being adjusted rapidly in response to IR detector changes.

So, at this point I’m pretty convinced that the V2 sunshade is working, so I plan to print up a permanent version that will (hopefully) simply slide on to the front of the existing charge status display panel.

Stay tuned!

Frank

 

 

 

 

 

Charging Station System Integration – Part I

Posted 29 March 2017

In my last ‘Charging Station’ post, I had arrived at the point where Wall-E2 could reliably home in on an IR beam, dock with the charging station power probe, switch from ‘run’ to ‘charge’ mode, and then after a 10-second delay (for testing purposes only – the ‘production’ version will wait for the ‘Finished’ signal from both battery stacks before disconnecting) disconnect and back away from the charging station.  At this point, it is time to start the process of incorporating Wall-E2’s new charging super powers into the overall system design (or maybe integrating the overall system design with Wall-E2’s new charging super powers).

In my 11 March 2017 ‘Charging Station Design, Part X‘ post, I described what I thought were the major tasks remaining, as follows:

  1. Reconnect and test the LIDAR and ping sensor hardware; this will be required to test wall-following and the charge station avoidance sub-mode
  2. Reprint the charging station fixture with 5mm more height
  3. Set up the full lead-in rail arrangement and confirm proper homing/engagement, along with proper dis-engagement, and proper avoidance when the battery isn’t low.
  4. re-implement and test the wall-following code in the new structure, as MODE_WALLFOLLOW.  This should be just a bunch of cut-and-paste operations.
  5. test the various ‘normal’ state transitions; wall-follow to IR homing to charge monitoring to wall-following
  6. test the wall-follow to IR homing to charge station avoidance transition.
  7. fully test the end-of-charge scenario.

Of the above tasks, the first three items are essentially complete; It is now time to address the last 4 items, starting with re-implementing the wall-following feature as part of the new software structure.  Contrary to my original thoughts, I no longer expect this to be a ‘bunch of cut-and-paste operations’ as my understanding of the overall system has improved considerably since I started the charging station work some four months ago.  Instead, I plan to start with the software structure proposed in my Wall-E2 Operating Mode Review post from 06 March 2017, as shown below:

The wall tracking structure is actually pretty simple, with the magic occurring in the details of the algorithm for tracking the selected wall using the appropriate ping sensor.  The current tracking algorithm is essentially a hand-coded version of a PID engine, with PID = (0,0, K), where K is a ‘MOTOR_SPEED_ADJ_FACTOR (currently set to 40).  Here’s the relevant code

LSPDn = LSPDn-1 + K * (Dn – Dn-1); RSPDn = RSPDn-1 – K * (Dn – Dn-1)

Based on the experience gained from using the PID engine for IR homing, I’m fairly confident it should work for wall tracking as well.  However, using the PID engine requires that a target setpoint be defined – in the case of wall tracking this would be a target offset distance from the wall being tracked.  In the current non-PID algorithm, this isn’t required – the robot simply tries to keep the distance constant, with no regard to the actual value.  I *think* I can handle this by dynamically setting the PID target value to the smaller of the initial left/right ping values when the robot first enters wall tracking mode.  We’ll see….

April 05 2017 Update

I reconnected the LIDAR and sonar sensors, and re-implemented the wall-following code in the MODE_WALLFOLLOW case block of the new software structure.  I decided to stay with the homebrew tracking algorithm at the present, not wishing to introduce any more new variables than necessary.  To test the new arrangement, I made some wall-tracking runs in our atrium, as shown in the following video.

And here is a screenshot of the plot of the relevant wall-following telemetry data

Relevant telemetry data from the first wall tracking test in the atrium

As can be seen, the robot tracks the right-hand wall pretty faithfully at a pretty constant distance (about 45-50 cm in this case).  From my earlier efforts testing with IR homing to the charging station I showed that the robot would have to capture the IR beam at about 1.7 m out with the charging station lead-in rails aligned parallel to the wall, or about 1 m out with the rails angled away, in order to be successfully captured by the lead-in rails.  Now that I have wall-following re-integrated into the operating system, the next step will be the fifth item above, namely “test the various ‘normal’ state transitions; wall-follow to IR homing to charge monitoring to wall-following”

Stay tuned,

Frank

 

 

 

PowerSpec 3D PRO Build Plate LED Lamps

Posted 03 April 2017

In the year or so since I started printing with my trusty PowerSpec 3D PRO (Microcenter clone of the FlashForge Creator PRO), I have struggled to see what was happening in the first few layers of problem prints.  The extruder/feed motor assembly is so big that it blocks most of the sight line to the build surface.  What is left is a very shallow viewing angle, which is mostly shadowed by the print assembly.  Over time, I have found that hanging one of my goose-neck LED bench lamps over the top edge of the cabinet on either the left or the right side gave me a much better view – the restricted viewing angle was unchanged, but a lot more light was thrown on the subject, literally.  However, this was an inelegant solution to say the least, as the lamp was apt to fall off the printer at the most inopportune times.

As usual, I kept thinking of ways to improve this situation, and finally came up with the idea of seeing if I could find some small LED work lights that I could permanently attach to the printer.  After some Googling around, I came up with a 2-lamp LED Auxiliary Light Kit (p/n DRL-CW3-SM-9) offered by superbrightleds.com for $24.95/pair – nice!

DRL-NW3-SM 12-24V 9W Auxiliary LED Light Kit (2 lamps)

After some fiddling around and some goofs, I arrived at an arrangement I liked.  The lamps are mounted at the top of the cabinet and are pointed down so they illuminate the entire build surface, but are physically offset enough so the plastic top closure assembly can still be removed and put back on without problems (this was one of the goofs – the first arrangement I tried made removing/replacing this piece very tedious).  The shots below show the setup.

To power the lamps, I used a ‘Mean Well’ APC-25-1050 24VDC constant-current LED driver supply from ledsupply.com.  This is an incredibly cheap switch-mode power supply that delivers 1.05A constant current, with an output voltage from 12-24V.  This matched well with the 12-24V input spec for the LED auxiliary lamp, so I was in good shape.   I had a couple of these hanging around from a previous project where I converted a crappy Lowe’s LED clip-lamp to a robust high-power LED lamp, so I got a two-fer (didn’t have to research/buy a power supply, and used up some of my excess stock – yay!).

For control, I decided to use individual power switches, mounted at the rear left & right of the cabinet.  I had some small SPDT power switches available, so I printed up a nice little housing with integrated zip-tie anchor points for cable strain relief, and then ran a common power run down the back center of the cabinet to the power supply mounted on the back of the cabinet, below the right filament spool.

The following photos show the arrangement, and the build plate illumination during the first few layers of a test print.  Enjoy

Old vs New. Hanging bench lamp in foreground, new permanently mounted LED lamp in background

New LED lamps in action. Note the build plate illumination.

View from back of printer showing both LED lamps and ON/OFF switches

Mean Well APC-25-1050 1A constant-current LED power supply mounted at rear bottom of the cabinet

Build plate illumination with both LED lamps ON

Test print with both LED lamps ON

Test print with both LEDs OFF

View from top during test print, both LED lamps ON