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

Changes to Readme to explain where to change time/step, step resolution, etc. #25

Open
frankbraker opened this issue Sep 17, 2023 · 2 comments

Comments

@frankbraker
Copy link

So things look really great right now - in that they seem like they are within reach.

I am sort of confident that I could try to manually change the time/step and the step resolution and get my hardware to work with the moonlite focuser I have.

However, I'd really like to follow the directions on the tin, and right now there isn't a lot of detail in this domain.

When I just build what is at the top of the latest branch, and run it, I believe I had hard-wired my driver to use 1/2 steps, or maybe 1/4 steps. So that might be a problem for starters.

If I change nothing, I find that the Moonlite ASCOM driver limits how many steps can be traversed by 10,000. But if I try to move 10,000 steps, it doesn't move very far - less than a millimeter. This means I probably got a wire lose to the coils, or backwards. But it's strange because I can use the buttons and they seem to work - or at least they did work fine at one point. Regardless of all this, it would be really nice to have it pointed out in the README file where to look in the code for fine tuning the firmware to match the configuration of hardware in use.

@fehlfarbe
Copy link
Owner

Hi!
Sorry, I had too much work to do the last days. Maybe I will find some time this week to add some more tips for beginners to the readme and move some default values to macros. If you leave the MSx pins unconnected on the driver it should already work in full step configuration:

grafik
(I will add a link to the Polulu doc)

At least I finished my focuser dev board so I don't have to fiddle around with loose breadboard connections anymore 😃
IMG_20230919_121412

I'm also planning to implement the arduino web uploader ( https://github.com/dbuezas/arduino-web-uploader ) for this project so beginners don't have to install platformio and can flash their Arduino via browser.

fehlfarbe added a commit that referenced this issue Sep 23, 2023
@frankbraker
Copy link
Author

frankbraker commented Sep 24, 2023

Those are okay, and thanks for trying to answer my question.

What I was really asking for are the variables in the code that could be better documented. Right now I'm just guessing at what is okay to change and what I would be better off leaving alone.

Here are the #defines / variables that could be a little better documented:

#define BTN_IN 7
#define BTN_OUT 8

FB What's this BTN_POTI_SPEED?

#define BTN_POTI_SPEED A0
#define BTN_MIN_SPEED 8

FB Can this be increased?

#define BTN_MAX_SPEED 512

FB Assuming BTN_ACCEL_FACTOR doesn't affect movement with the driver. Can this be changed to 10.5f and still should be fine?

#define BTN_ACCEL_FACTOR 1.05f

#define PIN_DRIVER_SLEEP 4
#define PIN_DRIVER_DIR 3
#define PIN_DRIVER_STEP 5

#define ONE_WIRE_BUS 2

FB Is it okay to change PERIOD_US? What are recommended values if the current stepping is way too slow?
FB I had changed this on the earlier code to #define PERIOD_US 250, which seemed to make everything run pretty well. So I'll give that a try on this later code. Still would like to hear your comments on the proper way to address these issues.

#define PERIOD_US 2000

// #define USE_DRIVER

// #define DEBUG
#ifdef DEBUG
SoftwareSerial debugSerial(9, 10);
#else
DummySerial debugSerial;
#endif

// initialize the stepper library
#ifdef USE_DRIVER
AccelStepper stepper(AccelStepper::DRIVER, PIN_DRIVER_STEP, PIN_DRIVER_DIR);
#else
AccelStepper stepper(AccelStepper::FULL4WIRE, 6, 4, 5, 3, false);
#endif

// multiplier of SPEEDMUX, currently max speed is 480.

FB: Where is SPEEDMUX? Did you mean speedMult?
FB: If I up the speed factor to 32, 64, 128, 256, 512, 1024, 2048 is that okay?

int speedFactor = 16;
int speedFactorRaw = 4;
int speedMult = 30;

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

No branches or pull requests

2 participants