nornagon / saxi

Tools & library for driving the AxiDraw pen plotter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

brushless

benoitwimart opened this issue · 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 :(

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.

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

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

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.

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.

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

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

commented

Thanks to @oskay for the changes, and @theophoric for actually implementing them in a fork: theophoric@467c814

I intend to test on real hardware soon.

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