#v3 update

LIVE

Hello after a long break! We spent the summer outside as much as possible, and now with winter here -and supply routes working better as the world learns to manage Covid- we’re moving back into bot making mode. 

We’ve been working more on K9, continuing our process of updating him.

The updated software is working again with a web based controller that works from an i-phone (larger the better), IPad, or PC. We lost some of the last work that we did a year ago when we shorted out the Pi, but it’s been fast to re-do. We then worked to recalibrate the servos (head, tail, ears) to work properly with the updated software. This is the larger interface set up. It allows more simultaneous control than blynk did on the phone, as you don’t have to stop one control while flipping to a different tab to start another animation.

We confirmed the interface to the motor controller is working and mounted the pi, screen, and motor controller back into K-9. We just need to hook up the LEDs and servos, and clean up the new wiring. Then we need to switch to the Pi driven router so that no internet connecting is needed. We had worked through this last winter and we think it’s straight forward. Once complete K-9 will weigh a good 8 – 10 lbs less which should allow for even better turning and longer battery life.  

By the time spring comes around and it’s warm enough, he should be ready to go out for ‘walks’ again!

New features include:

  • PowerSave mode that only runs the hover lights when he moves and dims the eyes
  • Camera in nose can be streamed to the I-phone/IPad.
  • 3 selectable tail movement patterns in addition to the basic movements and the existing two speed ear movements
  • Thinking about adding one button to run a set script, ala Wheatley. For example: Raise head, say ‘I am K-9′ while wagging tail and ears, blink hover lights, lower head.

All of the hardware parts that we needed to repair K-9 are in along with a new board that connects various I2C devices. We hooked up a new Pi, servo controller, screen, and the new I2C connector and all are running just fine. 

We haven’t ordered the machine learning accelerator, Google Coral, yet but will do so soon. This combines with an update from the Pi3B+ currently used to the new Pi4 and will allow K-9 to identify objects with his nose camera. We are planning to test all of this on a separate set up (so we don’t fry K-9…again) and then migrate the changes into K-9. We still have a lot to learn about AI & machine learning, so no firm timeline on this enhancement.  For some examples on what you can do with Coral see https://coral.ai/examples/.

After about 2 hours of work we now have the drive control working. We ran into two issues:

  1. The old K9 software used Python 2.x and we upgraded to Python 3.x with this version of K9. There are some differences, and the way Python handles strings is one of them. Since the Pi communicates to the motor controller through serial over the USB cable, handling strings is key. We finally found the solution, but it was not immediately obvious and took some time.
  1. We then ran into issues with communication across the correct USB “port”. The new K-9 runs on a P3B+ and the old one uses a Pi3; something changed between the two. After about an hour of hit and miss, we found a Unix comment that would display USB device details when a device is plugged in / pulled out. With this information all we had to do was change the 4-character USB name to the correct one and the motor controller started responding to the joystick.

Other updates to his existing functions:

  1. The hover lights can now be either on or speed sensitive where they get brighter that faster K9 moves.
  2. K9’s eye brightness can now be set by the user.
  3. “PowerSave” mode sets the hover lights off when not moving and the eye led’s down to 25%.

The only open item is to read the battery voltage every minute and display it on the remote. When the battery gets low it will send a warning message to the remote and automatically go into power save mode. Once we have the voltage sensor hooked up, we need to bolt everything back into K9 and then he’ll be good to go again! 

While waiting on the replacement electronics that we accidentally smoked last weekend, we’ve worked on adding live streaming video from K-9’s nose camera to the remote.

We first found an example on the web using the Flask server that I am using for K-9’s new control. However, the example uses the Flask HTML server as opposed to the Flask Socket server and they could not be run together. In theory you can stream video over sockets but the client (IPad) script gets complicated.

We then found an example using the Python simple server that I tried to run as a Subprocess/Thread. However, we could never get this to work.

We then attempted to run the Python server as a separate instance with the os.popen object. This would launch the server program and run as long as the main control sever was not running, but since we use the PiCamera in the main program for previewing K-9’s nose camera on his side screen, the server program could not access it simultaneously. We then moved the preview to the separate python video server program and added a parameter to the separate python program to either 1 – preview only, 2- stream only, 3-stream and preview. We also added a frame into the IPad/HTML control program that links to the separate streaming video server using the :8000 port. Success! This may not be the most elegant solution; but it works, its quick to load, and cpu usage is minimal.

Here is a photo of the IPad control with streaming video.  The PiCamera was looking at the ceiling, but you can see how it works.

K-9 Version 3! Back in the summer of 2016 we built a full size replica of K-9 from Dr Who based from

K-9 Version 3!

Back in the summer of 2016 we built a full size replica of K-9 from Dr Who based from BBC drawings and operated by a model airplane RC control. (K-9 V1) 

During the winter/spring of 2017 we updated K-9 to include a Raspberry Pi and control through an I-Phone using a local Blynk server and app; Python, and Node-Red.  This also added voice and video capability.  (K-9 v2)  K-9 won best prop at Anime Iowa that summer.

Now it’s time for another update!  V3 planned updates will include:

  • Conversion of the remote control from the Blynk app on an I-Phone to a local web server and an I-Pad/I-Phone control.  This will allow increased flexibility in the user interface and reduce software complexity eliminating the node-red and Blynk servers on the Pi.
  • A change from heavy SLA (Lead Acid) batteries to LiFePo or Lipo batteries to reduce weight. This will increase both operating time and improve counter-rotation.
  • An update to the electrical system to allow for speed sensitive “hover lights”, control of eye brightness, and to better balance the load on the batteries.
  • The ability to stream video from K-9’s nose camera to the I-Pad.

Keep an eye out on the blog for K-9 updates! Since he’s already on V3, his updates won’t be numbered like Wheatley’s but they’ll all be tagged/titled K-9 V3. 


Post link
loading