saxi icon indicating copy to clipboard operation
saxi copied to clipboard

brushless

Open benoitwimart opened this issue 1 year ago • 9 comments

Hi,

Is there a way to use Saxi with the brushless kit : https://shop.evilmadscientist.com/productsmenu/else?id=56 By default, it's not look OK :(

benoitwimart avatar Jun 13 '23 15:06 benoitwimart

I will note how to configure saxi for brushless pen-lift servo support. This requires editing (or replacing) a couple of the saxi files. Perhaps someone would prefer to add this as a formal option.

First, locate the saxi files. You can find your npm file location with npm list -g.

For me, on a Mac with homebrew, that lists /opt/homebrew/lib. With that hint,

  • I can find saxi at: /opt/homebrew/lib/node_modules/saxi
  • And, the files to edit are in /opt/homebrew/lib/node_modules/saxi/dist/server

Changes are needed to two files. If you'd like to edit the files by hand, the first section below shows how to do so. If you'd like to just replace the files, I've attached them in the second section below.


Option: Edit the saxi files by hand.

Changes to make:

(1) In ebb.js, change:

        return this.command(`S2,${height},4,${rate},${delay}`);

to

        return this.command(`S2,${height},5,${rate},${delay}`);

(2) In planning.js, in two places, change:

    penDropDuration: 0.12,
    penLiftDuration: 0.12,

to:

    penDropDuration: 0.08,
    penLiftDuration: 0.08,

(3) Also in planning.js, change:

        penServoMin: 7500,
        penServoMax: 28000,

to

        penServoMin: 5400,
        penServoMax: 12600,

After making those three changes, save the files and restart saxi (e.g., launch the server again).


Option: Download & replace files

Attachment: brushless_saxi.zip, containing the two files adjusted as described above. For the current public release as of 2023-06-13, saxi 0.15.0, you should be able to just replace these two files from the zip.


Additional changes

Besides those source files, some of the other "UI" files need to be updated, for example with: In addition to replacing the two files (planning.js, ebb.js), it works to use

sed -i '' 's/penServoMin: 7500/penServoMin: 5400/g' dist/ui/*
sed -i '' 's/penServoMin:7500/penServoMin:5400/g' dist/ui/*
sed -i '' 's/penServoMax: 28000/penServoMax: 12600/g' dist/ui/*
sed -i '' 's/penServoMax:28e3/penServoMax:12600/g' dist/ui/*

in the saxi directory to replace the other pen heights. The '' is required on Mac & BSD, not required on linux.

oskay avatar Jun 13 '23 17:06 oskay

I did this, but pen up and down does not work.

benoitwimart avatar Jun 14 '23 09:06 benoitwimart

I manually update main.js with this value, now it's look ok. main.zip

benoitwimart avatar Jun 14 '23 11:06 benoitwimart

I've edited my response above to include a sed command for the additional files. This now appears to work correctly, in terms of pen heights, both toggling and while plotting.

It would be better to make these changes to planning.ts and ebb.ts, then launch in dev mode. However, I have not yet succeeded in launching in dev mode.

oskay avatar Jun 14 '23 19:06 oskay

Thanks @oskay for this, it was quite helpful. One comment though: the first time I ran this with the recommended settings the spring on the guide rail was compressed so much it popped off. For anyone using the heavy spring I recommend setting penServoMax to 10,000 to restrict the up position.

theophoric avatar Jun 23 '23 17:06 theophoric

You do need to follow the same guidelines that normally apply for using the brushless servo, including setting the pen heights appropriately.

oskay avatar Jun 23 '23 19:06 oskay

The issue I found is that in the cleanup the second to last command pushed raises the pen to the min servo height and moves the head back to 0,0 -- setting a lower height in the print configuration doesn't effect this

theophoric avatar Jun 25 '23 20:06 theophoric

Thanks to @oskay for the changes, and @theophoric for actually implementing them in a fork: https://github.com/theophoric/saxi/commit/467c814999bd2886a539b2889b934d64369d3a3b

I intend to test on real hardware soon.

alexrudd2 avatar Jun 30 '23 23:06 alexrudd2

I use it since the fix was published and it's perfect !

benoitwimart avatar Aug 06 '23 15:08 benoitwimart