Tuesday, September 12, 2017

Publication! - XMRemoteRobot - our open source remote control server software

XMRemoteRobot is published on "GitHub". XMRemoteRobot is web server software that enables Human Commanders to remote-control devices in real time over the Internet.


XMRemoteRobot is a spinoff from learning, teaching and research at the Manukau Institute of Technology. XMRemoteRobot is focussed on being small and efficient for our particular robot remote control and telemetry needs - which may be your needs. The code is written to be clearly understandable so it can double as an education resource for the new ASP.NET Core technology. You can support this by giving feedback, comments and suggestions.

XMRemoteRobot has an online demo. Web page to web page on a screen split by an "iframe" is a good simulation test.


Video of XMRemoteRobot in action with our "Creative RAT" robot vehicle:


Thursday, August 31, 2017

ATtiny85 Microcontroller - first impressions - excellent

For running motors etc from mobile phones I have been going "old school" analogue with early success with "robot rat" and having a lot of challenges with "robot snake". I had thought that a microcontroller approach would be complex and expensive. This is where the cellphone is the robot "brain" and with one or more microcontrollers as the "spinal cord". I found ATtiny85 boards selling for NZD 3.50, approx USD 2.30). I followed the instructions and everything worked, smoothly and easily. I had the first example program running on this ultra micro computer in 1 hour and I was running my own after another 20 mins.

Excellent instructions on how to program using the Arduino IDE:

Only advice I would add is that I found it best to stop a program run by pulling out the USB cable and let ATtiny85 go dead for a few minutes while writing the next one - then plug in after starting the new program on the PC. The instructions suggest briefly pull it out and plug it in again when we  run a new program but that gave errors which went away when I did the longer disconnect.

I  am interested in using ATtiny85 to run hobby servos.
I run my first code "sketch" (see below)  - and it gives me 2 pieces of good news:

  1. the "delayMicroseconds()" method works on an ATtiny85
  2. although "delayMicroseconds()" specifies "unsigned int" as the data type, I found it was working OK with common ordinary "int".

int m = 16000;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(0, OUTPUT); //LED on Model B
  pinMode(1, OUTPUT); //LED on Model A  or Pro

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(0, HIGH);   // turn the LED on (HIGH is the voltage level)
  digitalWrite(1, HIGH);
  digitalWrite(0, LOW);    // turn the LED off by making the voltage LOW
  digitalWrite(1, LOW); 
  delay(3000);               // wait for 3 seconds

Wednesday, August 2, 2017

Programming Mobile Phones - Revisit, Review, DroidScript looking good.

An intense weekend programming the test Android Phone. I was making slow progress with the cross-platform tools: Cordova and Xamarin. In the meantime I have been finding that I can prototype a lot of what we want to do with conventional web pages stored on a webserver not needing phone app programming at all.  I need a simple framework, where Android-only is OK, and framework can add phone functions value to my HTML prototypes.  I did a more in depth look at "DroidScript"and it is looking good. I began by trying to work out from the documentation how it could work with an HTML-based user interface, That was inconclusive so I ran it and found immediately that it offers an "HTML App" option which meets my needs very well.

In principle "DroidScript" is like a simplified "Cordova" but "DroidScript" keeps it simple by only supporting Android. The "DroidScript" IDE (Integrated Development Environment) runs completely on the phone although we can run it from a PC via a web interface using a WiFi connection. This lets us drive "DroidScript" with a full screen and keyboard. The IDE is remarkably capable considering it is a download of only 8 Meg compared to the multiple gigabytes of its rivals. It is a good fresh experience to make small edits then test run instantly.

The "HTML App" experience is of an HTML web page, with JavaScript blocks just as we would expect with standard web pages. The only remarkable element is a script import of "app.js" which turns out to be the interface into the phone functions. So it is a very familiar environment with an extended JavaScript which is highly phone capable.

The authors of "DroidScript" are interested in robotics and have done work on getting robotics support into their APIs. "DroidScript" has resources ranging from community contributed sample apps to paid plugins.

"DroidScript" has a home website and an online wiki, but I found it was best experienced, including documentation, by running it on the phone while remoting from the PC. "DroidScript" is a free app from the Google Play store. There are some paid plugins or enthusiasts can get these and support the project via a premium subscription model.

Thursday, July 27, 2017

The Mocket - Weight saving - old small cellphone (no) and back cover removal (yes)

The Challenge - from our previous exciting episodes, the "weight allowance" for construction is est 134g.

Idea? - use an old smartphone Vodafone 858 that is smaller than number one tester - a current Vodafone VFD-300.

Out with the weighing machine.
The old 858 is 99g complete and 69g minus battery and back cover
The new VFD-300 is 103g complete and 65g minus battery and back cover.
I had not thought of flying without the back cover until now but I get that idea from doing this exercise. Minus back cover does look possible, maybe with cling wrap as a dust cover, and it saves 10g for the VFD-300. The construction weight budget goes up to 146g.

Change Sun 50mm Ducted Fan 66
Hyperion Battery 3S Lithium Graphene77
Hobbywing Flyfun 30A ESC Controller26
Vodafone VFD-300 Mobile Phone65
2 x Chihaimotor Geared Motor 20

Friday, July 21, 2017

The Mocket - design - "top heavy" is good for rocket stability

