Uncategorized

Mixology Bot: Talking to Arduino

Since my last post I’ve been doing a lot of work on the linux command line on the raspberry pi.
I hope my notes are complete. Let me know if I missed something?

Several people have suggested using the GPIO pins on the RPI to talk to the Arduino. Personally? This is a terrible solution to a non-problem. The RPI runs at a different voltage from the Arduino, which means you need a third thing in between to “translate” between each voltage or you fry the RPI. No thank you! I’m connected to the Arduino over the USB hub.

[code]sudo apt-get install picocom arduino python-serial python3-serial[/code]
In one line I install about 175mb of stuff on the SD card, all of it tools.

Then I used python easy setup to install inotools, linux command line tools that make it easy to compile and upload sketches.

I would not have known about inotools if it weren’t for kline and the other kind members of Freenode IRC #arduino channel. Linux is a bottomless pit of mystery and my only saving grace is that I know how to is ask questions politely.

Now that I’ve got intools installed uploading a script is a breeze.

[code]ino build
ino upload
ino serial[/code]

That last line lets me see any serial messages coming back from the Arduino. That’s how I know it’s working, even though my pi is at the other end of the lab.

Next up I’ll open a persistent two-way connection and send commands from the RPI to the Arduino when a button is clicked on an RPI web page. this should be interesting – I’ve never written a mini server before!

Uncategorized

Makelangelo Software v0.9.6 released

win: https://www.marginallyclever.com/other/Makelangelo.zip
osx: https://www.marginallyclever.com/other/Makelangelo.dmg
OR
win: https://www.marginallyclever.com/other/Makelangelo-0.9.6.zip
osx: https://www.marginallyclever.com/other/Makelangelo-0.9.6.dmg

change log

– open file defaults to image formats instead of ngc files.
– stopped automatically loading last file on program start (would reprocess image file every time).
– image_dpi now remembered between sessions
– image_dpi slider has more realistic upper limit
– some float values were being rounded to produce really long strings that messed up the arduino. they’ve been fixed to two decimal places.
– feed_rate is now passed to jogging controls more accurately.
– gcode is now dumped into temp.ngc every time. save the file somewhere else if you want to keep the gcode.

Notes

In using the software I found that I never reused the gcode so I stopped using it as a default option when loading files.

As of now I’ll be keeping older versions online, just in case.

The next planned updates is all about making a spray paint can holder/actuator. It shouldn’t require any change to the arduino firmware but it will mean big changes to DrawbotGUI and the physical machinery.

As always, please comment in the forums if you have any feedback. I love hearing from you and making things better.

Uncategorized

Mixology Bot: Talking to Arduino ||

The Arduino Playground taught me that linux treats serial connections as a file. That means they can be read like a file and written to like a file, with a little massaging. Here’s how to work out the knots:

[code]stty -F /dev/ttyACM0 cs8 57600 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts[/code]

Honestly? I don’t understand it. It’s deep magic that I don’t have time to get into. Something about what the serial connection should and should not deliver.

Anyways, once that’s done I told the raspberry pi to send any new data straight to my screen like this:

[code]tail -f /dev/ttyACM0 &[/code]

tail is a command to display the end of a file. The & tells it “do this in the background so I can get on with my work.”
It now shows me every message coming from the arduino, right on the command line. The very first thing I see is

[code]Mixologybot 1[/code]

1 is the firmware version. I could then echo a command to the arduino like this

[code]echo "help;" > /dev/ttyACM0[/code]

and it responded correctly, but only the first time. Looking closer at the output I realized there was a mysterious newline (the code for the return key) added after every command. My first Google hit for “echo without newline” taught me that raspberry pi needs one extra command. Now I use

[code]echo "help;\c" > /dev/ttyACM0[/code]

The \c removes the newline automatically inserted by bash and makes all communications work as expected. Hooray!

This means I can now have the RPI and the Arduino talking together. The next step is to set up a bash script that pipes commands from PHP to the arduino and back. That way a user can see that the drink robot is ready to pour and tell it what drink to make. Anyone know how to make that happen? Write me, please.

Uncategorized

Store updates, July 2 2013

Orders on hold, July 2013

Caching issues
I’ve only just been made aware that most people see the last blog post as may 18, 2013. There is a system in place to deliver web pages to you faster and it has been broken. Here I’ve been making post and working on cool stuff and only my Facebook friends know about it. So I’m working on that right now.

No more date of birth
Don wrote in to ask why the store registration process requires a date of birth. I’d never thought about it before. We don’t! That’s for sites selling adult material. So it’s g-o-n-e. Thank you, Don!

Out of Stock
The Standard Operating Procedure until now has been to list lots and lots of parts and then to make or buy them on demand. That was great for securing a sale, but I’d rather get a sale and ship the order same day. So I’m taking a cue from Lululemon and starting to work on a Scarcity Model – item stock counts will truly reflect number of units you can buy this second. The challenge will be to find out who wants what and make it before they pay. Any advice?

Should we start hiring?
When I started out people told me “if you aren’t turning a profit in 18 months, find something new to do.” Well… this is my passion. After 18 months I’m breaking even, which I’m very pleased with. I think the future looks bright and things are only going to get better. There are some really exciting robots in the pipeline like the MixologyBot and we’re growing our manufacturing base to meet demand.

The oldest challenge for me right now is doing every job. I strongly suspect that if I had people working on my team I’d be making the $ to afford the people on my team. I know it’s a bit of a gamble but life is for living and I’m willing to take a risk now and then. Is there a way to prove numerically that it’s going to work? That’s not a rhetorical question, I really want to hear from you.

Uncategorized

Laser cutter update: calibrated!

The laser cutter is now assembled and calibrated. I’m working to find the right feed rate and speed for cutting the material I have. Once that is charted it will be a snap to produce parts for the delta robots, Makelangelo, and start testing the frame for the MixologyBot.

I can cut wood, bamboo, jade, marble, organic glass, crystal, plastic, garments, paper, leather, rubber, ceramic, and glass. While the 3D printers are going the laser cutter can be going as well, making me look super productive. …but there will be time when the machine is sitting there, growing cobwebs. Adding a Vancouver laser cutting service sounds like a very doable plan. $3/min runtime + material is the going rate at Metrix: Create Space (who, BTW, are totally awesome and you should go visit). I’ll start there and see how it goes.