Sunday, March 13, 2016

Making an Audiobook

Once my book K2 Virus is edited, I wanted to have an audiobook to accompany it. In the meantime, I decided to practice on a shorter sci-fi book in my portfolio that I'm promoting in April--Void Contract. I started by listening to the great training videos from ACX on the audible website. Based on advice from my friend Weston, I dropped some change on a decent cardiac USB microphone. The one on your PC will make you sound tinny. I set up my office with the script at eye level and the mic the proper distance from my mouth. Make a sign-language J with your thumb and pinky extended to find a good starting range. In my first chapter, every P spiked maximum volume (called a plosive), and I had to adjust the height. Buy a pop filter. Office Depot and Walmart have them cheap.

The next thing I did was get a cover from the Cover Counts, because CD covers are square, not 6x9.

Most of the commentary I've seen on the Internet shows you how to do this with the free Mac product "Garageband." I downloaded the version on my iPad, but this is a toy that can't do audio mastering. All the PC versions used emulators and looked like virus/spam bait. No thanks. I decided to start my adventure using a great free recording and mastering tool called Audacity. You'll need the LAME encoder add-on to do MP3s.

Make sure you're recording in mono not stereo. You'll need to play around with it to get the right settings. I had to amplify the recording too much when I used 50, and 80 resulted in too many peaks exceeding Amazon's -3 db limit. I settled on 64 percent. Write down whatever you choose so that voice-overs later will be consistent. The way I work best is to record continuously for the whole chapter, which takes an average of half an hour. When reading, be consistent. Don't rush. If you make a mistake, don't get flustered. Take a breath or a drink, and start the phrase again. Save the raw material as an MP3. This is very important--save the originals. If you goof up and truncate a word or over-filter something, the original provides a way to recover without longer periods of re-dubbing.

I can comfortable do do five chapters in an afternoon. My record is nine, but doing alien voices will make my voice too rough.

Now, the magic begins--transforming a hot mess into art. This is what the waveform looks like from the start of chapter 4. Note that I click the magnifying glass and enlarged the scale until I could see individual seconds on the time bar.
See the small bumps on the left? It's noise. Around my house, it's the refrigerator vibrating through the wall. I turn off the heat when I'm working, but the neighbor two houses down was playing with a skid steer. The new mic picks all that up! So the first step will be a high-pass filter somewhere in the 80-100 range. I did a spectral analysis and found that the bulk of the noise was near the 90 Hz area.  I entered Effect/High Pass Filter and typed in the limit of 90 Hz with a roll-off of 48 db. If you have problems with whistling S sounds, you can use a Low Pass Filter at 3000 Hz with a gentle roll-off like 12db, but I don't apply this unless it's necessary. Amazon doesn't recommend low pass filters under 16000 H

As you can see, this got rid of most of our problem. I was feeling pretty good until I read that Amazon demands nothing above the -60 db level. So let's shift scales to db and take a look.
Pull down on the black triangle next to the name of the track pick Waveform Db.


Wow, that's hairy, and way over the requirements. Next, we adjust with Effects/Noise Reduction. Be careful with this tool because too little won't help and too much will make you sound like a robot. Highlight just the part between the words, and when prompted, click the Get Noise Profile button. Every chapter is a little different. Once you have the profile, hit CONTROL A to highlight the entire chapter. Then choose Effects/Noise Reduction again. This time, click the OK button to actually apply the filter.


The results are as smooth as pouring Nair in shampoo. The noise that's left falls into two main categories. The small ovals in this mode are my breathing. If you aren't sure, highlight this area and click the play button for this zone. With experience, you can spot these with ease, The only way to get rid of them is to select Generate/Silence for the highlighted area.
The tall narrow spikes are the smacking sound my lips make when I open my mouth.



During cleanup, I put in headphones and listen to the chapter. I wipe out the noise as I go, one screen at a time. As it plays, I listen for two types of mistake: the ones I repeated to get right, and the ones I didn't catch the first time through. The repeats are easy. I just highlight and delete the first of the duplicates. Usually, the other mistakes are me talking too fast, burying a word, or spiking the letter p. To address these, I listen to the highlighted words, and then replace them with silence. For the duration, instead of the default, I add at least a second to the duration to give me room to slow down and enunciate. I hit record and retry the patch phrase until I get it right. I listen and adjust the volume. Then, I remove extra space until the slow is just right.

Third, I keep a eye on spacing. A comma should be half a second. Between sentences, it's 1 second. Between paragraphs, we allow 1.5 to 2 seconds depending on flow. At the start and end of the chapter, make sure we have 3 seconds.

The next step is called compression, a dynamic filter that makes you sound like a radio pro. Amazon wants the RMS average of the volume to be in the -18 to -23 db range. Since I have a deep voice, I pick the -23 target with a floor of -65 db, ratio of 1.5 to 1, with a minimum attack and release. Play with these settings for your own best sound.
Lastly, these manipulations often push us beyond the upper limit of -3 db. To fix this, we pick Effect/Normalize, entering -3 db for the max. Things shrink a little. After each step, listen to several seconds to make sure you made things better.

