Friday 16 August 2024

Updating the Centroid Lathe PLC code with ATC turret mods

Previously, I edited the Centroid Lathe PLC code to make it work with my ATC turret. The reason for this is that the generic turret options that come with the wizard expect some form of 3 line Graycode signal (similar to BCD) from the turret to tell the controller what tool position is currently in play. However, my turret (supplier unknown) actually uses 8 individual lines, one per position. I have enough spare digital inputs on the ETHER1616 expansion board to handle those extra signals, so the challenge was to modify the logic code to recognise these inputs rather than the Graycode that is expected by default.

All has been working fine since those mods were made - except from the tool touch-off functions that are required for automatically measuring the tool offsets. Previously I tore out large clumps of my hair trying to make head or tail of the behaviour before concluding that I wasn't going to be able to fix it myself. It would clearly require the Centroid engineers to dig into the code and fix what were evidently some logical errors in the offset calculation. As the lathe users appear to be fairly thin on the ground relative to the number of mill, router and plasma users, this wasn't going to happen any time soon.

That time seems to have come finally. There's a beta release that sounds as if it may have fixed some of these issues, so let's have a go at installing it and trying it out.

The update process for my system is as follows:

  • Open CNC12, run the settings wizard and take screenshots of all the settings screens. NB: For subsequent versions, hitting Ctl-P will automatically save the as PDFs.
  • Save the current (4.80) installation by renaming the C:\cnct folder to something like C:\cnct_4.80. You can easily revert back to this working version at any time by simply renaming it back to c:\cnct
  • Create a fresh install from the downloaded link (5.19 beta in this case)
  • Run the wizard and copy the settings across from the PDF screenshots.
  • Update the ATC-related parameters in the config > parameters screen:
    • P160 >> 1 [enhanced ATC:1 = Nonrandom]
    • P264 >> 7 [rapid rate override display - actually non-ATC]
    • P830 >> 4 [ATC type: 4 = Graycode 1 output]
    • P849 >> 10 [toolchange timeout TimerDefault = 10]
    • P851 >> 0.1 [ATC time before reversing]
  • Using Visual Studio Code or Notepad++, open the acorn_lathe_plc.src source file from the c:\cnct folder and comment out or delete the following content...
=========================================================================
                               ATCGrayCodeStage
;=========================================================================
; Check input based on parameter bits to determine tool location
IF !(ToolTurretPosBit1 ^ P831Bit0) && !(ToolTurretPosBit2 ^ P831Bit1) 
 && !(ToolTurretPosBit3 ^ P831Bit2) && !(ToolTurretPosBit4 ^ P831Bit3)
 && SV_MACHINE_PARAMETER_161 >= 1 THEN CurrentTurretPosition_W = 1
IF !(ToolTurretPosBit1 ^ P832Bit0) && !(ToolTurretPosBit2 ^ P832Bit1) 
 && !(ToolTurretPosBit3 ^ P832Bit2) && !(ToolTurretPosBit4 ^ P832Bit3)
 && SV_MACHINE_PARAMETER_161 >= 2 THEN CurrentTurretPosition_W = 2
IF !(ToolTurretPosBit1 ^ P833Bit0) && !(ToolTurretPosBit2 ^ P833Bit1) 
 && !(ToolTurretPosBit3 ^ P833Bit2) && !(ToolTurretPosBit4 ^ P833Bit3)
 && SV_MACHINE_PARAMETER_161 >= 3 THEN CurrentTurretPosition_W = 3
IF !(ToolTurretPosBit1 ^ P834Bit0) && !(ToolTurretPosBit2 ^ P834Bit1) 
 && !(ToolTurretPosBit3 ^ P834Bit2) && !(ToolTurretPosBit4 ^ P834Bit3)
 && SV_MACHINE_PARAMETER_161 >= 4 THEN CurrentTurretPosition_W = 4
IF !(ToolTurretPosBit1 ^ P835Bit0) && !(ToolTurretPosBit2 ^ P835Bit1)
 && !(ToolTurretPosBit3 ^ P835Bit2) && !(ToolTurretPosBit4 ^ P835Bit3)
 && SV_MACHINE_PARAMETER_161 >= 6 THEN CurrentTurretPosition_W = 5
