Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brushless #136

Open
benoitwimart opened this issue Jun 13, 2023 · 9 comments · Fixed by alexrudd2/saxi#114 · May be fixed by #197
Open

brushless #136

benoitwimart opened this issue Jun 13, 2023 · 9 comments · Fixed by alexrudd2/saxi#114 · May be fixed by #197

Comments

@benoitwimart
Copy link

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 :(

@oskay
Copy link

oskay commented Jun 13, 2023

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.

@benoitwimart
Copy link
Author

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

@benoitwimart
Copy link
Author

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

@oskay
Copy link

oskay commented Jun 14, 2023

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.

@theophoric
Copy link

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.

@oskay
Copy link

oskay commented Jun 23, 2023

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

@theophoric
Copy link

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

@alexrudd2
Copy link
Collaborator

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.

@benoitwimart
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants