New Makelangelo-based control software
Shop › Forum › Makelangelo Polargraph Art Robot › New Makelangelo-based control software
- This topic is empty.
-
AuthorPosts
-
2014-06-16 at 06:22 #6001AnonymousInactive
I’ve been working on my own makelangelo based drawing machine for a few weeks in my spare time. I finally decided to undertake writing my own control software for it. There are a few things about the (excellent) provided java GUI app that I wanted to do differently. The most important of which is being able to control the machine from a web browser, so I wrote my app in javascript. It interfaces with the machine via a serial connection and uses websockets to transmit that data back and forth to the browser. This means I can have my machine hooked up to a raspberry pi and simply use my phone or tablet to control it. Some interesting features include:
-
– paper.js powered gcode preview
– headless operation (client can disconnect / refresh browser without disturbing the machine)
– Multiple clients can view / control the same machine (this is a weird “feature” and more of a side-effect of the design)I’ve decided not to include any artwork creation features in this app to better suit my personal preferences. I keep a repo of my artwork experimentation at https://github.com/dustMason/Machine-Art. I like to mix it up with different languages and libraries to help generate my artwork.
It’s still in a pretty early phase although I have been using it to make drawings. It’s probably too early for anyone else to be using it as-is but I’m sharing it now in case any other javascript inclined folks want to hack on it with me!
Please check it out and let me know what you think: https://github.com/dustMason/GCode-Sender
Thanks!
2014-06-16 at 22:48 #6680AnonymousInactiveHow do you maintain the connection between the RPI and the arduino? I’ve always had trouble with that.
2014-06-17 at 01:44 #6681AnonymousInactiveI haven’t seen problems yet but thats probably because this is a brand new set up for me. What kind of issues have you run into?
Periodic unexpected disconnects from the pi would be quite an annoying problem. Is that what inspired your sd card feature?
2014-06-17 at 16:01 #6682AnonymousInactiveBecause the web server is running REST apps it would open and close the serial connection on every user request. When a connection is opened to an Arduino it resets.
I tried to write a daemon that would keep the serial connection open between the pi and the Arduino. I didn’t succeed.
The SD card feature is so that I can run more than one makelangelo at once at a fair or trade show. I load the SD card with a few popular pictures, then use the laptop to drive the second machine and let people try it out.
2014-06-17 at 17:14 #6683AnonymousInactiveAh I see. I solved that problem by having the node app hold open the serial connection on the server in global state rather than trying to set up and tear down a new serial connection with each request. If you are curious, look at app.js in the repo root to see how I did it.
From there, each client interfaces with this serial connection using websockets. All the node app does is forward the communication between the browser and the serial connection that it holds open all the time. If a browser leaves the websocket connection pool, the serial connection stays open.
I think this design would be more painful using something like PHP as (by default) it is designed to completely tear down and set up the app environment with each request. Because of this and some great libraries like node-serialport and async.js I’ve found node to be a good fit for this project.
2014-06-17 at 19:25 #6684AnonymousInactiveI’ve never worked with node.js. Interesting! I could have used that when I started my drink mixing robot two years ago.
-
AuthorPosts
- You must be logged in to reply to this topic.