Before submitting to Audible for approval, listen to everything yourself again. It wouldn't hurt to have a couple critical friends listen to the story for things you missed.
Because Facebook and this blog site don't support mp3 upload, I used the free trail on the WeVideo website to convert my sample into a video and post it. See the finished product!

Friday, February 26, 2016

Analysis of "the City Is Fallen" from my archives

The hardest part of writing for me is deciding the next project. In addition to new ideas, I have several old stories I wrote decades ago that I might be able to salvage now that I have more experience. One that resonated recently is one called “The City is Fallen.” I thought I’d take you through a typical examination process.
The original incomplete draft was 305 pages of sci-fi, with a piles of notes three inches thick. There were at least ten pages of indices to order the random scenes and background. In several cases, I actually taped printouts into the the journal. Thank God for laptop word processors so we can do this in software now. I spent a night reading over the text. The drawings in the margins brought back a lot of good memories (see sketches throughout this post).

I still like the premise, but it has serious flaws. Benoin is a military captain on a remote, hot planet. The mountain fortress provides water and power for the surrounding community. The capital, like Rome is considered “the” city, center of culture and power. The society, 730 years old, survived alone through the years of chaos when Earth’s empire imploded and rebounded. Self-sufficient, they survived with a rigid code of law. Leaders must recite all the city codes by heart, the first of which forbids mining of the black glass. The society trades its minerals, water reclamation tech, and computer AIs for wood, spacecraft, and weapons. Picture a society that combines Modern Saudi Arabia and Golden-Age Greece. Reestablishing contact with earth fleet causes social upheaval.

The tale begins with the fortress being invaded by surprise. If I were to write this today, I would show the main character surviving only because he was engaged in some activity against regulations—smoking, phoning a girl, etc. The original arc has the hero as sole survivor trying to hold the fortress—a bit too convenient. The first third of the novel is filled with action scenes that remind me of Die Hard, as well as fun with AI. Benoin gains clues to the identity of the enemy, what they want, and human traitors who aided them. After he sends an SOS, he is forced to abandon the fortress, taking key tech and memory crystals with him. He seals off what he can for another week, with an option for self-destruct.

Here it gets choppy. The city has surrendered. Benoin gathers a few allies. He tries to rescue loved ones and punish the traitors. In the process, he finds out his childhood girlfriend is one of the New Order following a professor who summoned the aliens by his probes into the ancient ruins under the obsidian. The professor has become contaminated by a rare radioactive compound and needs the aliens to survive. To do this, he needs to provide them with humans for their experiments.

Two special military envoys arrive to answer Benoin’s call and want to destroy the city in order to save the world. They clearly have paranormal abilities. Benoin tries to save as many people as he can and offers the aliens a chance to surrender. Much of his angst is an attempt to redeem his ex-girlfriend. She represents the city, with all its allure and infidelity. Eventually, they exhaust all second chances and he triggers the mountain’s eruption. The invasion is obliterated under lava and their poisonous tech buried under a layer of new, black glass. Benoin lays the foundation for a new city, starting with the law “thou shalt not mine the black glass.” The traditional military shows up after everything is resolved and the hero rides off into another dimension.

Now for the negatives. I could never decide whether Benoin was his first name, last name, or both like Cher. I wrote this back in 1987 when I worked at AT&T and lived in isolation.  During the first hundred pages, Benoin doesn’t converse with anything but computers or the voice of an invading hacker taunting him—a window into my world. I skipped any description of his girlfriend and their relationship, having no basis myself. Worse, I didn’t show enough of the actual invasion to be exciting or hook the reader. Interstellar help arriving in two days strains credibility. The chapters were 25 pages long with the main character, with interludes 2 pages long from another point of view. Way to alternate boredom with confusion. The alien race "shaktrani" sounds too much like the Shaidan shadow creatures from my Behind the Walls of Sleep series or the later Babylon 5. The heavy metal plague that destroys everyone inside the fortress is unworkable. The aliens use human hemoglobin with this radioactive power source in order to generate power and produce more source. Despite the heavy allegory, this doesn’t work scientifically. Since then, Matrix used the concept of people as batteries, and I’d be accused of copying. I borrowed the civilization and volcanic cycle for my Temple of the Traveler series, so there goes the setting. This was also part of a series about a paranormal agency I toyed with since second grade. Turns out that I stole two of my best plots from that series for the Jezebel series, which this won’t fit into.

Lastly, as part of the Greek theme, I named the city after an unfaithful queen from the Iliad, Clytemnestra. Deep allegory, right? Only later did I find out that this is a gag name meaning “hidden penis.” You have to love those wise-cracking Greek poets. The only way I could use that now is if I made it part of the title, like “Crouching Tiger, Hidden Penis.” I refuse to Google that title for duplicates. This was fun nostalgia, but I’m throwing this one back into the recycle bin. Next!

