May ’17 AtCore Update.

Its been some time since I’ve posted any progress for AtCore. Some may wonder what we have been up to ..

  • Implimented a Comand Queue

We would like to get some info from the printer while printing we need to have some method of flow control. AtCore now uses a command queue to send all commands. With the command Queue in place we have to handle stop and Emergency stop differently . For example Emergency Stop should skip the queue and be sent as soon as the button is pressed.

  • Requesting Temperatue from the printer

After you connect to a FW plugin every 5 seconds a m105 will be send to the printer and the temperature results are put onto a pretty graph that Patrick made. In order to make the graph work we need read the M105 return and extract the data from it. While our current methods of parsing this info work its very specific to each firmwares return . Since these string can be differnt between fw versions it can crash so we are working on a way to do this better.

  • Cleaned up the test Client Gui

The test clients GUI needed some love. All the widgets now live within a dock and the docks can be arranged how ever the user likes. I’ve also added a status bar to show the status of AtCore. We’ve also added a print job timer and remaining print time estimate. A Seperate axis control for relative was asked for by a user and I’ve added one that Lays wrote some time ago . It works well and allows for movements on 1, 10 or 25 units

  • Fixed the windows build so that It builds and deploys correctly via craft

Lays has been working hard to get atcore buildable via craft. Now we can build and deploy AtCore (and testgui) from craft. After building we had a problem of not finding the plugins on windows and them not deploying to the correct path.I added some instructions for deploy and tweaked plugin detection on window. Everything is now working well.

Advertisements

AtCore: Printing with threads

When connect to a 3d printer with your compuer you are really just connecting to a serial device.  There are some commads you can send it in the form G# and M# commands . These commands do all kinds of stuff every thing from homing the axises to feeding filment and moving the head around. When you slice your model and generate that gcode file you are making generating basicly a long list of comamnds for the printer to follow. The gcode files are plain text and have to be sent out thru a serial device to the printer. Its not complicated to parse the file you just send a command and wait for the printer to  return a message indicated its finished the comamnd and then send the next command. We have had this working for some time using a QEventLoop and a while to keep the loop going until the printer is ready for a new command. This was working wonderfully Untill we realized that we were having some blocking problems when printing. After some discussion tomaz , patrick and I decided the best way to fix this is for us to split the printing to its own thread so it can no longer block other parts by hyjacking the main event loop while printing.

Since I have been done the print function to begin with I figured that I should be the one to move it to a thread. The first thing that I did was move the print function to a new class based on Q_OBJECT. This is the new object that will be our thread. Moving to a thread ment we had to redo how the firmware plugin lets us know the printer is ready for a command. All the communication between the threads has be to done with signals /slot connections so the firmware plugins now send a signal when the printer is ready for a command. This means that we can now process the temperature returns when the machine is not printing. The rest was not to hard. I moved the logic to its new thread and it had to be rewritten to no longer use the QEventLoop but instead use Signals and Slots between the main thread and the print thread. The main logic for print was broken up in to a few smaller functions. The parts were connected with the various signals and slots and thigs begain to work.

Not everything was perfect the first time. It took time to get this all tested and not crashing. This is my first time multithreading so I was a bit conserned about getting it right. I had some typos that made me loose way to much time looking in the wrong place. Quite a few other crashes and problems that were just a result of me being new to threading. However I was finally able to get everything working in the same way it was before only now each print job will have its own thread.

Progress update for AtCore.

A few days ago we hit a milestone in our development of AtCore. We are now able to properly install the libary for general use. Not only is installing a necessary for a libary that you plan to use within other stuff it also means that we can now focus our attention mostly on Atelier. We have now entered that magical time in development when the real world usage begins to drive its development. Thanks to everyone efforts we are almost ready for the next stage. Patrick has been doing reviews on every pull request. While he has been unable to help with as many commits as he would have liked to. His advice and direction in his reviews has been really helpful and has kept our style and code quality at a high level. Tomaz has been busy fixing up AtCore to be a proper KF5 libary with all the cmake deployment parts to go along with it. Most all of the cmake stuff has been written by Tomaz. Lays has been working on Atelier setup and getting all the non AtCore parts working. Thanks to her effort we are now able to use Atcore from Atelier!

As for me i have been adding stuff to AtCore. Since our last progress update a few new things have been added. Emergency Stop this simply allows you to stop the printer using the emergency stop code.It also cleans up any the command queue. Pause/Resume  when paused we store the current location of the head that that way after resume you can move your print head out of the way to access the model.Pause supports a comma seperated string of commands to be sent after pause. For my printer i use "G91,G0 Z1,G90,G1 X0 Y195" when pause this move my head up 1 mm and then pushes my model out toward the front fo the machine. This is useful if you want to maybe put a nut into printed part or change filament durring print and even to corrrect print defects while printing. We have also started to do lay ground work for more status info being picked out from the serial chatter. Setting of the firmware plugin can be done durring connect to force a specific plugin. A progress bar for printing progress. Some cleanup for autodetection of the plugin. There is still things to add to AtCore but it should provide enough for most use cases already!

I have made a package for Arch Linux on the aur (atcore-git). Other distro packages as well as a proper alpha release tarball will hopefully come in not to long. We are currently working on getting a more defined release plan so that we can get user testing as well as have AtCore deployment ready since its a prerequsite of making Atelier. Currently the package comes with the A test panel “AtCoreTest”. You are encouraged to try it out if you have a 3D printer and report back.Since AtCore will be doing all the communication bug testing here is very important.

Even if you don’t have a printer Installing the package and running the test gui to see that it works and the plugins are shows under the firmware combobox correctly will help us.

For anyone wishing to help with packaging. its simple to get install set up

in the root of the source.

cmake -DCMAKE_INSTALL_PREFIX=$(qtpaths –install-prefix) -DCMAKE_LIBARY_PREFIX=lib CMakeLists.txt

make

make install

add -DBUILD_TEST_GUI=ON to build the test gui and set up its install

come join us on freenode in #kde-atelier ;