Friday, January 6, 2017

Machine Control with MQTT

MQTT is an open standard for message passing in the IoT. If a device or program knows something interesting it can offer to publish that data through a named message. If things want to react to those messages they can subscribe to them and do interesting things. I took a look into the SmoothieBoard firmware trying to prize an MQTT client into it. Unfortunately I had to back away at that level for now. The main things that I would love to have as messages published by the smoothie itself are the head position, job processing metadata, etc.

So I fell back to polling for that info in a little nodejs server. That server publishes info to MQTT and also subscribes to messages, for example, to "move the spindle to X,Y" or the like. I thought it would be interesting to make a little web interface to all this. Initially I was tempted to throw over websockets myself, but then discovered that you can mqtt right over a ws to mosquitto. So a bootstrap web interface to the CNC was born.



As you can see I opted out of the pronterface style head control. For me, on a touch panel the move X by 1 and move X by 10 are just too close in that layout. So I select the dimension in a tab and then the direction with buttons. Far, far, less chance of an unintended move.

Things get interesting on the files page. Not only are the files listed but I can "head" a file and that becomes a stored message by mosquitto. As the files on the sdcard of the smoothieboard don't change (for me) the head only has to be performed once per file. It's handy because you can see the header comment that the CAM program added to the G-Code so you can work out what you were thinking at the time you made the gcode. Assuming you put the metadata in that is.

I know that GCode has provisions for layout out multiple coordinate spaces for a single job. So you can cut 8 of the same thing at a single time from one block of stock. I've been doing 2-4 up manually. So I added a "Saves" tab to be able to snapshot a location and restore to it again later. This way you can run a job, move home by 80mm in X and run the same job again to cut a second item. I have provision for a bunch of saves, but only 1 is shown in the web page in the below.




This is all backed by MQTT. So I can start jobs and move the spindle from the terminal, a phone, or through the web interface.


Sunday, January 1, 2017

Keeping an eye on it

The CNC enclosure now sports a few cameras so I can keep an eye on things from anywhere. The small "endocam" mounting worked out particularly well. The small bracket was created using 2mm alloy, jigsawed, flapped, drilled and mounted fairly quick. These copper coated saddle clamps also add a look good factor to the whole build.



A huge plus side is that I now also have a good base to bolt the mist unit onto. It is tempting to redesign the camera mounting bracket in Fusion and CNC a new one in 6mm alloy but there's no real need for this purpose. Shortest effective path to working solution and all that.

Tuesday, December 27, 2016

First alloy on the 3040 cnc (with 2.2kw spindle)

There are times when words are not needed. When you see a 3040 or 6040 cnc without any enclosure there is a good chance that the machine doesn't see heavy alloy cutting. It only takes a few videos to see how chips are thrown around when a 24krpm bit touches a block of alloy. As a prelude to any alloy being cut I enclosed the 3040 in a "terrarium". This was itself an interesting build and as usual I overdid the design. The top and bottom box frames are made of 5cm square timber with a fairly solid base panel. The back is just light junk with plywood bolted to tabs on each side so I can replace things as I feel. The door opens beyond 90 degrees to get right out of the way and closes to rest on the base 5cm timber at the front of the enclosure.


For anybody reading this I have one word of advice, any gaps in the first 50cm from the machine base will have chips thrown at them. So make sure that the angles the chips might come from near the spindle have been accounted for with your air venting that allows some cooling into the mix. The sides of this case are more than 80cm in height.

The next modification is a mister to help clear local chips and bring some light amount of cutting fluid into the cut zone. The first runs were just using a light spray of CDT over the cut zone before job start.

The very end of one of the first runs is shown in the below video.



The parts being cut are wheel mount crossover plates to allow an outdoor robot to have larger wheels attached. The wheels want M8 bolts, the motor mount is an actobotics pattern, so an M4 hole was a good fit there. Because it's CNC the part itself was cut with many splines to include material where it could do structural good and exclude it otherwise.