Wednesday, February 24, 2016

Sneak Peek: the K2 Virus

It's a very exciting time. My latest hard sci-fi book, a medical thriller (73K words) called "the K2 Virus" is going into edit this week. It seems to be my most widely accepted novel so far. Daniel isn't a stereotypical action hero, but he's put in dangerous situations because he feels compelled to help others. I enjoyed writing about him because he has to face his own problems to do so. The publication date is set for May 9. I'm doing preorders on Amazon and have ten reviews on Goodreads from the ARCs already. The cover, by The Cover Counts, shows a model of MERS rolling over the Blue House in Seoul, their equivalent of the White House here. That's the story in a nutshell. I thought I would offer a peek at the preface and first chapter for the curious. Keep in mind this is raw and before edits.

pitch: A new variant of the human coronavirus, K2, sweeps through North Korea. An unsuspecting biochemist delivers a routine batch of flu vaccines to Seoul. When he agrees to play translator for an attractive reporter, he stumbles into a perfect storm of political and biological forces. If he’s going to survive, he’ll need all the principles of Taekwondo he’s been taught since childhood: courtesy, integrity, perseverance, a fast kick, and even faster footwork.


Until this project was hijacked by a virus, it was an exploration into artificial blood and other medical nanotechnology. Yes, these things exist. The future is here.
When civets were suspected of causing the Sudden Acute Respiratory Syndrome (SARS) epidemic in China, thousands were systematically hunted and exterminated. Recent studies suggest that bats may have been the real culprit, as with Ebola. Nonetheless, the purge left a void in the ecosystem. The coronavirus has one imperative—multiply. If one host is eliminated, the virus must adapt to another. Almost any mammal or bird could be selected. Middle-East Respiratory Syndrome (MERS), the fifth and deadliest incarnation of human coronavirus, spread through camels. For the purposes of this story, I’ve invented a fictional variant of the virus, K2, that can spread through cattle. Otherwise, the science you’ll read is as real as I could make it. See the cover for a computer model of what the killer looks like under an electron microscope.
SARS infected over 8000 people, killing about a tenth of its hosts. The Roman commanders used this tactic, known as decimation, to strike terror into deserters. Indeed, SARS terrified people around the globe by the speed at which it propagated. First it takes over your immune system, and then you become a virus factory, spreading the disease to anyone who gets within a meter. For the first two to seven days it feels like any other flu. After a week, most people get pneumonia. In extreme cases, the entire system crashes in an ominous event called a cytokine storm—a runaway feedback loop between the immune regulatory system and your white blood cells. Small pox, Ebola, the Spanish Flu, and all the big plagues had this end game in common. The old, young, diabetics, and those with immune problems or liver diseases seem to be hit the hardest. There is no cure. You just have to ride it out and stay away from others while you struggle to breathe.
That’s not the scary part. Since the original leap to our species, the virus has been learning by trial and error. The next time we face the coronavirus, it will have made improvements.
I describe conditions in North Korea as closely as I could secondhand. The horrific famines of the 1990s killed over a million people in the Democratic People’s Republic of Korea (DPRK). No one knows the full extent because the figures were suppressed. Nor have I been in a DPRK labor camp. The descriptions are stitched together from statements from rare survivors and former guards who defected. You can see the camps for yourself on Google Earth. The similarities to Dachau are eerie.


1. The Nation’s First Line of Defense


