Monday, May 13, 2019

Should Robots Talk Whenever They Want?

A robot’s life is hard, full of compromise. A robot that desires “independent living” and the unfettered ability to talk, sing, buzz and beep needs an always available audio system. Of course the humans are not going to be agreeable to hearing a shouting robot in the middle of the night, but a smart robot can be selective about when to talk - if the audio system is always on!
An audio system can draw 40-50 mA of power, and power is a prized commodity for a robot. Talk may be cheap, but power - a robot needs to manage the “juice” wisely. For my GoPiGo3 robot, Carl, 45ma of opportunity to “talk whenever” means the loss of one hour of play time (6+ hours instead of 7+ hours). Carl must spend 2-3 hours on the charger after every play time.
Previously, Carl had a rechargeable speaker that required a human remember to turn it on, turn it off, connect and disconnect a separate charging cable, but the speaker did not draw any power from the batteries. Now Carl has a USB powered speaker that is always on, but draws power from the batteries.)
A robot doesn’t need to talk very often, but it does need to be able to talk whenever it wants.
ps. Carl’s Python speak module has three levels of talking, whisper(), say(), and shout(). He is allowed to whisper anytime he wants, but say() and shout() check quietTime() before blurting out his wild thoughts.

Friday, July 29, 2016

Robot Resurrection: Another Dumb Robot

One year ago today, I wrote here "Memories Of Limping Robots", in which I expressed feeling that my 15 year old robot, Pogo, was in need of a new brain.

Pogo got his "new brain", and in fact is now sporting an "even newer brain" that is ten times more powerful than his "new brain".  The possibilities for becoming a "Smart Robot" are limited only by the fact that he/it only has me writing programs.

Pogo has not completed his resurrection, but is close.   He is in the middle of a nervous breakdown at the moment, which has brought his progress to a screeching halt.

Pogo's new features:

  • Raspberry Pi 3B processor with built-in WiFi, Blu-tooth, 1GB memory, and four cores at 1.2GHz clock.
  • Mikronauts.com Pi Droid Alpha interface expansion card with 16 digital I/O, eight 12-bit analog to digital conversion channels, Dual H-bridge motor driver, and separate chip, servo, and motor power paths.
  • HC-SR04 Ultrasonic Distance Sensor
  • GP2Y0A60SZLF Infrared Distance Sensor
  • 5 MegaPixel Color Camera
  • Tilt/Pan SG90 Servo controlled sensor platform (UltrasonicDist, IRDist, Camera)
  • ACS712 Current sensor
  • Battery Voltage sensor
  • Push Button On/Off Power Switch
  • Pololu Step-up/down 5.25V 2A regulated switching power-supply
  • Audio Speaker output (for Text-To-Speech)
  • USB microphone (PocketSphinx speech recognition)
Pogo's prior features connected to the new brain and interface:
  • Differential drive 6v 1.2A metal geared motors
  • 32 division wheel encoders
  • Full Skirt Bumper (six directions: Left, Front, Right, LeftRear, RightRear, Rear)
  • 6 C-cell 5000 mAh NiMH rechargeable battery 


I have reproduced the RugWarriorPro base library in Python, and created Python class interfaces for all the new hardware.  

So far only two RugWarriorPro behaviors have been programmed: 
  • YoYo which simply drives forward two feet then backward two feet, and 
  • Wimp which chooses an escape direction (spin if needed), tests for an obstacle blocking the escape direction, then moves six inches "away" from the bump (or turns until no obstacle blocks escape, then moves).
The "even newer brain" was an award from element14.com for testing Speech Recognition, in which my tests demonstrated that the Raspberry Pi 3B can perform real-time, language model, speech recognition using only one of the four processing cores.  It will be exciting to create a speech interface to and from the robot, (once the brain transplant is complete).

At the moment, I am diagnosing a power supply shorting issue, and bump detection has stopped working, but I hope to soon begin "Creating A Smart Robot."

Wednesday, July 29, 2015

Memories of Limping Robots

I am sometimes haunted by memories of my robots, past and present.

My former "perfectly good" robots were sold or returned when they proved to be inadequate, or inconvenient for my circumstances.

My present robot is fifteen years old this month and let's face it - "stupid and limping".  I feel guilty for not switching it/him to run mode, and then I feel stupid for feeling guilty.  I feel strangely uncomfortable when I contemplate replacing the entire "brain board", knowing that at best I can transform my robot into a smarter, stupid robot with a different limp, and no family but me.

This is Pogo:

Friday, October 10, 2014

Getting The Shot - An Eclipsing Story


