Hello! I am a fourth year mechanical engineering student. For my final year Capstone design project I am designing an abrasive quality testing machine which will mimic manual sanding conducted by technicians. In other words, I am designing a 2 axis gantry CNC (y and z axes). During operation, it is essential that the downward force applied by my spindle onto my work piece remains constant. To do this, I would like to use input from a load cell to control/actuate the vertical displacement of the z-axis. This load cell will be placed under my t-slot plate where my work piece is placed. Does anyone know if this is possible? Is there a way to set-up a load cell as an input and use conditional code to control my z-displacement? This is my first time using GRBL so any help would be greatly appreciated!! NOTE: I have included a simple block diagram of the control system I would like to obtain.
Why GRBL? GRBL is for complex coordinate geometry. Sounds like you're needing a simple back and forth or a basic pattern combined with pressure control. That's a simple Arduino sketch, something you can easily develop and control. Why try to force GRBL to do something it's not designed for?
I was hoping to be able to control my axes as well as my spindle RPM from GRBL so everything's in one place. Also, as I mentioned,I'm very new to the world of CNC machining so I wasn't sure what capacities the software has. If you think using Arduino is the best route I'll look into it! Would you happen to have information or parts of an Arduino sketch with pressure control?
on the other hand I say keep GRBL for doing what it does best, control of axes. connect the loadcell to the computer that controls GRBL! simple, no so you may need another arduino to read the loadcell and present it to the PC as a value that can be read by a python script. this python script will tie the loadcell to the Z axis to adjust the pressure, and also feed GRBL whatever moves it needs to do for the sanding operation.
Alright, yeah that sounds like it would do the job. Do you know how to implement something like this? If so, could you please elaborate?
Assuming you are using an ordinary PC for control then it does not have any way to read the analog signals from the loadcell. An Arduino can be programmed to do this job and feed the values (on demand) via the USB cable to the PC. You can Google for this, it has been done many times. On the PC the software needs to do some thing like: allow user to set zeros and length of stroke, and desired pressure. then user clicks on 'go' button and it loops through Code: output setup codes (go to start position, set initial pressure, etc) while 'job not finished' send next move from queue to GRBL (next stuff happens while waiting for the end of this move) request loadcell value if loadcell < desired queue 'increase pressure' (essentially a Z move) if loadcell > desired queue 'decrease pressure' wait for end of move There are 2 methods for streaming Gcode to GRBL which you can read about on the GRBL wiki. You want the 'send a line and wait for confirmation' method as illustrated in the sample script in the Wiki. You would need to extend that script to open a second serial port to the loadcell reader and so on. The user needs a user interface. This can be done as a separate script or as part of the control script. You can use Tkinter to make a point and click interface within Python. Again, you can google this stuff. as an alternative I think this can be done with off the shelf parts by separating the pressure control from the motion control. in this case Z would need to be some sort of servo drive (not controlled by GRBL), probably controlled by a PLC that reads the loadcell and directly controls the servo to adjust pressure using a PID loop. In this case the GRBL functionality can be controlled by any standard GUI like OpenBuildsCONTROL and the PLC can be activated via the 'coolant' control with an M7 for on and M9 for off. Again, plenty of Google resources for PLC's and loadcells etc.
Thank you very much!! I didn't have much of an idea where to begin, but your advice has helped greatly.