Only an insane person would get up before dawn to drive more than an hour to a job he doesn’t want. Daniel Mann fumbled for his glasses beside the alarm clock. Unfortunately, the vaccine lab was the only place around that offered long-term care benefits for his mother. While he was at work and on Saturdays, nurses worked twelve-hour shifts, leaving him with nights and Sundays. As he brushed his teeth, he reflected that her accident had crippled his future as well.
The foul mood only lasted till he saw her sleeping. At forty-eight, the woman was still the unwrinkled saint who had treated him like a prince. She didn’t deserve this. He owed her ten times the payback, but the hours were killing him. His only hope was that if the company struck it big, his stock options might enable him to return to school some day.
“Rise and shine, Mom.” Then he wheeled over the stand with her hairbrush, toothbrush, and after-bath splash.
In her native Korean, she said, “Empty that wastebasket before she gets here.”
He rolled his eyes. “The maid comes on Wednesday. We pay the nurse. If she wants it clean earlier than that, she can empty it.”
“Medical professionals are not janitors.”
But sons with a master’s degree in biochemistry are? She had wanted him to be a doctor like his famous uncles and father. Maybe Dad’s son from his second wife wouldn’t turn out to be such a disappointment. Nonetheless, Daniel took the tiny wicker basket to the kitchen and dumped the contents into the big garbage bin. He lined the wicker basket with a fresh plastic shopping bag before washing his hands in the sink.
As he returned to her room, she said, “Women like a tidy man. There are several nice girls at my church you should meet.”
Daniel smiled. By “nice,” she meant South Korean. He turned CNN on for her because she liked to stay current. The lack of rainfall in Korea was affecting farmers. “Remember our deal. Sunday, I take you in for church and pick you up after the coffee social. I get to eat out alone.”
“A wife could cook a better breakfast for you.”
A knock saved him. He kissed his mother on the forehead and ran to unlatch the door. “Good morning,” he said in English.
“How is she?” asked Ms. Hernandez.
On Sundays, his mother mingled in public, and those nights she was always in a world of hurt. “I gave her a dose for the pain around two this morning, so she’s happy and chatty.”
The thirty-something nurse gave him a sad smile. “Which means you’re a little tired today. Do you want to take a nap before work?”
His eyes flicked toward his room. Tempting. With the round trip from the Philadelphia suburbs to the Baltimore outskirts, he had only half an hour wiggle room. “No. Every minute I delay, the traffic gets worse.”
“So you work a little less today. No one will notice.”
“I can’t cut corners. I sign off on product safety testing.” He pulled his premade lunch and a can of soda out of the fridge. Then he checked the digital thermometer by the birdfeeder on the window and grabbed a light jacket. October had brought a chill to the air. “Relieve you by six tonight as usual.”
“Watch out for the deer,” his mother shouted from the other room. She’d recently watched a news story about Pennsylvania ranking second nationwide in the number of deer strikes.
He waved as he ducked through the garage door. Maybe a crash wouldn’t be so awful. A stay in the hospital would be my first vacation in years.
His smartphone was still hooked up to the hybrid car’s sound system. He tapped “resume” on his current audiobook mystery and pulled out of the garage on mental autopilot.
****
When Daniel pulled up to the gates at Nano-Encapsulated Vaccine Research (NEVR), he saw a trio of cars in the parking lot. He double-checked the time because he was usually the first in. He had arrived two minutes earlier than normal and didn’t recognize the vehicles. The lean, African-American guard scanning his badge used the same tired joke he did every day. “Dan the Mann!”
“Hey, Murphy. Who’s here?”
The guard leaned closer to confide, “Le Grand Fromage escorted a few backers in.”
The board had appointed a French lab manager with extensive experience saving imperiled companies. His security and austerity measures were unpopular, so the employees seldom missed an opportunity to poke fun at him. Points were awarded for wearing SeƱor Frog’s T-shirts from Cancun, displaying Kermit the Frog, or using any cheesy French terms.
The ultra-secure NEVR campus was called Neverland by its employees, most of whom acted like teenagers. They held videogame tournaments in the lunchroom, NERF-dart battles in the cubicles, and contests to see who could cook the hottest chili.
As Daniel drove up to his usual space by his office, he noted the tax-exempt plates on two visiting sedans—government vehicles. NEVR belonged to the class of Washington businesses known as Beltway Bandits. In order to export superior vaccine products all over the world, they needed a government grant to ramp up to production levels. Last year’s anthrax vaccine had been a disappointment due to quality-control issues, so everything rode on the success of this year’s offerings. With flu season almost upon them, Daniel had delayed the already tardy product with an extra week of testing. According to company rules, any employee could delay production for safety reasons. However, management referred to this practice as “standing in front of the train.” Now, the investors were demanding early morning meetings.
Despite the chill in the air, he broke out in a sweat on the way to the side security door. He didn’t want to be responsible for another plant closure. If that happened, no one in the industry would hire him. Angry employees would egg his car and call his house at all hours. Last time, someone had lit a paper bag on his porch. Only after stomping out the smoking mess did he find it was full of cow feces. He’d thrown away that pair of slippers.
He ran his badge across the reader and stepped into the sterile hall. Voices from the cubicle farm caused his stomach to clench. He turned left abruptly, removed the static straps from his jacket pocket, and tucked them into his shoes. Lately, he spent far more time in the computer room than any clean room. If people were waiting to ambush him in his cube, then they wanted to know the results of his test suite. If so, he needed to see the printouts first and prepare.
Daniel badged into the small computer room, and the roar of the climate control system assaulted him. He liked the isolated chamber because it had its own printer, several large screens, and superuser access. He had also used the electron-microscope data to run simulations, which required massive computing resources.
He logged in and noted from the date stamp that the suite had completed thirty minutes ago. Next, he sent the report to the laser printer and scanned the summary as it emerged. The contamination tests all came back clean. Only two abnormalities emerged. The first had been expected. Steeling himself, he picked up the sheaf of papers and strode toward his cubicle.
The short, squat lab manager spotted him from a distance, and Henri LeBeau scurried over to shake his hand. He wore a simple charcoal suit and green power tie. Daniel couldn’t help staring down at the flagrant comb-over that covered the man’s bald spot. In an outrageous French accent, LeBeau said, “Monsieur Mann, I have heard your name often lately. I hope not in vain, eh?”
Daniel struggled not to burst out laughing. Is this a test? Fortunately, his family did poker face well. He shook hands with Colonel Branson.
The colonel’s grip was firm and his crew cut was solid gray. “Like your haircut, son. You ever serve?”
Daniel shook his head. “No, sir, but high and tight was the style when I attended grad school at UT Austin.”
“Hook ’em Horns!” replied the colonel, the way an alum would.
This bonding ritual elicited a smile from LeBeau. “The colonel has a few questions for someone of your expertise.” He turned to Branson. “Monsieur Mann is one of our most diligent workers.”
Daniel adjusted his glasses nervously. “I’m new to vaccines, but I’ll try.”
Branson frowned, an expression that traveled clear to his eyebrows. “Then why did they hire you?”
“My specialization was nanomedicine.”
“You’re shittin’ me. Like Star Trek?”
Daniel nodded. “Here, we use custom molecules down to .002 microns, the nano level. That’s the new standard in this industry.”
“Do the Russians have this capability?”
“Yes, sir. Perftran is a perfluorocarbon product. PFCs are a relative of Teflon that can carry oxygen in a similar fashion to red blood cells. If you watched the movie The Abyss, you saw the deep-sea diver breathe the gel form of PFC instead of air. Other hemoglobin-based oxygen carriers or HBOCs are made from human or bovine blood. These last longer in the patient and can be stored at room temperature.”
“Injecting people with cow blood? What is this, the damned Island of Dr. Moreau?”
“The hemoglobin molecules are the same, but the amount of human blood is limited by donations. A lab near my grad school had a product that washed out during phase II testing. I was doing my thesis on solving the problems by wrapping the fake red blood cells in a biodegradable layer and adding a few enzymes. Unfortunately, the company closed its doors before I could finish. I tried to simulate the rest of the results, but the tools didn’t exist yet. I spent the rest of my time improving BioSPICE.”
When the colonel looked blank, LeBeau showed him a little mercy. “It’s a DARPA program to provide a common platform to model biological processes at the chemical and cellular level. It’s written in Java for portability.”
“I’ve heard of Java,” replied the colonel, grateful for something familiar.
“Mr. Mann was so good at this modeling that Harvard had accepted him into its PhD program. We hired him away,” bragged LeBeau. “When he worked for Pharmacyte, he saved them the expense of phase II by finding their flaw through his computer skills.”
Saved them a lot of salaries, too. Daniel was a little nervous that the head of the lab knew so much about his history. “Like NASA, human life is our first mission priority.”
Branson nodded, pleased by the sentiment. “How did you transition from blood to vaccines?”
Blood is an $8 billion industry with the stigma of failed start-ups. On the practical side, vaccines are a well-established $160 billion cash cow. Daniel couldn’t afford another failure. “I’ve been interested in germs since age eleven when I almost died of pneumonia.”
“Why NEVR?”
“The encapsulation technology is identical to the Pharmacyte lab in Pennsylvania. We use the same fabrication machines, scanners, and contamination tests. Only here, we apply polysaccharide or PLGA coatings onto vaccines for improved T cell response.”
The lab manager seemed interested in this revelation, but Daniel had just lost the sponsor. He struggled to explain the process the way he might to his grandmother. “You know the basic principle of vaccines. We introduce a dead or weakened bug to the body, so the immune system learns how to beat it.” On the back of his printout, he sketched a picture of a dead bacterium. “That learning process only takes place if our product gets to a memory component known as a T cell. It’s a little fish in a big bloodstream.” He added a representation of the immune cell.
The guest grunted his vague recollection of this topic.
Daniel continued. “If we just throw in an empty hook, we won’t catch many fish. A lot of the vaccine could degrade before it reached the desired target. Not very efficient. So we bait the hook with polysaccharide worms in a ball around the dead germ.” He added squiggles around the bacterium. “This signals the T cells like a dinner bell.” He drew an arrow from the T cell to the bait.
He pressed on with his sales pitch. “With this method, we handle the big five—salmonella, strep, pneumonia, flu, and meningitis. Those can wipe out someone who’s had their spleen removed.” This scenario was of one his more complex test cases for any new product. “We can also enhance vaccines for hep B, anthrax, typhoid, herpes simplex, HPV, and Newcastle.” He had explicitly avoided the subject under current testing—hantavirus. Asia experienced over sixty thousand cases a year, but a vaccine had never before been made in the US.
“AIDS?” asked the colonel.
“I’ve read about exotic HIV experiments with gold encapsulation.”
“Sounds pricey and years away.”
Daniel nodded. “But polysaccharide is cheap and reproducible.”
Colonel Branson jerked a thumb at the report Daniel had drawn on the back of. “What do your fancy models say about my vaccine?”
He handed over the pages. “We knew it wouldn’t work on infants under eighteen months. Their immune system hasn’t developed a response to polysaccharides yet. The more expensive version adds a protein peptide that stimulates extra histamine responses. That’s like adding a flashy silver lure to the hook as well. However, you wanted the prototype fast and cheap for combat-age personnel.”
“What happens to kids who take it? I mean, one of my women could be pregnant.”
“The mother’s immune system covers the child for six months. Other infants would process it as waste. I modeled the breakdown using BioSPICE. In the worst-case scenario, the sugars reach the large intestine and overfeed the bacteria there.”
“What will that cause?” asked the colonel.
Straight-faced, Daniel replied, “The baby’s poop will stink more.”
Branson burst out laughing and clapped Daniel on the back. “I like you, Harvard. The last lab couldn’t even document their testing procedure. Henri here was showing me the manuals you’ve written since you’ve been here. I didn’t know there were six hundred types of blood. You’ve added test cases for every vaccine lab error in the last twenty years. The government loves paperwork like that. Demonstrate this vaccine by injecting one of your staff, and you’ve got a contract.”
“What?”
“I believe in an ancient Roman practice. The engineer who built a bridge should lie under it as the first wagon rolls across. Makes people more careful.”
The lab manager wore a huge smile. The company was saved.
“We can do that as soon as a technician arrives,” Daniel said.
“I want you to do it. I mean, that’s something they teach people to do in grocery stores, right?”
“You can inject me,” volunteered LeBeau.
Daniel stammered, “Can-can I talk to you in private a moment, sir?”
“He wants to take my medical history,” the Frenchman ad-libbed. He guided Daniel to the break room. “Zees ees the moment of truth. Don’t drop the ball now.”
“Th-there’s a reason I never became a doctor. I can’t stand the sight of blood,” Daniel admitted. At age sixteen, he had watched his friend Paul bleed out after a snowmobile accident involving barbed wire. “I get dizzy. It’s called a vasovagal response.”
“So much for your career as an ax murderer, eh? Surely you had to inject someone to get your degree.”
“Several rats and a pig.”
“An old frog is not too different.” The humor shocked Daniel, so the man continued, leading them back to the colonel. “I trust you with my life. So much that I am naming you head of testing for the company. Just smile and stick me with a needle. Yes? I will procure the resources to speed your testing of the next batch. We can’t keep the customer waiting like this again. You say Pharmacyte has everything we need? I will convince the board to acquire them from bankruptcy.”
Excitement overcame Daniel’s reluctance. “The company will compliment ours perfectly, sir.”
LeBeau waved his hand. “Perhaps, but it is the production capacity we need now. If we can merge quickly, Neverland can still make a profit this flu season.”
“Yes, sir.”
Pale and shaking, Daniel shoved a needle into the big cheese’s shoulder. His boss’s boss managed not to wince.
When the dose was administered, LeBeau announced, “I’m going to escort the first shipment of the product to the base. The colonel’s men are waiting to deploy. Feel free to take a long lunch and celebrate your promotion with your friends. Your new office will be ready for you when you return.”
Daniel’s head was spinning from both the stabbing and the generosity, so he didn’t monitor himself. “Yeah, you’ll want to be in the demilitarized zone in case the famine makes the North Koreans reckless.”
Branson’s head snapped up as if a gun had been drawn in the room. “Interesting. Who told you that?”
“It’s not brain surgery, sir. You’re in a rush to get a unit vaccinated for Korean hemorrhagic fever. I watch the news. There’s only one place that would be necessary for US troops.”
“In the future, keep your guesses to yourself.” Frowning, the colonel told LeBeau, “I want full DoD contractor checks done on all your personnel before the next shipment.”

