Special application pick & place

Hello, this is my first post in this great community.
I want to build a pick and place prototype (special application). I am not sure if the G-code flow is enough to drive the gantry robot for this project, so i may have to drive it by using C++.
I am not familiar with Java, but i like the Smoothieboard (have read the best from users), so i want to use as motion controller the smoothieboard.
The question is, can a C++ based software “talk” to the controller without g-code? The software should be able to read the pins on real time and commands will be send on real time through a routine with feedback.
Thank you for your help in advance

You can target your own C++ code to smoothieboard. You can use smoothieware as an example application; it’s Open Source. grbl-LPC is also Open Source targeting smoothieboard. The smoothieboard loader makes it easy; you compile to firmware.bin, write it to the sd card, and reboot, and the loader sees it and automatically flashes the new firmware. You might find PlatformIO an easy way to get started.

Using Smoothieware and Gcode to talk to your board is the correct way of doing this, and will 100% work.

Smoothie is the official control system for the OpenPNP project, and is used in that context by hundreds of users succesfully. I recommend you read the OpenPNP documentation.

There is absolutely zero reason to whip up your own firmware, the normal one works, and is very well maintained/supported, and has features it’d take you a long time to replicate, with zero benefits for you in doing so.

3 Likes

Thank you very much for your help, it was useful

Just to be clear here, @Arthur_Wolf has the best advice here for your application as described. Motion control can be interesting to get right. I wouldn’t write your own from scratch unless you were doing it for sheer joy of coding from scratch; if you have one small thing that smoothieware doesn’t work for, consider implementing a custom machine code in smoothieware (and sync with @Arthur_Wolf on the details first, and contribute it back!) rather than starting over.

I have a database with records including coordinates. I would like to make a routine that reads those coordinates and executes a real time algorithm with flow control. This is the reason that i dont know if G-code is enough or should i talk directly with C++ . By anyway i prefer to do it using smoothieboard because of its community

What kind of real time flow control? Very likely it’d be easier to add to the real time code in smoothie than start from scratch …

The user selects a set of records and via Ethernet connection , on real time an algorithm should be executed. The objects that have to be picked have variable shapes so its not 100% sure that the nozzle will pick them easily, and most of them will not "block " the airflow so an ordinary pneumatic pick sensor can not be used, but instead i will use an air mass flow sensor , and by comparing its analog values , the algorithm will continue, otherwise there should be a loop which includes activating an platform vibrator, that’s easy, and repeating the pick process. But what’s difficult to me is that this is real time and depends from a database, how to get this work with selecting each time a record set from the database and at the same time executing the algorithm.

Communication ( including via the Gcode http API ) is fast enough, and execution of Gcodes is fast enough, that it should be perfectly fine doing this via http and gcodes, with the logic ( retries ) done on the host.

1 Like

If i run the code (flow control) from host, is it able to read on real time the values/ states of pins (as analog or digital inputs)? if yes, by using G-code commands?

Exactly the best way to do things is going to depend on the specifics of what you are trying to do, but Smoothie does let you read the status of switch modules with the “switch” command ( see wiki ) easily.

What you are describing ( move until something happens, try again if not ) sounds like a job for the G30 gcode ( see the zprobe documentation )

Can you do a “program-like” description of the procedure you are trying to accomplish? I’m still not clear on much of it.

Because there will be patent , I will not write details about the target of the device. Unless someone with excellent knowledge on python or C++ and some modern GUI like QT wants to participate officialy and be included on publication and patent rights.

If you can’t discuss this publicly, what we can do to help will be very limited.

Please email wolf.arthur@gmail.com and I’ll do my best to help you in private.

1 Like