I found it useful to cut templates in MDF to test the fit before a final run. This fed into part 3 which includes mounting holes for all 4 bolts of the hub mount. The alloy version 4 also has rounded ends and is shown attached to the wheel. This will let some cheap $10 wheels which are 12 inch across mount to an actobotics based robot.


I'll have video of the "houndbot" in action using these mounts next time.

Sunday, December 11, 2016

3040/24,000 CNC first dry run in place

The progression has finally reached an upgraded CNC with high power spindle. Things still move around fine to the eye, the next step is likely to do some test drills at known distances to see if the additional weight has had an impact on the steppers that can't be easily seen.


A few interesting times when spinning up to 24,000. At around 320hz there was a new loud rattle. I think this turned out to be resonance with either something that was on the cutting plate or the washers on the toggle clamps.

There is going to be video once this machine starts eating alloy. The CNC needs to be lowered into an enclosure (the easier part) so that chips and the like go into a known location. The enclosure itself needs to be made first ;)

Ironically a future goal is to be going smaller. Seeing if twice the number of microsteps can be pulled off in order to get better precision and cut QFN landing zones on PCBs.

Friday, December 9, 2016

3040 spindle upgrade: the one day crossover plate

Shown below is the spindle that came with my 3040 "engraving" cnc next to the 2.2kw water cooled monster that I am upgrading to. See my previous blog post for videos of the electronics and spindle test on the bench.


The crossover plate which I thought was going to be the most difficult part was completed in a day. I had some high torsion M6 nuts floating around with one additional great feature, the bolt head is nut shaped giving a low clearance compared to some bolts like socket heads. The crossover is shown from the top in the below image. I first cut down the original spindle mount and sanded it flat to make the "bearing mount" as I called it. Then the crossover attaches to that and the spindle mount attaches to the crossover.

Notice the bolts coming through to the bearing mount. The low profile bolt head just fits on each side of the round 80mm diameter spindle mount. I did have to do a little dremeling out of the bearing mount to fit the nuts on the other side. This was a trade off, I wanted those bolts as far out from the centre line as possible to maximize the possibility that the spindle mount would bolt on flat without interfering with the bolts that attach the crossover to the bearing mount.



A more side profile is shown below. The threaded rod is missing for the z-axis in the picture. It is just a test fit. I may end up putting the spindle in and doing some "dry runs" to make sure that the steppers are happy to move the right distances with the additional weight of the spindle. I did a test run on the z-axis before I started, just resting the spindle on the old spindle and moving the z up and down.



I need to drop out a cabinet of sorts for the cnc before getting into cutting alloy. The last thing I want is alloy chips and drill spirals floating around on the floor and getting trecked into other rooms.

Thursday, December 8, 2016

3040 for alloy

I have finally fired up a 2.4kw 24,000 rpm spindle on the test bench. This has water cooling and is VFD controlled. The spindle runs on 3 phase AC power.



One thing that is not mentioned much is that the spindle itself and bracket runs to around 6-7kg. Below is the spindle hitting 24,000 rpm for the first time.


With this and some other bits a 3040 should be able to machine alloy.

Tuesday, November 1, 2016

Houndbot progresses

All four new shocks are now fitted! The tires are still deflated so they look a little wobbly. I ended up using a pillow mount with a 1/4 inch channel below it. The pillow is bolted to the channel from below and the channel is then bolted from the sides through the alloy beams. The glory here is that the pillows will never come off. If the bolts start to vibrate loose they will hit the beam and be stopped. They can not force the pillow mount up to get more room because of the bolts securing the 1/4 inch channel to the alloy beams coming in from the sides.


I'm not overly happy with the motor hub mount to wheel connection which will be one of the next points of update. Hopefully soon I will have access to a cnc with a high power spindle and can machine some alloy crossover parts for the wheel assembly. It has been great to use a dual vice drill and other basic power and hand tools to make alloy things so far. But the powerful CNC will open the door to much 2.5D stuff using cheapish sheet alloy.

But for now, the houndbot is on the move again. No longer to the wheels just extend outward under load. Though I don't know if I want to test the 40km/h top speed without updating some of the mountings and making some bushings first.