IF !(ToolTurretPosBit1 ^ P836Bit0) && !(ToolTurretPosBit2 ^ P836Bit1)
 && !(ToolTurretPosBit3 ^ P836Bit2) && !(ToolTurretPosBit4 ^ P836Bit3)
 && SV_MACHINE_PARAMETER_161 >= 6 THEN CurrentTurretPosition_W = 6
IF !(ToolTurretPosBit1 ^ P837Bit0) && !(ToolTurretPosBit2 ^ P837Bit1)
 && !(ToolTurretPosBit3 ^ P837Bit2) && !(ToolTurretPosBit4 ^ P837Bit3)
 && SV_MACHINE_PARAMETER_161 >= 7 THEN CurrentTurretPosition_W = 7
IF !(ToolTurretPosBit1 ^ P838Bit0) && !(ToolTurretPosBit2 ^ P838Bit1)
 && !(ToolTurretPosBit3 ^ P838Bit2) && !(ToolTurretPosBit4 ^ P838Bit3)
 && SV_MACHINE_PARAMETER_161 >= 8 THEN CurrentTurretPosition_W = 8
IF !(ToolTurretPosBit1 ^ P839Bit0) && !(ToolTurretPosBit2 ^ P839Bit1)
 && !(ToolTurretPosBit3 ^ P839Bit2) && !(ToolTurretPosBit4 ^ P839Bit3)
 && SV_MACHINE_PARAMETER_161 >= 9 THEN CurrentTurretPosition_W = 9
IF !(ToolTurretPosBit1 ^ P840Bit0) && !(ToolTurretPosBit2 ^ P840Bit1)
 && !(ToolTurretPosBit3 ^ P840Bit2) && !(ToolTurretPosBit4 ^ P840Bit3)
 && SV_MACHINE_PARAMETER_161 >= 10 THEN CurrentTurretPosition_W = 10
IF !(ToolTurretPosBit1 ^ P841Bit0) && !(ToolTurretPosBit2 ^ P841Bit1)
 && !(ToolTurretPosBit3 ^ P841Bit2) && !(ToolTurretPosBit4 ^ P841Bit3)
 && SV_MACHINE_PARAMETER_161 >= 11 THEN CurrentTurretPosition_W = 11
IF !(ToolTurretPosBit1 ^ P842Bit0) && !(ToolTurretPosBit2 ^ P842Bit1)
 && !(ToolTurretPosBit3 ^ P842Bit2) && !(ToolTurretPosBit4 ^ P842Bit3)
 && SV_MACHINE_PARAMETER_161 >= 12 THEN CurrentTurretPosition_W = 12
IF !(ToolTurretPosBit1 ^ P843Bit0) && !(ToolTurretPosBit2 ^ P843Bit1)
 && !(ToolTurretPosBit3 ^ P843Bit2) && !(ToolTurretPosBit4 ^ P843Bit3)
 && SV_MACHINE_PARAMETER_161 >= 13 THEN CurrentTurretPosition_W = 13
IF !(ToolTurretPosBit1 ^ P844Bit0) && !(ToolTurretPosBit2 ^ P844Bit1)
 && !(ToolTurretPosBit3 ^ P844Bit2) && !(ToolTurretPosBit4 ^ P844Bit3)
 && SV_MACHINE_PARAMETER_161 >= 14 THEN CurrentTurretPosition_W = 14
IF !(ToolTurretPosBit1 ^ P845Bit0) && !(ToolTurretPosBit2 ^ P845Bit1)
 && !(ToolTurretPosBit3 ^ P845Bit2) && !(ToolTurretPosBit4 ^ P845Bit3)
 && SV_MACHINE_PARAMETER_161 >= 15 THEN CurrentTurretPosition_W = 15
IF !(ToolTurretPosBit1 ^ P846Bit0) && !(ToolTurretPosBit2 ^ P846Bit1)
 && !(ToolTurretPosBit3 ^ P846Bit2) && !(ToolTurretPosBit4 ^ P846Bit3)
 && SV_MACHINE_PARAMETER_161 >= 16 THEN CurrentTurretPosition_W = 16

IF TRUE THEN SV_PLC_CAROUSEL_POSITION = CurrentTurretPosition_W
  • ...then paste the following section to replace the content you just commented out or deleted:
;===========================================================
                               ATCGrayCodeStage
