×

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: 1117
  • Thank you received: 182
Yes, it was. I would be happy to share the STL and FreeCAD files, if there is demand here.

The rubberband is actually not for backlash, although in hindsight, that is an added bonus, but to equalize the IN and OUT forces on the motor. Since this is an analog motor, not a stepper, length of travel will depend heavily on the load. Going out will require more work than going in. I tried to somewhat equalize that using the rubber band.

In retrospect, I must say, I am surprised by how well this works. I doubt I could do any better with a stepper motor, although my next project is setting one up for a NEMA17 stepper driven by an Arduino/DRV8825 combo.

I am sure I will have lots of questions, so expect my call!

:-)

Best,

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 4 months ago #53992

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

  • Posts: 384
  • Thank you received: 95
Gotcha! You could always replace the DC motor with a stepper motor with your existing setup, for more repeatable results. Looks like you could just swap motors pretty easily. But if you're happy with the results you have now, no need to fix something that isn't broken, I suppose. :)

BTW, my driver is for controlling a stepper motor directly wired to the Pi (actually a stepper motor HAT on the Pi), not for controlling a stepper through an external Arduino controller. There's a different driver (written by someone else) for that.
The following user(s) said Thank You: Jose Corazon
2 years 4 months ago #53993

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

  • Posts: 215
  • Thank you received: 16
Anti-backlash is a clever idea. I was going to suggest you put in code to keep it from clobbering the limits with the overreach, but it is unlikely it will ever need to go that far...unless someone has a DSLR that is barely able to focus for lack of a sufficient extension tube.

And yes, setuid root is a big hammer for a little nail, but I could have been more specific in my pile-driver rule as well. As you said, it is a Pi on a telescope (unless you also use it for your online banking). Your root password is 12345, isn't it? qt:Spaceballs
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 4 months ago by Jon Carleton.
2 years 4 months ago #53998

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

  • Posts: 59
  • Thank you received: 3
I finally got a chance to try out my RedCat focuser and the latest driver. The latest driver is working great and I am able to get it to launch without setuid root by following your suggesting to add the gpio group to the stellarmate user (though I did have to reboot to get it to take effect).

My RedCat focuser is a mixed bag. Functionally, it does focus in and out and I can achieve better, more precise focus than I can manually. However autofocus is not working well and I’ve only gotten the nice v curve once. I think the biggest problem is that I’m using a belt. There is just too much give in the rubber for something like this. On a 3d printer, there is very little friction when starting motion so the belt under appropriate tension works well. However the helical focuser on the RedCat takes a bit of force to get it moving (and you can hear a loud-ish chunk when making small moves). I think a geared solution is going to work better plus it provides opportunity to better control the gear ratio. I’ll have to see if I can use the same attachment mechanism (press fit ring onto the rubber focuser grip) or if I need a clamp based solution).
2 years 4 months ago #54462

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

  • Posts: 51
  • Thank you received: 12
esb, how about 3D printing a snug, TPU-based sleeve to hug the focuser ring, and then have gear teeth on the outside? I printed something like that to provide extra grip on one of my prime lenses (not for gearing though).
2 years 4 months ago #54477
Attachments:

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

  • Posts: 1117
  • Thank you received: 182

Hi Eric:

If you have access to a 3D printer, here is a link to the STL files for the geared focuser I designed for my WhiteCat (identical in construction to your RedCat, just a different color - and $30 cheaper when I bought it..:-)). See previous page in the same thread here.

www.dropbox.com/sh/urepva7jg2eq15a/AADkq...DnhqS9KyQW1ZTva?dl=0

The only file not in there is the motor mounting block, which I had designed for an analog motor driven by FCUSB, so you would have to rig one yourself, but that is probably the simplest part to design and fit onto the included rail. Once I have a litte more time again, I will design one and put the file into the same folder. If you beat me to it, it would be great if you would share the stl file as well.

I would suggest going with the clamped design for several reasons: Very easy to put on and take off, much higher tolerance, doesn't have to fit snug off the bat, since you use a screw and nut to tighten it, and it won't slip at all on the rubber ring of the telescope, so no contribution to backlash from that end. Also, the focuser doesn't have to travel very far. As you have also found out, the RedCat has a very narrow focus range, which is difficult to adjust by hand. For autofocusing the ring has to barely move 5 degrees between the extreme focus positions of the autofocus process, to the unwieldy looking extension on the focus ring I designed is not going to conflict with the base plate or anything else. You definitely do not need a contiguous geared ring around the telescope! You manually adjust the telescope to be roughly in focus, then slip on the ring, tighten it with the screw at the 0 degree position on top, move the motor on the rail to engage the gears tightly and you are set.