“Of course, sir.”

Sunday, February 21, 2016

Robotics Challenge 5: the Eleventh Hour

This will be my last entry on the team.
The last week of build season is the most intense. Monday we don't have school and all hands in team 3840 are working furiously. Saturday is the practice scrimmage at a local high school against forty other teams, and we haven't seen the robot move yet. We sacrifice the manipulator arm on the top left because the pneumatic gauges and a safety light need to be mounted in plain sight, and the door arm aisle is the only spot left. By dinner time, it's done enough to test the essential systems. 

Drive train comes first. The custom, neoprene-like treads grip fantastic, rolling over any obstacle we place in its path without slowing. The spring suspension keeps us rolling without a hitch. However, the driver discovers problem. The treads grip the carpet so well that we can't turn in place. This will mean major redesign. At least we have the ball grabber/shooter arm. 

The software folks begin by calibrating the limits on the arm. Once it has been raised all the way against the frame, a mentor asks the driver with the joystick to lower the arm. The gears grind further up. Unable to break the aluminum frame, the powerful motor rips its own screws out of the base. The arm is ruined. We all stare in shock for a while. Worse, when the head mechanic looks up the specs, we have to use a newer, bigger motor to legally replace it. Back to square one.
There is no time for calibrating the webcam. Any use of the camera for autonomous piloting has been shelved indefinitely. With the changes, we no longer have a viable mount point. The bot can still be a manual-controlled, defense-running, high-scoring machine by scrimmage. Not a mechanical expert, Pierce worked on sewing the bumpers and updating the pneumatics diagram, and adding to the list of materials used.
Tension mounts until Friday evening at 7. Ginger testing shows both drive and shooter can work again. By 8, we travel to the local town hall. The bot does so well with individual obstacles, we line four in a row up and blow over them. Cheers. We shoot a ball into the low goal at range. The room isn't high enough to assemble the high goal, but I stand five feet in front of the bot with a tape measurer until they peg me three times in a row. Then, they test the turning. Nuts fly off, and they halt the bot for repairs. We didn't bring all the tools, so it takes longer. 


