×

INDI Library v1.9.8 Released (29 Sep 2022)

Bi-monthly INDI Library released with new drivers and bug fixes.

INDI focuser driver for Waveshare Stepper Motor HAT for Raspberry Pi / Rock Pi

  • Posts: 50
  • Thank you received: 1
I use a 15V 5A power supply, so no issue to expect from this side. I checked the current in one stepper motor coil yesterday, it was up to 0.37A. One thing confused me: only during a pause between two focus operations I could measure a current in the coil, during the focus operation I saw zero current.

Today I used the HAT with a RPi 3B+, same result. I checked the STEP port of DRV8825 with a digiscope and saw a square wave during a focus operation, but none on the output port of the coil.
Also the python demo code did not work at all.

So I conclude that my motor HAT has a defect. I will get it exchanged and in parallel I plan to also install INDI/KStars on plain Buster and see what happens once I have a new HAT. I will report. Thank you so far.
Skywatcher HEQ-5 EQMod | ASI1600MM Pro | ASI EFW | TS61EDPH | ZWO ASI 120MM | Artesky 130mm guidescope | Raspi 4B 4GB | Waveshare Stepper Motor HAT - DIY Focuser | Stellarmate | PixInsight
1 year 6 months ago #69104

Please Log in or Create an account to join the conversation.

  • Posts: 384
  • Thank you received: 95
Since you have some diagnostic tools, also check the ENABLE pin on the DRV8825. Pin 21, right next to the STEP pin. It's active low, so you should read 0V on that pin to enable the driver.

It's only enabled during a focus operation, so you might want to do a long focus operation (one that takes several seconds to complete) to give you time to measure the voltage on the enable pin.
Last edit: 1 year 6 months ago by Kevin Ross.
1 year 6 months ago #69105

Please Log in or Create an account to join the conversation.

  • Posts: 75
  • Thank you received: 5
I install Raspberry OS. indi and compiled driver for waveshare, i see this error:

pi@raspberrypi:~/indi-wmh-focuser/build $ make
Scanning dependencies of target indi_wmh_focuser
[ 20%] Building CXX object CMakeFiles/indi_wmh_focuser.dir/wmh_focuser.cpp.o
In file included from /home/pi/indi-wmh-focuser/wmh_focuser.cpp:34:
/home/pi/indi-wmh-focuser/wmh_focuser.h:56:22: error: \u2018virtual bool IndiWMHFocuser::SyncFocuser(uint32_t)\u2019 marked \u2018override\u2019, but does not override
         virtual bool SyncFocuser(uint32_t targetTicks) override;
                      ^~~~~~~~~~~
/home/pi/indi-wmh-focuser/wmh_focuser.h:57:22: error: \u2018virtual bool IndiWMHFocuser::ReverseFocuser(bool)\u2019 marked \u2018override\u2019, but does not override
         virtual bool ReverseFocuser(bool enabled) override;
                      ^~~~~~~~~~~~~~
/home/pi/indi-wmh-focuser/wmh_focuser.cpp: In constructor \u2018IndiWMHFocuser::IndiWMHFocuser()\u2019:
/home/pi/indi-wmh-focuser/wmh_focuser.cpp:87:66: error: \u2018FOCUSER_CAN_SYNC\u2019 was not declared in this scope
  FI::SetCapability(FOCUSER_CAN_ABS_MOVE | FOCUSER_CAN_REL_MOVE | FOCUSER_CAN_SYNC | FOCUSER_CAN_REVERSE);
                                                                  ^~~~~~~~~~~~~~~~
/home/pi/indi-wmh-focuser/wmh_focuser.cpp:87:66: note: suggested alternative: \u2018FOCUSER_CAN_ABORT\u2019
  FI::SetCapability(FOCUSER_CAN_ABS_MOVE | FOCUSER_CAN_REL_MOVE | FOCUSER_CAN_SYNC | FOCUSER_CAN_REVERSE);
                                                                  ^~~~~~~~~~~~~~~~
                                                                  FOCUSER_CAN_ABORT
/home/pi/indi-wmh-focuser/wmh_focuser.cpp:87:85: error: \u2018FOCUSER_CAN_REVERSE\u2019 was not declared in this scope
 ity(FOCUSER_CAN_ABS_MOVE | FOCUSER_CAN_REL_MOVE | FOCUSER_CAN_SYNC | FOCUSER_CAN_REVERSE);
                                                                      ^~~~~~~~~~~~~~~~~~~

/home/pi/indi-wmh-focuser/wmh_focuser.cpp:87:85: note: suggested alternative: \u2018FOCUSER_CAN_REL_MOVE\u2019
 ity(FOCUSER_CAN_ABS_MOVE | FOCUSER_CAN_REL_MOVE | FOCUSER_CAN_SYNC | FOCUSER_CAN_REVERSE);
                                                                      ^~~~~~~~~~~~~~~~~~~
                                                                      FOCUSER_CAN_REL_MOVE
/home/pi/indi-wmh-focuser/wmh_focuser.cpp: In member function \u2018virtual bool IndiWMHFocuser::ISNewSwitch(const char*, const char*, ISState*, char**, int)\u2019:
/home/pi/indi-wmh-focuser/wmh_focuser.cpp:227:34: error: \u2018FocusMaxPosN\u2019 was not declared in this scope
     FocusAbsPosN[0].value = (int)FocusMaxPosN[0].value / 100;
                                  ^~~~~~~~~~~~
/home/pi/indi-wmh-focuser/wmh_focuser.cpp:227:34: note: suggested alternative: \u2018FocusAbsPosN\u2019
     FocusAbsPosN[0].value = (int)FocusMaxPosN[0].value / 100;
                                  ^~~~~~~~~~~~
                                  FocusAbsPosN