Inspired by your discussion here and by Kevin's helpful hints, I thought I might give it a try and adapt the same design to a stepper motor.

I used the Moonlight driver compatible Focuser design that Robert Brown generously put in the public domain:

www.dropbox.com/s/ht01zhe3jor9swp/SolderlessFocuser.pdf?dl=0

I soldered it together yesterday from a few components. In the image below, I am using a buck converter to step down the 12V input voltage from my standard 12 V power supply to 9 V, mainly because that is what was printed as input voltage on the DRV8825 shield (although the datasheet says any input up to 45V is fine) and because I was not sure whether my cheap Arduino nano clone (($ 3), would take a Vin of 12V or go up in flames trying. Probably, though, the buck converter is not necessary and one can feed the rig directly from the 12V input.



It worked like a charm once I set the current limit on the DRV8825 shield by adjusting the Vref as described here:

www.makerguides.com/drv8825-stepper-moto...er-arduino-tutorial/

For the moment I have the Vref set at 0.33 V, so a max current limit of ~660 mA, but I will see if I can go even lower without affecting motor functionality. If I am losing steps, I can go up to 0.5V, i.e. 1A current limit. I tried that and that also works. Trade-off is that the motor produces more heat, which I obviously want to keep as low as possible, since it is connected to thermoplastic 3D printed gears. You DEFINITELY have to adjust the max current limit! I forgot that and the motor would hum and shake and get extremely hot. I was lucky that it did not fry the stepper driver on the shield. Fortunately, that had overcurrent protection. When I checked, the max current limit was set at 3.2 A, with the motor rated at 1.4A. I almost burned my fingers just touching it.

But once I had adjusted the max current limit, it immediately worked great with the Moonlight Driver in Indi right out of the box, no further modifications required. You can add an OLED, Temperature probe and In/Out LEDs by just uncommenting the respective lines in the header of the code. I used the Focuserv176_DRV8825_HW203_OLED.ino file contained in the zipped firmware folder: sourceforge.net/projects/arduinofocuscon.../ARDUINO%20FIRMWARE/

The OLED is inexpensive and it gives you more detailed information about the state of your focuser than simple LEDs:



Here a link to a movie of the set-up which obviously still is a prototype, i.e. I need to build a box around it. But it works!

www.dropbox.com/s/7pwzxom3mpi0z1m/Arduin...serInAction.m4v?dl=0

I used it with a very basic NEMA17 motor (~$6 from Amazon) and microstepping all the way to 6400 step/revolution, fully adjustable from 200 step/revolution in 2x increments all the way to 1/32, i.e. 6400 steps/revolution. That equates to 0.05 degrees/step, which is way more than necessary, given the mechanical tolerances of the gears.

In the movie I only demonstrate 1/32, 1/16 and 1/1 ratios. I think the optimal ratio for use with the geared focus design and Hy's linear focuser is probably going to be 1/16 or 1/32, mainly because I don't want the focuser to move at too high a speed on those gears.

I fully expect that to work on my geared focuser design (see picture above earlier in the thread), since all I really have to do is replace the analog motor with the stepper motor.

I would be interested to hear whether you are using the geared design and how it works for you. Please send me a PM when you do or if you have questions.

Best of luck!

Jo

PS: One more thing: The motor wire connections did not match the pin order on the DRV8825 shield, so I had to cut the wires and connect them in the right order. The colors were correct, though, with Black=1A, Green=1B, Red=2A and Blue=2B.

Attached a screenshot of the Control Panel settings and the Focus Module with Linear selected. I highly recommend the linear setup with helical focusers as in the RedCat. Basically eliminates all backlash problems.

Atlas Pro AZ-EQ, ASI1600MM-Pro, ASI120MM-S, ES102ED, WO-Z61, Nikon D3300, ASI-EFW, ZWO LRGB,Ha,O3,S2 filter set
Last edit: 2 years 4 months ago by Jose Corazon.
2 years 4 months ago #54478
Attachments:

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

  • Posts: 384
  • Thank you received: 95
Wow very nice! Now it just needs a nice 3D printed case, and you're set!

If you want to be fully Moonlite compatible, just add a DB9 connector for the stepper motor. That's what I did with my setup, since my Waveshare is controlling a Moonlite focuser on one of my scopes (and a DIY solution on another). So I added a DB9 connector to the DIY solution, and now my one focus controller can control both my Moonlite and my DIY setup.
The following user(s) said Thank You: Jose Corazon
2 years 4 months ago #54500

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

  • Posts: 384
  • Thank you received: 95

3D printers also don't use plain old rubber belts. They use timing belts, which are reinforced so they won't stretch.
2 years 4 months ago #54502

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

  • Posts: 59
  • Thank you received: 3
In my case I'm actually using the same type of reinforced belts that a 3d printer uses. In thinking about my problem, I think the issue is actually too little torque and not backlash / slop due to the belts. And relatedly it may be due to too little rotation needed by the stepper to make a visible change in focus. I am focusing in 1 step increments (with 32 microsteps enabled). I'm going to try to install the 5.18:1 stepper I bought when I was originally working on this. Unfortunately I just noticed that despite claiming to be "Nema 17", the bolt pattern in the front of the gearbox is *not* a nema 17 pattern. Sigh... I'll have to adjust the design and reprint (which is lengthy as the stepper mount is integrated into the mounting plate which is ~232mm x 70mm x 16mm (it needs to be strong). That one takes a while to print, though I do have a fast profile for a .6mm nozzle dialed in from printing PPE, so it shouldn't take quite as long as it did before.
2 years 4 months ago #54504

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

  • Posts: 1117
  • Thank you received: 182
Hi Eric,

Others here in the forum told me that they had similar problems with belts as you did. The problems actually only arise with focusers that need very little travel, like the helical focuser in the RedCat. There, even a minimal stretch of the belt is deleterious. If the belt is driving the fine focus knob on an RC8, for instance, a little backlash is much more forgiving.

I could immediately see that problem, which is why I never implemented the belt driven design on my WhiteCat (despite having all the parts already). Maybe one day I will, just to see how big the difference is.

For your RedCat, as you are writing, there is very little tolerance for backlash, so the belt has to be incredibly tight. That will put a lot of strain on the bearings in the motor, which could cause other problems.

All I can say is, the gears don't have that problem, they work GREAT, and in combination with the Linear focus algorithm there is no backlash problem. Hits perfect focus every time.

If you are up to it, since you already have the belt-driven design implemented, would you mind giving it a try and comparing the two different designs? You obviously have a 3D printer, so printing the STL files I shared will be just one overnight job on the printer (if your platform is big enough to fit them all on there). All you need then is a bracket for the NEMA17. I can help with that, if you want.

Let me know. It will be fun working out the optimal focuser for the RedCat, many people now have that and paving the road towards a simple self-built autofocuser would be beneficial to a lot of people reading this forum, I presume.

Best wishes and clear skies,

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 4 months ago #54506

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

  • Posts: 59
  • Thank you received: 3
Any chance you have fusion360 versions of your designs? In my case, the focuser is also a mounting base for an arca-swiss quick release plate that I connect a custom set of enclosures for the electronics to. And the base / focuser is all 3d printed, so the base has to be pretty thick to give it the needed strength (using most of the gap between the dovetail and RedCat itself). Part of the reason I wanted to try again with the belt solution is that the product from deepskydad.com claims to successfully use a belt-driven focuser.

Ultimately it does seem like a geared approach is generally better though. One of my goals was to allow the RedCat to be completely retracted when not in use. Given that it needs nearly 180° of rotation to do that, I'd need to mount the stepper above the scope or add a riser of some sort to allow room for the gears underneath the scope. I'll have to do some calculations to see if there might be enough clearance for an appropriately-sized gear between the scope and the dovetail if my mounting base wasn't in the way. I might be able to add a slot with clearance for the gear is that seems feasible. How far does your gear extend out from the surface of the focuser?

I still would like to try my geared stepper, though I'm not sure its actually going to work. When testing with the existing driver doing 32-microsteps and having it step just one step, it doesn't always move forward a consistent amount. I'll have to see if the other stepper I have been using does the same thing. I wonder if there is an issue with the stepper driver or the configuration of the Waveshare stepper hat.
2 years 4 months ago #54507

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

  • Posts: 59
  • Thank you received: 3
I also meant to ask what gear ratio you are using in your setup.
2 years 4 months ago #54509

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

Time to create page: 0.734 seconds