jbrazio / ardufocus

:telescope: The most accurate Open Source focus controller
https://ardufocus.com
GNU General Public License v3.0
52 stars 19 forks source link

#define MOTOR1_USE_DRV8825_DRIVER ( DRV8825) not working #29

Closed luizrsilveira1 closed 2 years ago

luizrsilveira1 commented 2 years ago

First of all, thank you for this amazing project. Is the only DIY focuser I can use on NINA without any issues.

However, I can't figure out how to make it work with the DRV8825.

On the config.h file, there are 3 options, which the user must select only one. This is the default:

#define MOTOR1_USE_A4988_DRIVER
//#define MOTOR1_USE_DRV8825_DRIVER
//#define MOTOR1_USE_ULN2003_DRIVER

That is, the user can choose between the A4988, the ULN2003, and the DRV8825. This is also mentioned on the "Firmware" page with instructions here: https://ardufocus.com/manual/firmware/

Unfortunately, the DRV8825 doesn't seem to have been implemented yet. Forgive me if I'm wrong. :P

Right below these options, in the config.h file, I found two "IF"s. One for the A4988, and another for the ULN2003. But none for the DRV8825:

// Driver pin-out definition
// Define bellow the pin-out for your specific driver.
#ifdef MOTOR1_USE_ULN2003_DRIVER
  //                    IN1, IN2, IN3, IN4
  #define MOTOR1_PINOUT   2,   3,   4,   5
#endif

#ifdef MOTOR1_USE_A4988_DRIVER
  //                    MS1, MS2, MS3, SLEEP,  STEP, DIR
  #define MOTOR1_PINOUT  12,  11,  10,     8,     7,   6
#endif

After that, the next lines refer to other settings, such as sleep when idle, etc.

That said, as expected, we can't compile or upload the code to the Arduino when the option "MOTOR1_USE_DRV8825_DRIVER" is defined.

As I'm learning how to code yet, I'm not sure if this is in fact something that needs to be implemented, or if I'm missing something.

Thank you!


EDIT: Looking on other files, I found this on the assert.h:

// DRV8825 driver hack --------------------------------------------------------
#if defined(MOTOR2_USE_DRV8825_DRIVER)
  #define MOTOR2_USE_A4988_DRIVER
#endif

Even so, the code won't compile.

Can I interpret that defining "MOTOR1_USE_A4988_DRIVER" on config.h would work just fine with the DRV8825? Of course, correcting the connections for the variations of the DRV8825.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.