During the fifteen minutes, we haul out the conquered obstacles, and set up the portcullis gate, a major manipulation challenge. I'm walking out to the trailer for the third time when I see the bot squeeze under successfully. Now people are taking turns driving to get experience--the reward for six weeks of labor.
That's when my son runs over shouting that he needs a paper towel. I lead him to the bathroom where he explains that he's cut his hand. I help him rinse off the gushing blood and see immediately the jagged wound is going to need stitches. What did he cut it on? The underside of a table top at the town hall. I drop everything, leaving my camera and gear there, and rush him to the ER. Four stitches later, we get home around eleven. He'll get to drive it tomorrow at the scrimmage.

The defenses we spent two weeks constructing got about three hours of use. A few of them will survive to visit the fair, but the rest will likely be scrapped now to make room in the shed.

Saturday morning, my son and I get up around six to arrive at the team work area before seven. We have minutes to load a dozen supply and tool boxes as well as the bot into the trailer. As we walk into the metal shop, we see something horrible on the floor. The bot is flipped on its side with an entire track disassembled. The shooter arm is duct taped in the up position. We talk to the guys who worked well into the night. After the trailer is packed, we leave early for a Menards along the way. We arrive at the school just after eight and the three specialists spent until lunch repairing the broken systems. Mr. Diers, a proud grandfather, is the metalworking mentor assisting Danny.