make[2]: *** [CMakeFiles/indi_wmh_focuser.dir/build.make:63: CMakeFiles/indi_wmh_focuser.dir/wmh_focuser.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/indi_wmh_focuser.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Why?
 
INDI/KStars on Raspberry Pi 4, 4gb
Raspberry Bull 64bit
Skywatcher 150PDS
CGE-PRO Mount
Nikon D5300 Camera
ZWO183MM
ZWO ASI120mm
Whaveshave focuser
1 year 6 months ago #69106

Please Log in or Create an account to join the conversation.

  • Posts: 384
  • Thank you received: 95
Raspberry OS (Raspbian) has outdated (version 1.7.5) INDI in its repository (latest is 1.8.9). That's why I build INDI and KStars from source, to get the latest.
1 year 6 months ago #69107

Please Log in or Create an account to join the conversation.

  • Posts: 50
  • Thank you received: 1
I checked the voltage on enable pin.
Before I start the demo code, it is at around 0.03V.
At a 1st cycle of the demo code, it is 0.01V at control code "softward", at "hardward" it increases to 0.81V and stays there after the demo code has completed.
Subsequent cycles are identical, 0.01V at softward and 0.81V at hardward.
Skywatcher HEQ-5 EQMod | ASI1600MM Pro | ASI EFW | TS61EDPH | ZWO ASI 120MM | Artesky 130mm guidescope | Raspi 4B 4GB | Waveshare Stepper Motor HAT - DIY Focuser | Stellarmate | PixInsight
1 year 6 months ago #69110

Please Log in or Create an account to join the conversation.

  • Posts: 384
  • Thank you received: 95
Well that doesn't sound right. I just measured mine, and I get 3.3V when not focusing, and 0.025V when focusing.

I measured on pin 21, directly on the DRV8825 chip. According to the schematic, that corresponds to pin 32 on the 40-pin header.
1 year 6 months ago #69115

Please Log in or Create an account to join the conversation.

  • Posts: 1275
  • Thank you received: 221
15V is quite high and can cause a 12V stepper motor to behave badly.
INDI/KStars on Raspberry Pi 4, 4gb
Raspbian Buster with AstroPi3 script configuration
Skywatcher HEQ5 Pro Mount
Canon 600D Camera
Orion SSAG/ASI120mm @280mm Guide Scope
PHD2
Waveshare Stepper Motor Board - DIY Focuser
Adafruit GPS Module
Generic Bluetooth Joystick.
Startech 7 port powered USB Hub.
1 year 6 months ago #69116

Please Log in or Create an account to join the conversation.

  • Posts: 50
  • Thank you received: 1
That is an interesting point. I checked if there is a hw connection on the HAT board from pin 21 of DRV8825 (M1) to RPi pinheader pin 32 (GPIO12)  or (M2) to pin 7 (GPIO4). In both cases the pinheader pin was NOT connected to ANY of the 28 DRV8825 pins!! I double checked with GND pins (DRV pin 14 & 28), both are correctly connected to RPi GND. I also double checked the pin denoted STEP (DRV pin 22), it is correctly connected to pinheader pin GPIO19 (M1).

My board revision is 2.1, what is yours? Is that understandable?

The waveshare schematic contains at least one mistake: DRV8825 port PPAD is port 29 on the drawing, but the chip only has 28 pins. 
Skywatcher HEQ-5 EQMod | ASI1600MM Pro | ASI EFW | TS61EDPH | ZWO ASI 120MM | Artesky 130mm guidescope | Raspi 4B 4GB | Waveshare Stepper Motor HAT - DIY Focuser | Stellarmate | PixInsight
1 year 6 months ago #69117

Please Log in or Create an account to join the conversation.

  • Posts: 50
  • Thank you received: 1
@ IHOUJIN

That is certainly a valid point, I will check with a 12V power supply. But I guess this does not affect my other testing from today.
Skywatcher HEQ-5 EQMod | ASI1600MM Pro | ASI EFW | TS61EDPH | ZWO ASI 120MM | Artesky 130mm guidescope | Raspi 4B 4GB | Waveshare Stepper Motor HAT - DIY Focuser | Stellarmate | PixInsight
1 year 6 months ago #69118

Please Log in or Create an account to join the conversation.

  • Posts: 50
  • Thank you received: 1
@Kevin
Where did you buy your waveshare board? I bought mine at a amazon seller called eu-stepperonline, I am not sure if this shop is reliable.
Skywatcher HEQ-5 EQMod | ASI1600MM Pro | ASI EFW | TS61EDPH | ZWO ASI 120MM | Artesky 130mm guidescope | Raspi 4B 4GB | Waveshare Stepper Motor HAT - DIY Focuser | Stellarmate | PixInsight
1 year 6 months ago #69119

Please Log in or Create an account to join the conversation.

  • Posts: 384
  • Thank you received: 95
I guess some reflowing of solder joints might be in order.

I bought mine from Amazon, from the seller "Coolwell Technology". I don't know the board revision, I might check it tomorrow in the daylight (it's outside on the telescope now).
 
1 year 6 months ago #69121

Please Log in or Create an account to join the conversation.

  • Posts: 50
  • Thank you received: 1
I checked the voltage on RPi 4 GPIO12 without the HAT and in this case the voltages are as expected, so it must be a defect on the WaveShare Hat. I ordered a new one and will then check again.
Skywatcher HEQ-5 EQMod | ASI1600MM Pro | ASI EFW | TS61EDPH | ZWO ASI 120MM | Artesky 130mm guidescope | Raspi 4B 4GB | Waveshare Stepper Motor HAT - DIY Focuser | Stellarmate | PixInsight
1 year 6 months ago #69139

Please Log in or Create an account to join the conversation.

Time to create page: 0.724 seconds