The day before the lunar eclipse, I wrote down the altitude/azimuth for various times at the moon rise the night prior and for the beginning and full obscuration of the eclipse for my south Florida location.
The moon rise time came and I set out to scout my observation site, and check how my iPhone compass and clinometer worked to estimate where the moon would be during its "bloody" descent.
Not only were the clouds totally hiding the moon rise in the east, but the full eclipse was to occur only 4 degrees above the western palm tree littered horizon.  I had chosen a viewing site in the middle of a golf course with a nice lake extending almost to the horizon, and was imagining a phenomenal mirror shot of the giant full moon.  With the moon totally hidden, and the compass reading varying from north-east to south-east when pointing at where I remembered seeing the moon rise on other nights, I was starting to question if this whole adventure was really ridiculous - Florida for astronomy?
Late that night, I headed to bed. Perhaps my trusty Panasonic Lumix FZ200 would get some use in the morning.  I had mounted the camera to my tripod, and attached an Oly TCON-17, packed some cookies and gathered a folding chair.  I was ready.
The alarm went off at 04:45 and I ran to a west facing window.  Sure enough, high and bright in a crystal clear sky, I could see the moon.  I prepared my breakfast and reviewed the plan:  shoot with and without the teleconverter, keep the ISO at 200 or below, various f/stop from wide open to f/5.6, try +/- 1,2,3 bracketing, stabilization off, shoot raw, with two second timer, some shots at full tele/max resolution (12MP,24x), some at 48x, tiniest spot metering, and try AFS and manual focus.
I loaded my backpack and folding chair to my back, shouldered the tripod-ed camera, and set out to walk to my observation point.  In the darkness, I heard heavy footsteps approaching behind me.  Unimaginable to me that someone was jogging at 5:30 in the morning, and with such energy.  As a night owl, I have to be reminded periodically that some people get up that early every day.  There were dog walkers, and several exercise walkers.  It felt a little awkward being out with my camera and backpack.
I had timed my setup with the start of obscuration and started shooting immediately when I arrived.  I forgot completely about the plan to sit for the 90 minute shoot.  The moon was up about 20 degrees above the horizon, and above the cloud layer waiting at the horizon.  It was really beaming, and even with -2EV I was getting 500th of a second exposure.  This seemed good since I knew the moon was moving in the sky and even on the tripod, it is recommended to shoot around 1/(600x1.7).
I checked my first shots and realized that AFS was not getting a reliable focus.  I switched to manual focus but was having difficulty peaking the focus.  I had expected that setting the focus at infinity would be optimal, but the best focus was actually quite far from infinity.
Using the AES lock I varied the metering spot on different shots from in the dark obscuration area, to on the terminator, and to various features in the illuminated area.
By the time I would get my next shot dialed in, the moon usually had fallen partially out of the frame so I spent a lot of time playing with the tripod.  It isn't a cheap tripod, but not a great model either.
As the eclipse progressed to nearly half coverage, the moon had was starting to descend into the first of the clouds.  Surprisingly, I was able to continue shooting but the exposure times started to get worrisome.  The moon was really racing along.
As the time for totality approached, the moon was down to 4 degrees above the horizon and really deep into the cloud layer.  The exposure meter was predicting 8 second exposures, so I decided to raise the ISO to 320, open the lens to f/2.8, and resign myself to missing "the big moment".  Indeed the long exposure has motion artifacts from the earth/moon procession so that no amount of sharpening and definition sliders can bring the crisp, red, full moon to satisfaction.
Before I could even dial in another shot, the moon was gone.  I couldn't try the magnificent mirror masterpiece I had envisioned.  The 90 minute shoot was a blur in my mind as I packed my gear.
I don't have a way to remove the chromatic aberration of the TCON since I use iPhoto for my processing.  (Never did get comfortable enough with SilkyPix.)  I processed most of the shots with full highlight recovery, full highlight darkening, around 50% increased definition and about 25% sharpening.
The 12 "keepers" were up on Flicker, now lost to the bit bucket.


Monday, September 22, 2014

Running Update - symmetric sympathetic and parasympathetic response

Update after a month of twice weekly 3-4.5k in intervals:

Supposedly I should be able to do a "Long, Slow Run" staying in Zone 3 of Heart Rate Reserve (146-160) but walking fast doesn't get my heart up high enough, and running at my slowest possible pace will bust the Zone 3 limit within a minute.  

I did a Zone 3 run/walk for 5k and ended up running 16 short intervals. My heart rate went up at 12 bpm each time I started running, and would fall at 12 bpm when I started walking. I guess that shows symmetry in the sympathetic and parasympathetic response. Supposedly a large, quick response to stress is good, but my recovery is only borderline sufficient.