Everyone at these events is open and friendly. I scouted other teams and found out that everyone with machine vision used a special version of openCV compiled for our camera. When I attempted to download this for ours, I discovered that the school's network wasn't secure. My laptop behaved strangely, and is still in virus recovery mode, days later. Any hope of integrating vision is dead.

When we were finally ready to test the drivetrain, the arm was still duct-taped up. The first match, our bot cleared the first hurdle in a blur. Suddenly, it lacked power and died about a minute later. The repaired track had been reassembled without spacers. Back to the pit. They refixed the track and the arm in time for a late match. 
The event only lasted until four. We would only get a few more chances to play. We couldn't calibrate the software for the new arm in time, so they used manual control on the arm. In the game, the joystick wouldn't launch the ball, and the drivers spent the remaining time trying everything to shake the ball loose into the goal. No luck. Only after the last game did we discover that dropping the arm to the ground without software support dented the ball holder and jammed the ball too high to be ejected. 



I am consoled by the fact that very few bots did well at the practice. Only one bot consistently scored three goals a match, and even they had jams. Some bots got stuck on the obstacles or broke course elements as they ran amok.








Before we could load the trailer and go home for repairs and dinner, the inspector came by. We were last on her list because we had been in the pit or matches all day. She liked how clean our electrical and pneumatics boards were and complimented us on the diagrams. "If only everyone made it this easy." Then came the list of other changes we need to comply with code at the Duluth tournament the first week of March. We're not taking off the two work/school days to travel with them to the tournament, but we wish 3840 all the best. They're a veteran team and have a night and two days to fix everything, plus the first day of practice at the tournament.

Sunday, February 7, 2016

Robotics Challenge 4: Computer Vision and Automatic Targeting

In our upcoming competition, our driver with the joystick needs to hit the targets with high accuracy and hopefully the robot can score on its own in the initial 15 second autonomous mode. Yes, I'm helping the children of tomorrow design Skynet. Image recognition on the robot's webcam can help with a wide range of areas: automatically traversing the see-saw obstacle by recognizing the raised board to lower, detecting field position via landmarks, and fine-tuning the robot's position at the last moment to hit the goal better.



How do we recognize an object from a computer picture? We start with several photos of the item in question under realistic game conditions. To the left, you see a plywood model of the game goal. Note that the special 3M reflective tape on the bottom that responds to the green LED on our robot. To make this stand out more, we should lower the camera's brightness setting and turn off white balancing. Then, we convert the goal color from RGB to HSV: hue, saturation, and brightness/intensity.  Hue covers the rainbow spectrum, with this shade of green between .33 and .6 depending on the photo we analyzed. We'll leave it vague until the competition, when we can fine-tune the precise value. Saturation means the amount of color present. Since this is mostly white (all colors combined), the saturation value will be under .2. At an intensity of at least .9, the target glows brightly, but not as much a light source (.98). In step two, we filter the image into a black and white photo, where white is sources that match our parameters and black is excluded. Note that in the second image has false positives. Therefore, our next step is to make a list of contiguous blobs. The right one has about 12. Our goal is a box with a proportion 14 by 19.5 inches. Based on possible distances, we know the max and min box size. We also know that 28% of the box should be lit. We filter out everything that isn't goal-shaped on these criteria, and outline the matches in red.

