evil-mad / robopaint

The software for your friendly painting robot kit!
126 stars 34 forks source link

Add support for third brush vertical position, for washing the brush #71

Closed oskay closed 11 years ago

oskay commented 11 years ago
techninja commented 11 years ago

Not to open the can of worms... but this kinda opens the can of worms I'd been avoiding for a bit.

The proper way to manage this:

The cheap hack for managing this:

oskay commented 11 years ago

Cheaper-yet hack: Do not modify CNCserver.

Use existing functionality of CNCserver to change pen-up and pen-down position when needed. With the present design of CNCserver, these are configured in the settings; so it should be possible to change the setpoints when needed.

Basic idea: When wash cycle initiates, set pen-down height to WASH level. When wash cycle completes, set pen-down height back to PAINT level.

techninja commented 11 years ago

Yes, yes.. that would work. I think I had that in my brain at some point, just got stuck on thinking of it as a CNCserver thing.

I am hesitant to implement this, (though less hesitant if it only touches Robopaint), for the following reasons:

One benefit of doing it this way, is retaining simplicity. Adding full height range and named positions adds complexity, but far more control. Though in theory would could operate the API in the exact same v1 spec definition.


Two options moving forward:

  1. Implement this as a quick hack (and optionally add height min/max setting to the API to allow for similar usage in API based apps)
  2. Implement this in the proper API way, with named heights and Robopaint adjusted to work with it
oskay commented 11 years ago

For washing, we want to be able to lower the brush as much as possible, so it's probably a good idea, to at least implement it as a quick hack.

I do not think that we need CNCserver to be aware of multiple named positions at this time. Suggested future modification at techninja/cncserver#40

techninja commented 11 years ago

Alright, alright. Issue to manage the "future" modification should be at https://github.com/techninja/cncserver/issues/18 , and the settings API access at https://github.com/techninja/cncserver/issues/40 should be implemented "along with" this hack. Should be very straightforward anyways, thanks to nconf.

One side issue is retained here: When actively setting the height, it helps to see what the height is by changing it on the bot, but there's currently no reset of the pen back to its original state once complete. This actually messes up assumed state in Robopaint as well. Should this be stored on settings entry and reset on settings exit? If so, should be filed under a new issue.

oskay commented 11 years ago

I suggest resetting the pen height back to "up" when closing the settings dialog.

techninja commented 11 years ago

Settings modal dialog currently does not pause progress or spooling/printing, therefore forcing the pen up on settings close willy nilly may be a bad idea. Perhaps only after height adjustment?

oskay commented 11 years ago

So... currently, you can adjust the pen heights while printing? Sounds pretty iffy!

techninja commented 11 years ago

Yes, among other things. It's actually somewhat handy for some things. That one specifically sounds like a recipe for disaster.