;===========================================================
; EME 2024-08-09 ATC control trials
; Input 1 on Ether1616 with A0 address = CNC12 input 33 etc
; IF Tool1Input THEN CurrentTurretPosition_W = 1
; IF Tool2Input THEN CurrentTurretPosition_W = 2
; etc...
IF TRUE THEN CurrentTurretPosition_W = 0
IF INP33 THEN CurrentTurretPosition_W = 1
IF INP34 THEN CurrentTurretPosition_W = 2
IF INP35 THEN CurrentTurretPosition_W = 3
IF INP36 THEN CurrentTurretPosition_W = 4
IF INP37 THEN CurrentTurretPosition_W = 5
IF INP38 THEN CurrentTurretPosition_W = 6
IF INP39 THEN CurrentTurretPosition_W = 7
IF INP40 THEN CurrentTurretPosition_W = 8
IF TRUE THEN SV_PLC_CAROUSEL_POSITION = CurrentTurretPosition_W
; EME end of substitution
  • Change to the cnct folder and compile the modified acorn_lathe_plc.src file to create the mpu.plc file using the following commands in a CMD window:
    • cd c:\cnct
    • mpucomp acorn_lathe_plc.src mpu.plc
  • Run CNC12 and follow the instructions - you will need to let it reflash the Beaglebone and cycle the Acorn before you can expect it to work consistently.
That should do the trick. And sure enough it works - once you remember to update the parameters that is. So: install new CNC12, update parameters and modify the plc code.

Friday 9 February 2024

Final assembly and test of the spindle nose adaptor - RESULT!!

After the recent distraction caused by the 3D scanner, resurrecting the 3D printer and buggering about with the throttle bodies for my Honda S800 engine, the spindle nose adaptor has seen no action.

On the face of it, there should be little more left than to assemble the parts and test the runout. The big, big question is - is the runout remotely acceptable? I will be more than just slightly pissed off if there's any noticeable runout after all the time and care I've put into this thing. 

Last time round, I was preparing to finish machine the taper and face while mounted in place on the lathe spindle. Here's what happened.

Finish machining:

Let's go Fatty.




Phew - no cockups yet. We will leave it there:


There's a slight burr at the join of the taper and the face that fouls the register on the chuck backplate. I manually machined that off:


Now the face needs to be skimmed back, as there is still a rattle fit on the taper. How much? Plastigauge to the rescue. The taper is 7.125 degrees, so each mm of reduction in the radius of the taper will result in an 8mm needing to be removed from the axial position of the face, since Tan(7.125) = 1/8. I ensured the gap was on the Plastgauge side when squashing the backplate up against the spindle tape, so the 150um represents the total diametric gap.


With a radial gap of 150um/2 = 75um, I need to skim the face about 0.6mm axially (=75um x 8). Perhaps a bit more than I'd planned but there's not much I can do. Obvs if that gap were too big, I'd find problems getting the cams to tighten up...


How's that looking?


Really rather good!

There. Job done. Good tight fit on the taper and no cockups along the way.

What about the runout?