"The Mocket" is a model rocket in shape and appearance, but the motor in the tail is an electric "fan-jet". Similar thrust source and direction can get us started on flight control problem solving.

The current plan is to place most of the weight eg battery, mobile phone, into the head and have a mostly empty middle section to get the height up to 1m. Why weight at the top - isn't that top-heavy? Why give it extra height - wouldn't it be better to make it shorter to save weight?

In this video, John compares this with balancing a 1m rod on his finger. Adding the weight of a mobile phone at the top gives more stability because of inertia and leverage effects.

Note that The Mocket will not have tail fins because (1) it will not move fast enough on the way up to be able to use air pressure as a stabilising force, (2) it has fold-out "head fins" which act as air brakes on the way down and tail fins would work against these.

One of the many experiments for The Mocket is to try to keep it on a straight-up course by angling the motor, rather like a finger balancing a 1m rod. And rather like a SpaceX Falcon 9.

Wednesday, July 19, 2017

The Mocket - Mock Rocket - here's looking at you SpaceX Falcon

The project - experimenting with mobile phones as "robot brain" processors. 
The device challenge - mobile phone as model rocket flight controller, flight recorder, video camera, telemetry.
Oh and let's try landing the rocket like a SpaceX Falcon 9. Like this.

An Educator's approach - "staircase" - with early test vehicles which test parts of what is needed and perform less ambitious flights and ground tests as we work towards this grand aim, learning a lot along the way - which is the real payoff here.

Enter - "The Mocket" or mock rocket.
Idea - it looks like a rocket, but the motor in the tail is an electric "fan-jet". Same position, same thrust direction, similar moveable mount and controls as what a "real" ie not-atmosphere-dependent rocket motor would need. We can get started on phone-sensor-based flight control because "The Mocket" is easier to work with and has less in the way of flying permission issues than the possible later rocket.

The "Change Sun" 50mm ducted fan specs state: "Static Thrust :  Around 510g At 11.1v (25A)"

Question One  - do the core components add up to well under 510g?

Here goes:

Change Sun 50mm Ducted Fan 66
Hyperion Battery 3S Lithium Graphene77
Hobbywing Flyfun 30A ESC Controller26
Vodafone VFD-300 Mobile Phone75
2 x Chihaimotor Geared Motor 20

Assume for a reasonable climbing performance we need a total weight of 400g, this gives a "weight budget" of 134g for structure, wiring, other needs arising.
Challenging but good enough for a go-ahead.

Note - The mobile phone weighs 103g but it is possible to remove its battery (28g) and run it from the 5V "BEC" power supply provided by the ESC = Electronic Speed Controller. That gets the phone down to 75g.

Tuesday, July 11, 2017

Robotics - LiPo power and keeping it safe

Robotics experiments continuing. I have started by powering "Creative RAT" (Youtube Video Here) with a common 9V battery but it goes flat after only a few minutes of demo. Time for something rechargeable and better. Next up is to try changing to a 7.4 Volt "2S" (2 cell) LiPo battery as used in Radio Controlled model aircraft. These have an excellent power capacity but they also carry a risk of catching fire and melting down if overcharged or undercharged so we need to regard them as "prima donnas" needing much loving care and attention. My first 2 "Wild Scorpion" batteries cost 10 NZ dollars each but they need a support infrastructure!

Storage. In a special fireproof "LiPo bag". I am keeping this bag on a steel shelf by a brick wall.

Safe voltage range. 3.1 to 4.2 V.  Range centre and commonly quoted rating is 3.7 V per cell (7.4 V total - I will quote per cell from now on).

Max voltage when charging is 4.2 V per cell. For LiPo batteries we need to buy a special charger which "balance charges" each cell individually and gives an optimum charging sequence of voltage and current over time.

Low-cutoff voltage recommended by "HobbyWing" is 3.15V [1].  Others say 3V. The battery is at risk if it falls below that. This is a big issue for us because Quadcopters etc all have "ESC" (Electronic Speed Control) units with cutoffs. We are doing speed control differently so we need to provide the cutoff.

I am starting with a small unit that sounds an alarm at 3V for any cell. [2]
 This is a warning beeper rather than a cutout but when I get this I plan to investigate the power supply to the beeper to see if it can power a relay or trigger a MOSFET for cutoff. I am also calculating and sketching possible diy cutoff circuits.

One of the aims of this project is to find ways and means that can work well for getting teenagers interested in tech - as well as being do-able in places like School Science Labs and after school workshops. I am guessing that the special care demands of the full-on LiPo are a heavy responsibility "turn off" for these situations.

Point and shoot cameras use efficient rechargeable Lithium batteries, single cell, 3.7 V
They should have less critical care needs because the battery includes an electronic module which includes a cutout. Can these work as our robotics batteries?
[NOTE LATER - Tested 2 such batteries - one is working well, the other "died" under test load. Therefore it looks better to follow common practice for radio controlled model cars and use NiMH batteries.]
The HobbyWing FlyFun ESCs have selectable cutoff options of  2.85V, 3.15V and 3.3V. I plan to follow their "medium" setting of 3.15 V as a good recommendation.

BW4701 AOK 1-8S Lipo Battery Tester/ Low Voltage Buzzer Alarm
NZ 9 dollars from "HobbyHangar" in Hamilton, NZ.