This view can be converted to a distance and the current angle of approach in order to adjust our robot's position.




Here are other filters and types of targets like balls and blue lights.
Now all we need is a drive train and for the kids to integrate the vision recognition into the driving software.

Saturday, February 6, 2016

Robotics Challenge 3: Strategy


We have 6 weeks to prepare for the FIRST robotics competition. Our primary goals are to be able to traverse obstacles and shoot balls at tower windows to score. During week three, our drive-train still isn't done, so I analyzed the game rules. Every good gamer does this. I helped the kids piece together how the game is played, what is a penalty, and what earns points. Next, I designed a strategy map for building a team play book and communicating to allied teams during a competition (left). This shows the entire field, including towers, obstacles, and balls.



The simplest inferences were about firing positions. There are a number of positions on the field where other robots can't bump into you or block you. Therefore, this areas act as sniper nests. (right)

Moreover, the three tower goals have only about a forty degree range of access, Any attempt at a goal beyond this range will likely hit the goal support structure and bounce off. Still, the zones overlap (purple on map below). A sniper in this zone has choice of targets. As you can see, entrance two puts us firmly in this magic zone.

Many of my observations dealt with robot roles on the team (attacker, defender, or sapper) and how they can score/prevent the most points. I did an analysis of the minimum possible score for a win and the estimated time for each operation. Initially, our team designed for the low goal (2 points each) because aiming for the high goal (5 points) seemed too hard. Then I pointed out two key facts. First, a high goal shooter with a 25% accuracy will out score a low goal shooter with a 90% accuracy--due to the difference in points as well as the high amount of time needed to get a fresh ball rather than your own rebound. 

I built an excel spreadsheet that showed that our prototype wooden launcher without certain features could peg the high goal from the white line marked on the map above.  Once we cross the defenses, this line is only 7 inches from the front of our shooter arm! The official launcher will shoot faster. Indeed, low goal attempts had to be from closer due to the shallow angle of attack (4-5 degrees) required until you get within 5 feet. Encouraged, the team shifted strategy.
On a whim, I looked for ways to score even if being blocked by an enemy robot. The result was the bank-shot chart. While not feasible without a launcher speed I've dubbed "hammer of the gods" range, it would be a real crowd pleaser. 

My last challenge for the team while the robot was still being assembled was to teach computer vision to the kids so they the robot could recognize the goals on our camera and allow automated scoring,




Tuesday, February 2, 2016

Robotics Challenge 2: Building the Tests

As a mentor for the local 4H team (Team Facebook Page), I spent a couple weeks helping the kids build wooden mock ups of the challenges they'll be facing in six weeks. We started with the official FIRST specs and showed the kids how to build a bill of materials for a project. Several of the mentors donated lumber and the team paid for any hardware that remained. Adults ran the table saw for the huge pieces of OSB, but always had a team member in goggles spotting. Otherwise, the kids did the measuring, marking, jigsawing, drilling, screwing, etc.  

This year's FIRST challenge has a medieval theme, where robots cross elaborate defenses in order to launch "boulders" at the opponent's tower. The upper windows are high goals with 5 points each and the lower archways are worth only 2 points each. Therefore, that was the first aid we needed. Unlike the high-school team, we meet in a residential basement, so we can't build the whole 9.5 foot tall, 4 four wide beast. I had to break it apart into segments, each 3 feet high in order to fit into a van when we take our show to the county fair. This also meant limiting the upper two stories to one side each.
We were quite proud of the craftsmanship of the lower floor, but didn't take time for photos. Here is a snapshot from the FIRST video above. Note that those LED lights are $895 for a string of 50. We won't see the real things until the tournament in Duluth.

The upper window of ours it detachable so that our camera team can play with it. The box around the bottom is a special 3M reflective tape that can be used for machine vision. Our robot will aim for the box when shooting. Our camera (connected up to my computer in this instance) is surrounded by a bright green ring of lights to make the tape a specific color from our point of view.

Next, we constructed the enemy "defenses", the obstacles our robot has to be able to overcome. We built one 2 foot by 4 foot hold with the ramps on each side and drop in each of the eight choices : moat, rock wall, rough terrain, ramparts, portcullis, etc. Since the portcullis is six feet tall and we ran out of room in the storage shed outside, we decided not to build the elaborate metal drawbridge or sally port. The local high-school team (with 30 members) graciously offered to let us borrow theirs.


My favorite obstacle was the "cheval de frise". This sounds too much like a type of poodle, so we call it the see-saw. The others, our design could breeze over. We even had minor shock absorbers in case we became airborne on the ramps. However, the see-saws would require a manipulator arm to lower the left center board so we can slowly drive over the three boards on the left.

Because we couldn't build any more, I turned my obsessive thoughts to the game manual and points of strategy. As a former tester and gamer, I knew that every rule system had loopholes and sweet spots.