My First 3D Printer

I was rather impressed by Baz’s 3D LEGO printer when I got to see it at LW2017. So, I figured that when I had time I’d build it and have a go at coding it myself. I finally got all the parts this month and have built it up – albeit in different colours, and with a few minor structural changes.

Today I got the code working for the first time! It’s not fully fledged, but it’s functional, so I’m going to post a link to what I have so that people can follow my progress. The link below points to this basic code:

http://www.jander.me.uk/LEGO/resources/EV3DPrinter_JN-v0-1.ev3

It will be expanded to do more things, such as simple geometric shapes/prisms/cones, and reading datafiles to print more complex structures. I doubt I’ll pursue the G-code system as that’s too complex to handle in EV3G.

Update on my Bluetooth EV3 Mailbox testing.

I managed to focus some more time on tidying up my AI2 app for sending Mailbox messages via Bluetooth from my Android phone to an EV3. The EV3 code is really simple and looks like this:

Screen Shot 2016-08-24 at 21.23.05

The AI2 code provides two BT related buttons, Connect & Disconnect, a text box and a Go button to send the text:

Screenshot_20160825-211129

When the text is entered and Go pressed it is sent as a Mailbox message with the name “beep” to the EV3, and displayed on its screen. The code to send it has to construct a message in the form:

MLenL, MLenH, 0x01, 0x00, 0x81, 0x9E, NLen, NameBytes, 0x00, TLenL, TLenH, TextBytes, 0x00

Which breakdown as:

  • MLenL, MLenH = 16 bit little endian length of the rest of the message
  • 0x0001 = Message counter
  • 0x81 = System command, no reply
  • 0x9E = Mailbox message
  • NLen = 8 bit name length, including 0x00 termination
  • NameBytes + 0x00 = The Mailbox name
  • TLenL, TLenH = 16 bit little endian length of the text
  • TextBytes + 0x00 = The Mailbox text

This in terms of code looks like:

blocks (1)

If you would like to play with the code it’s available from my resources site at:

The code is released under the Creative Commons Attribution-ShareAlike 4.0 International License

Developing an Android App for EV3

At the Bricktastic event back in July I showed off my Plott3r as part of the Mindstorms exhibits. It was programmed to do the Hilbert and Dragon curves, several plot “files” and some other bits.

One of the questions that the kids kept asking was something along the lines of “can it write my name?” Unfortunately it wasn’t, and isn’t, capable of writing ad-hoc text. So since then I’ve been pondering ways of supplying user-provided text. I did consider an ultrasonic triangulated “keyboard”, but the US sensors got confused with each other’s signals – so for the moment I’ve put that idea to bed to be revisited in the future. My original thought, however, was “can I do this with a mobile phone?”

Since that original thought I’ve been looking at how to write an Android app that has a simple text box and “send” button. Kids are used to mobiles these days, so it seems to me to be the perfect UI. So far I seem to have settled on using MIT’s App Inventor 2. It does support EV3 to some extent, but I’m going to have to get down and dirty with the EV3 byte code to send mailbox messages via bluetooth 🙂

So, now I need to get learning how this AI2 system works. Thankfully they have tutorials, so I’ll be building the tilt/move tutorial soon to get to grips with communicating with the EV3. Tinkering with bytecode won’t be too daunting as I’m used to getting down to that level of bit twiddling via my current and previous jobs.

Nothing to show yet, but watch this space!