×

INDI Library v1.9.9 Released (30 Nov 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: 1117
  • Thank you received: 182

Great! Congratulations. Glad it works out well for you now.

I guess there is some truth to the saying that having a screw loose is not a good thing after all.... :-)

Best wishes,

Jo
Atlas Pro AZ-EQ, ASI1600MM-Pro, ASI120MM-S, ES102ED, WO-Z61, Nikon D3300, ASI-EFW, ZWO LRGB,Ha,O3,S2 filter set
2 years 6 months ago #54647

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

  • Posts: 59
  • Thank you received: 3
Everything has been working well over a few nights of imaging with one exception. I had an (apparently) unrelated issue where I had Kstars crash on me a couple of times. Once that happens while the focuser is not at zero, I have to manually move focus back to the zero position before starting indi / Ekos again. If I don't, the focuser is at the previous focus position (say 78) but the driver now thinks its at zero and there's no way to move past the zero point. Does anybody know of any way around this? I'm not sure there is a good solution. The best I can see would be to always save the focus position and assume it hasn't moved (while also moving to zero on a clean shutdown). Support for going below zero would also help manually get out of this situation if there was then a "set as zero" option to go with it.

I was hoping the stepper driver hardware might have support for stall detection so we could use something like 3d printers use for senseless homing, but it doesn't look like it does. I suppose another option would be an actual end stop / zero switch, but that would be a good bit of extra work / hardware.
2 years 6 months ago #54902

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

  • Posts: 415
  • Thank you received: 99
Sorry, I just now saw your post.

I use the "sync" feature for that. I just type in a large enough number (usually 5000) and hit "sync" in the focuser INDI control panel. It now things the focuser is at position 5000.
2 years 6 months ago #54991

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

  • Posts: 983
  • Thank you received: 375
Hi Kevin, I'm glad you found my Astroberry AMH driver inspiring and base for your project. Great work!
I have just purchased Waveshare motor HAT and given it a try with Astroberry DIY , which is much more advanced focuser driver than Astroberry AMH.
It supports DRV8834 and A4988 stepper controllers, supports custom GPIO pins, uses kernel native libgpiod instead of bcm2835 or wiringpi, remembers focuser position between runs and provides focuser temperature compensation with DS18B20 sensor.
It uses typical DIR, STEP, SLEEP, M0, M1, M2 pins connected to Raspberry GPIO so I tested it with Waveshare motor HAT. Well, it works but I faced some issues with microstepping and sleeping a motor.

As you probably have much more experience with this device, I've got two questions:
1) It looks like the device does not handle software microstepping without touching hardware i.e. dip-switches. Am I right saying that you cannot control microstepping with software only?
2) Another issue is related to sleeping a stepper motor. Apparently hardware designers did not wired SLEEP pin of DRV8825 to any of Raspberry GPIO. Does ENABLE pin cut off step motor power circuit so it does not get hot?

Clear skies!
--
Radek Kaczorek
Astroberry Server | Orion CT8 | Askar FRA 400 | NEQ6 (hypermod) | Atik 460EX | ASI 1600 | ASI 120MM | Atik EFW2
2 years 2 months ago #60858

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

  • Posts: 415
  • Thank you received: 99
Hey Radek!

Truth be known, I didn't know Astroberry DIY focus driver existed when I wrote this, I only knew about the AMH driver. I probably would have used yours had I known about it. :)

To answer your questions:

1. Correct, they haven't exposed the microstepping select pins to the GPIO pins. They were nice enough, though, to provide solder pads that can be jumpered so that you can select the desired microstepping via GPIO. Not sure why it isn't enabled without doing some soldering, though.
2. Yes, the ENABLE pin will turn off the motor, cutting all power to it, keeping it from getting hot. That's what I do in my driver, I shut down the motor as soon as the move is complete, so the motor doesn't get hot, and to save power, if you're running off battery power.

For some reason, the sleep pin is tied directly to 5V, and the Waveshare manual states: " Should keep High, otherwise chip will enter sleep mode, and module cannot work properly."

Make of that what you will.
2 years 2 months ago #60859

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

  • Posts: 983
  • Thank you received: 375
Thanks Kevin. I will give it a closer look then to add support for this device to Astroberry DIY
--
Radek Kaczorek
Astroberry Server | Orion CT8 | Askar FRA 400 | NEQ6 (hypermod) | Atik 460EX | ASI 1600 | ASI 120MM | Atik EFW2
2 years 2 months ago #60860

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

  • Posts: 6
  • Thank you received: 0
Hello DYI astromotorists :)

I have jumped the gun and got Waveshare HAT, compiled the GIT and can find XML files as per Install_Manifest:
/usr/local/bin/indi_wmh_focuser
/usr/share/indi/indi_wmh_focuser.xml

But the Focuser driver doesn't show up in the KStars/EKOS drop down list.

My suspicion is that it is because INDIServer is started by Kstars, not manually and probably I have to add this driver somewhere, but there is nothing that suggests this in the INDI setup of KStars.

And since my Raspbian skills are pretty poor, I am a bit lost what to do. Any good ideas?

ps. I have checked usr/bin/ directory and there are bunch of familiar binaries with sort of driver names (indi_ccd and similar), this doesn't have wmh_focuser binary, should I move it from build to usr/bin? (sorry if dumb question)
2 years 1 month ago #61204

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

  • Posts: 215
  • Thank you received: 16
I noticed the stock compile for indi_wmh_focuser installed it in /usr/local/bin instead of /usr/bin with the indiserver stuff. Depending on the path setup, this may or may cause your problem. Open a terminal and type:
indiserver -vvv indi_wmh_focuser
and see what it shows. Don't start KStars or it will want to kill that iteration of indiserver and start its own.
Expect that it either runs, and shows happy wmh_focuser messages, or can't find the indi_wmh_focuser driver. or if there is a hardware issue it could try to restart several times and die. If it is "lost" on the drive, you can either leave it where it is and put a symbolic link to its compiled location in /usr/bin or actually move it to /usr/bin....or something else is going on entirely.