The next (final?) step is to do the final assembly and check the runout. Firstly, the grubs screws that hold the cams need to be ground back a little. Skimming 0.6mm off the face of the adaptor has made them stick out slightly proud of the adap[tor body so that the chuck can't sit flush. A quick spell on the belt sand does the trick


The Multisize collet chuck is probably the most accurate chuck I have, so let's use it to do a proper runout test. This is the internal taper that the collets locate against. The runout barely registers on this 10um DTI, so is of the order of 1um or so and most of this is surface roughness rather than actual runout.


And here's the proof:

I think we can call that a success. Thank fuck for that. And woohoo - I've actually finished a job for once in my life!

Sunday 31 December 2023

CAD time - couple CBR600RR throttle bodies to my 1967 Honda S800 engine

Having played with the 3D scanner and dismissed this as a sensible means of "designing" stuff, I'm going to focus on CAD solutions for connecting up the throttle bodies and crafting some sort of airbox solution for this setup.

Here's the current arrangement - the throttle bodies (ITBs) are only loosely held in place here on the S800 intake manifold, to illustrate the general concept:


I've previously hacked off the bottom of the original CBR600RR airbox, "leaving for later" the question of how to close it up again. The original airbox fouled the alternator.


The secondary injector bank sits in front of the intake trumpets. They only come on at high engine speeds and throttle settings.



It's ages since I last fiddled with this setup. Back then, my solution to matching the ITBs to the engine were these aluminium adaptors. They are needed because the engine ports are slightly Siamesed in pairs. 


Each pair of ports (1 and 2, 3 and 4) are on 65mm centres. But overall, the ports on the engine are spaced such that the average spacing across the 4 cylinders is 74mm, which is rather handy given that the CBR600RR ITBs have a consistent spacing of.....74mm across all 4 ports. If you do the math, that means each inlet in a Siamesed pair requires a 4.5mm offset.

I went with this hooky solution because it was the best I could do back then. These were made by clamping some thick wall aluminium pipe eccentrically by 2.25mm in the 4 jaw, then machining each end (manually). Ideally, the porting would be flowed to avoid sudden discontinuities. I had imagined that I would do this manually at some later date using a hand held burr.



The inlet ports are somewhat less than free flowing with those steps at the transitions:


Here's what I plan instead. The rubber adaptors are looking a bit perished after 46 years, so it may be rather foolish to design around them. Instead, I will mount my new adaptors direct to the water cooled inlet manifold. This means the mounting surface could see ~100C which is a bit hot for most 3D printed materials. However, the solution may simply be to make a heat insulator plate from Acetal / PEEK or similar. I can deal with that later.


Using the Loft function, I can sort of align the inlet and outlet so they transition more smoothly.


Let's try out the idea in PLA. Obvs I won't be using PLA on a real (hot) engine with gasoline but this should give me an idea if the concept is workable. I'd probably get them made by one of the online providers using something more sensible like glass filled PETG or perhaps some sort of SLA material.


The weak point will be the relatively narrow (thin) neck that mates with the rubber connector at the back of the ITBs. One solution might be to make a short metal insert that fits into the plastic body - but this would require some new materials that I don't currently have and some machining thereof.

Revopoint POP3 3D scanner!!

What up?
I'm sort of preparing myself to get involved with my 1967 Honda S800 coupe again. It's been salted away for the last 30 years (family, kids etc) and deserves to be brought back to life. Rightly or wrongly, I decided to replace the original quad carb setup with a fuel injection system. Nobody knows why - but either way I am some way down the road with it, having hacked the fuel tank about and fitted it with a high pressure fuel pump, so there seems to be no going back.

The main activity remaining is finishing off the airbox, ideally in such a way I can incorporate an air filter. The issue being that the original CBR600RR airbox clashes with the alternator.

Here's the intake side of the engine:



And after a few hours buggering about with the scanner, I've got a sort of result. Ish.








Hmm. Quite a few bits missing here. Here's what the scanning process looks like when you have parts that are small enough to fit on the (Bluetooth controlled) turntable:


The throttle bodies are almost recognisable here, but this is hardly a breathtakingly accurate model. 


I seem to be stuck between 2 extremes: on the one hand, to get decent scanning (ie without losing "tracking" continuity), you need lots of features that the software can recognise and use to stitch together the hundreds of scans, yet wtih too many features, the software is easily overwhelmed. I seem to have fallen foul of the latter. 

Conclusions:
For now, I will conclude that these scanners are good for scanning smallish, organic shapes eg broken handles, hooks, housings etc, thus avoiding having to fully design stuff in CAD. For larger components such as my throttle body assembly, I will be better off sticking to conventional CAD. Must say, I'm somewhat less than surprised at this finding.

Certainly, I'm clearly not going to be able to create a meaningful engine and throttle body model that I can sensibly manipulate within Fusion 360, so for now the scanner will go back in its box while I stick to CAD.

Not vastly surprised or disappointed but it's good to have some clarity as to whet this is good for. And yes, I wouldn't have bought this if it hadn't been for the "season of giving".

Wednesday 27 December 2023

Cetus3D printer comes out of hibernation

What's the deal, fatty?

Ages ago (about 5 years ago), I acquired a Cetus3D Mk II that I used to print some parts for my Bridgeport conversion, namely a junction box for the DMM Tech servo motors ....


....and a box to house the differential line driver PCBA I made, to enable me to replace the rather ropey cables and rather non-industrial (9 pin D-sub!) in-line connectors that were supplied by DMM Tech with pukka drag cables. 

The original cables included a line driver in a small PCB wedged inside the D-sub connector housing at the controller end of the cable, to complement the line driver that is housed in the back of the servo motor's encoder housing - so replacing the cables required me to source or make a slightly more workmanlike line driver. i couldn't find anything sensible off the shelf, so came up with this one:


This 3D printer came with proprietary software from Tiertime for the slicing and machine control functions (and even an app, although only available in iOS). It worked pretty well, allowing wireless control of the machine and a reasonable user interface. 

For some reason (although nobody knows why), I subsequently bought an "upgrade"(?) kit from another supplier called TinyfabXYZ comprising a replacement CPU board, some actual limit (micro)switches and an LCD display with thumbwheel input. The notion was that this would give me some additional functionality, less reliance on the proprietary software, proper limit switches (although the "stall" method worked fine) and local control of the machine from the (new) front panel. 

To be fair on myself, the Tiertime slicer / control app is very limited in terms of the control you have over the printing settings compared with the likes of Cura, whereas the Tinyfab program runs g code and allows you to generate the code from within an external app such as Fusion 360.

Let's finally get round to installing this Tinyfab stuff and see what it's all about. Here's the standard machine, reassembled:


Cover removed:


And these are the various parts required to fit the microswitches. I printed those before putting the unit into storage 4-5 years ago.


Let's fit the microswitches. Even if I decide the Tinyfab stuff is no improvement on the original system, these can be retained for use with the Cetus controller. I'd prefer a proper switch to the default arrangement which drives the axes into their hard stop and detects the motors stalling - this scheme works well enough but isn't very elegant.

X axis:



Y axis


Z axis:


The switches need a bit of tweaking to make a more dependable contact with the end stops:


That's better:


They plug in to the original headers, replacing the "stall" signals from the stepper driver modules.


Need to move the power and initialisation switches and status LED across to the new cover:


The new LCD display connects up to the replacement CPU board.


Seems to work, once you've put the config file on the correct SD card. There is a SD card slot on the display as well as one on the main PCBA. The update "instructions" such as they are don't tell you which one they mean - it's the main board one, which programs the main CPU, not the one on the display unit, which is intended for loading g code if you don't connect via wifi.


Lid back on:


Does it work?
Well yes, it comes to life once again, this time with a different brain:



Well, that didn't go well. Setting the Z height is a PITA - it really needs a proximity switch but for now that would have to wait. I also struggled to figure out how to set up the G54 coordinates ie where Z0 is, where X0Y0 is etc, with the result that when I tried to run a job, it tried to exceed the axis limits. The documentation is "limited" to say the least, so I'd need to experiment (fuck about) with the machine to figure it out. This isn't what I want to spend my time doing, TBH.

Before getting too carried away with the Tinyfab stuff, let's revert to the Cetus setup and check it still runs properly. Having installed the switches, config and firmware, it's a reasonably quick and easy process to swap between the two setups.

Reverting back to the Cetus. 

This is one of the "primitive" test pieces selected from the main menu, printed twice. Looks pretty good. I used the fast / coarse settings to save time.



Not sure where the part starts and the raft finishes?


A closer look at the slicer, to get a clue:



Aha. Both steps need to be jettisoned:


Pretty good dimensional control in X and Y:




And also Z, once I'd figured out where the true bottom of the part started:



Removing the "raft"(?) was a PITA - perhaps there are some settings that will improve that - but for now, not a bad result.

Conclusion:
  • The Tiertime (Cetus) software is clunky and very limited. Also fucking frustrating, which I recall is one of the reasons I bought the Tinyfab kit. On the upside, they continue to support and update it to some degree, as they are still producing new printer models. Having said that, I'm not seeing any significant improvement in terms of the parameters you can access and control, such as the wall thickness, acceleration etc. And the nozzle preheat / filament loading controls are shit.
  • The Tinyfab kit is also pretty frustrating, although the ability to control settings via Fusion 360 may be its redemption. I may need to look more closely at that.
  • Loading g code to the Tinyfab via the micro SD card is another PITA, as the slot is difficult to access and you can lose the card inside the display housing if you don't stick it into the socket correctly. There is an ESP32 (wifi) unit on the CPU board, so it should be possible to load wirelessly. I forget if I managed to suss that out.
  • Tinyfab don't seem to have followed up since I acquired their kit 4-5 years ago. The support forum is almost nonexistent and the technical documentation is rudimentary to say the least. That's not encouraging.
  • The machine envelope is actually pretty tiny, at 180 x 180 x 180mm. That's fine for small components but for anything else, it's a bit of a toy.
That will do for now....

Updating the Centroid Lathe PLC code with ATC turret mods

Previously, I edited the Centroid Lathe PLC code to make it work with my ATC turret . The reason for this is that the generic turret options...