After a year of running, I have not seen any change in the recovery rate, Sometimes, because my heart rate will go up a beat or two right after I stop running, the 1 minute recovery will be only 5-8 beats but the 2nd minute recovery will be 12-14 bpm.

Monday, September 1, 2014

I Sense, Therefore I Feel Moody (Behavior Management in Robots)


(repub - original site went under.)


I Sense, Therefore I Feel Moody
June 30, 1999
Alan McDonley



In "A Model for Mood-Based Robot Behaviors" ( http://home.earthlink.net/~johncutter/rep_mood.htm - link no longer exists), John Cutter describes a nine state model for behavior selection based on two variables called mood and comfort. That model served as a starting point for additional thoughts on robot behavior selection.

This paper presents concepts linking senses to feelings by preferences, linking feelings to behaviors by mood, linking behaviors to goals and linking goals to preference selection.

I Sense
An interacting robot will consist of a suite of sensory inputs and output modalities. Sensory inputs generally map measurements of environmental conditions that are orthogonal. Light intensity, Sound pressure, motion detection, nudge detection, linguistic information, time, day and temperature are each orthogonal (strongly independent). Light, sound, time and temperature are continuous. Motion and nudge are discreet. Day is discreet and contiguous.

Linguistic input can be discreet or contiguous and can be a source of multiplexed input. Recognized words (either spoken, tones assigned to words, or morse code) can be chosen to convey discreet commands (dance|sing|silence) but can also convey contiguous values such as speed (slow-normal-fast, or silent-soft-normal-loud). Combinations of discreet and contiguous are possible with linguistic input sensors (dance slow | sing loud). Input of named combinations of values,such as "homebase" for an X-Y pair, or "quietly" for soft singing, slow motors, no alarms, becomes possible with a linguistic input sensor.

I Feel
Reaction to sensory input can be called feelings. The robot must be programmed with preferences, either static or dynamic, to decide how it "feels" about sensory input values. 
The preference allows the robot to convert a continuous sensory input into good, neither good nor bad, or bad "feelings" or discreet sensory input into good and bad "feelings"
Preferences can be natural or imagined. Natural preferences come from base desires such as self protection or knowledge preservation. Imagined preferences come from artificial decisions induced for the purpose of creating interest such as a preference for specific sound levels that might indicate the presence of humans to interact with.

A robot should have a natural preference for cooler temperatures because it lengthens the life of its circuitry, but cold temperatures might limit its off-base excursion time. Thus cold is bad, hot is bad, but some intermediate range is good, and some wider band is neither-good-nor-bad. Note that the sensor range is continuous and linear, the feeling range is contiguous and parabolic (bad-ok-good-ok-bad).

Light intensity and light transitions can be used to detect preferable conditions. In general, room lights being on means people may be nearby, ok to make noise, burglars are unlikely. Thus the robot might be programmed with an imagined preference to the room lights on condition. Of course, if the robot has a "loner" personality, then perhaps it would have an imagined preference to avoid rooms with the lights on. If the owner has expressed anger toward the robot, the robot may change its imagined preference for human contact temporarily by establishing a preference for dark rooms. A mapping of light intensity to feeling is, thus, dependent on a dynamic preference. In general the more light the better, but the absence of light is not necessarily bad.

Light level transitions can also be analyzed by preferences. The transition from room lights off to room lights on could be preferable, while the transition from on to off might be considered less preferable. Transition from dark to some light but not room light level might indicate dawn, and nearing time to awake the owner. Being needed is a preferred condition, thus a preference for light above dark. Likewise, rapid transition to less than room light level, followed by rapid transition to dark might indicate a burglar with a flashlight – a less than preferable condition.

Sound pressure and pressure duration can be used to detect danger, angered humans, unusual circumstances, music, speech, and other aural conditions. The robot can have imagined preference for music if it knows how to dance (detects a beat and moves in time to the beat). Of course a jack hammer pounding outside the house might cause the robot to dance in an empty room, but the robot will be "happier".

Motion detection can feed an imagined preference for people, but if the robot knows that the house should be empty, a preference to be alone would be natural. Being a discreet sensor, motion detection can only be evaluated to good or bad in relation to the preference.

Nudge detection can be discreet or contiguous by counting nudges within a time period. When moving, the robot might have a natural preference to not experience nudges from running into walls. When standing still, nudges probably mean a human is trying to communicate – an imagined preferable condition.

Linguistic information would usually be good, but certain words or information could be indications of anger so these words would not be on the prefer list. If the robot decided to dance and was told to stop dancing, the words might be lower on the prefer list. The measurement of linguistic information with respect to natural and imagined preferences is more complex than simple mappings, but great richness of feelings are possible from linguistic information.

Having a time and day of the week clock is very useful to a robot. Knowing that scheduled interactions are near allows the robot to be prepared by being fully charged and position certain. Times close to scheduled interactions could be more preferable than times farther away from being needed or farther from human contact. Day time might be imagined to be preferable than night times. If the robot has memory of times and days of human contact, with an imagined preference based on day of highest frequency of human contact, the robot could express a preference for the weekend or a family member being off from work on the same day every week.

Feelings can be "caused" or influenced by a single sensor, one of multiple sensors or only by a collection of sensors. Therefore feelings can be orthogonal if dependant on distinct collections of orthogonal sensors. The feeling of security (driven by light, sound, and motion) is not totally orthogonal to the feeling of companionship (driven by light, sound, motion, linguistic info, or nudges), but companionship and feeling hot are orthogonal.
 

I Have Moods
Moods are less specific terms used to characterize exhibited behaviors. Behaviors are not chosen because of mood, but mood can describe the interaction of unrelated feelings in behavior selection.

When all the robot’s feelings are good, the robot would be expected to be in a very good mood. Thus the robot’s behavior in the presence of a less than preferable sensory condition might be softened by other unrelated good feelings.

When all the robot feelings are bad, we would understand the robot being in a bad mood. Thus the robot’s behavior in the presence of a less than preferable sensory condition might be exaggerated by other unrelated bad feelings.

When a majority of feelings are good, can the robot still be considered to be in a good mood? Do behaviors need to be chosen with different weighting for related feelings from unrelated feelings?

Happy is the most desirable mood. When the majority of feelings are good, we would like to think that we are happy. For a robot, this could be demonstrated by tolerance for non-preferable inputs or by more demonstrable communications of a happy nature.

Unhappy is a mood where a majority of feelings are less than preferable. This mood would be characterized by selection of behaviors intended to directly correct the most important bad feeling or to communicate the bad feeling in hopes that a human will correct the situation.

Sad is sometimes associated with sensing a non-preferable condition that we are unable to influence for the positive. Unrelated behaviors might be exaggerated to communicate that the robot feels unable to fix the problems.

Depression is, clinically, an unwarranted sense of doom. Being highly contagious, it is wise to avoid depressed robots.

Playful is a mood where happiness is demonstrated and a reaction to the robot’s happiness is desired. Playful could be characterized by selecting and possibly exaggerating behaviors related to humans.

Cutter includes normal as a mood in his mood matrix. Robots might be said to have normal or abnormal reactions, but what defines a normal mood for a robot? This would seem to be a mood where random behavior selection would be most expected.

Other moods can be used to describe the specific influences of unrelated feelings in the behavior selection process

I Have Behaviors
Behaviors in a robot serve many purposes. Behaviors can be used to directly meet goals and also to communicate with humans. Direct behaviors can attempt to directly influence a specific condition, while indirect behaviors are communications to humans of an indication, to others, of feelings or mood.

I Have Goals
Goals can be static or dynamic and can be prioritized. Goals influence preferences. Preferences influence feelings. Feelings influence behaviors. Moods describe behavior selection adjectives. Behaviors influence goal achievement.
Should a robot have a goal to maximize happiness? What benefit to the owner is a maximally happy robot?

Summary
This discussion has shown a method for giving meaning and purpose to robot sensory inputs. Much investigation in the area of robot feelings and moods is needed to prepare for the generation of multi-dimensional sensing and expressing robots that appear to be near at hand.
© 1999,2009 Alan McDonley. All rights reserved.

Thursday, August 28, 2014

Very High Max Heart Rate


Interested in what can be learned, if anything from monitoring my HR during runs.

I am 61 years old, 73.5kg 179cm / 162lbs 5' 10.5", running about two 5k sessions a week for the last year until a tennis injury knocked me off my feet (torn gastrocnemius and 2 fractures on front of shin).

My resting heart rate is between 50 and 59 depending on how much sleep and stress level.  For the last 10 years I have been using 188 as my max HR based on a conconi treadmill test estimation.

Before the injury my maximum exercise HR was usually between 170 to 178:

 Before Injury: Max exercise HR of 170 during weekly 5k run

Today I started running again again (1k walk, 1k run, 2k walk, 1k run, 0.5k cool down walk) and noticed that my HR was up higher than previously seen.  It was a bit hotter today at 95 deg. F, but I drank continuously and felt very good during and after the run.


Two and half months later:  Maximum exercise HR of 183 and 186 during 1k intervals

I was thinking that I was running my 5k at around 90% of my maxHR, but today's run would seem to indicate that my MaxHR is actually much higher for me to be able to run at 186 for these intervals.

Anything else I can learn from these data?