There is a method for adding "non-distribution" drivers to the lists in Ekos, but it would be good to verify the driver works first.
SkyWatcher 10" SynScan Goto Dobsonian, SV106 Guide, ZWO ASI178MC, Svbony SV105, SV305, Pi3HQcam, Pi4, DIY WaveShare focuser, Linux Ubuntu, KStars/Ekos, Carte du Ciel/CCDCiel, AstroDMx_Capture, Siril, StarTools, GIMP
Last edit: 2 years 1 month ago by Jon Carleton.
2 years 1 month ago #61210

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

  • Posts: 215
  • Thank you received: 16
Since a power discussion has returned..after a fashion... I have made (and verified) an observation regarding the Waveshare board with the Pi4B. If you try to run the Pi4B by flipping the switch and powering the Pi from the Waveshare board, you'll suffer low voltage issues. This does not happen with a Pi3, as it seems very happy with the power output provided by the Waveshare board. Also, if you power the Pi4B via its own USB port, you must turn that switch on the Waveshare board to OFF or things tend to get unhappy. Running the Waveshare board with its own supply and the Pi4 with its own supply works very well as long as the switch is in the OFF position on the Waveshare board.

I also recommend a case (if you can find one) for a Pi4 with a side mounted fan when using the Waveshare board. The board blocks the flow from a top mounted fan and a bottom mounted fan is just useless from the start. You really need a fan with a Pi4, even running separate power supplies and plastering heat sinks all over the place.
SkyWatcher 10" SynScan Goto Dobsonian, SV106 Guide, ZWO ASI178MC, Svbony SV105, SV305, Pi3HQcam, Pi4, DIY WaveShare focuser, Linux Ubuntu, KStars/Ekos, Carte du Ciel/CCDCiel, AstroDMx_Capture, Siril, StarTools, GIMP
The following user(s) said Thank You: Dainius Urbanavicius
2 years 1 month ago #61212

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

  • Posts: 6
  • Thank you received: 0
Thanks Jon for your insights. I have already noticed low voltage warning, but was sure it was due large USB dock that I have attached during the SD card upgrade. If the power voltage issue is real, then half of the convenience powering everything with 12V plug via Pegasus Power Box is going straight to the trashcan... I will try your solutions later today and see if this works. Thanks again!
2 years 1 month ago #61228

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

  • Posts: 6
  • Thank you received: 0

Jon, you were right - the binary sits in usr/local/bin... I have started INDI as you recommended here is what I got, but even if I try starting EKOS the driver is not in the list:

stellarmate@stellarmate:~ $ indiserver -vvv indi_wmh_focuser
2020-10-08T13:50:34: startup: indiserver -vvv indi_wmh_focuser
2020-10-08T13:50:34: Driver indi_wmh_focuser: pid=1576 rfd=3 wfd=6 efd=7
2020-10-08T13:50:34: listening to port 7624 on fd 4
2020-10-08T13:50:34: Driver indi_wmh_focuser: sending msg copy 1 nq 1:
<getProperties version='1.7'/>

2020-10-08T13:50:34: Driver indi_wmh_focuser: read defSwitchVector Waveshare Motor HAT Focuser CONNECTION Idle rw
CONNECT='Off'
DISCONNECT='On'
2020-10-08T13:50:34: Driver indi_wmh_focuser: read defTextVector Waveshare Motor HAT Focuser DRIVER_INFO Idle ro
DRIVER_NAME='Waveshare Motor HAT Focuser'
DRIVER_EXEC='indi_wmh_focuser'
DRIVER_VERSION='1.0'
DRIVER_INTERFACE='8'
2020-10-08T13:50:34: Driver indi_wmh_focuser: read defSwitchVector Waveshare Motor HAT Focuser DEBUG Idle rw
ENABLE='Off'
DISABLE='On'
2020-10-08T13:50:34: Driver indi_wmh_focuser: read defNumberVector Waveshare Motor HAT Focuser POLLING_PERIOD Idle rw
PERIOD_MS='1000'
2020-10-08T13:50:34: Driver indi_wmh_focuser: read defSwitchVector Waveshare Motor HAT Focuser CONFIG_PROCESS Idle rw
CONFIG_LOAD='Off'
CONFIG_SAVE='Off'
CONFIG_DEFAULT='Off'
CONFIG_PURGE='Off'
2 years 1 month ago #61242

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

  • Posts: 215
  • Thank you received: 16
The good news on that test is that indiserver is finding the driver and it seems to be loading properly. I don't use Ekos anymore, but I'll fire it up and see if I can remember what you have to do to load an "unknown driver." I seem to remember there was a process.

I no longer have my voltage alerts on the Pi4 since I separated the power for the HAT and the Pi board. Another thing to look out for, since you mentioned USB, Certain powered USB3 hubs cause some issues with WiFi connectivity when plugged into the USB3 port. This seems to be intermittent, so it may be limited to my setup. I switched USB hubs and the problem seemed to pass, but I am still not sure my WiFi performance is what it once was.

I'll report back on the Ekos setup.
SkyWatcher 10" SynScan Goto Dobsonian, SV106 Guide, ZWO ASI178MC, Svbony SV105, SV305, Pi3HQcam, Pi4, DIY WaveShare focuser, Linux Ubuntu, KStars/Ekos, Carte du Ciel/CCDCiel, AstroDMx_Capture, Siril, StarTools, GIMP
2 years 1 month ago #61270

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

Time to create page: 0.720 seconds