PDA

View Full Version here: : Arduino focuser (myFocuserPro)


bojan
24-07-2021, 08:46 AM
I am looking into myFocuserPro (https://sourceforge.net/projects/arduinoascomfocuserpro2diy/) f/w... and I have compilation error, even after following all instructions (I hope) properly...
Are there similar issues (and solutions) with other DIY-ers?

redbeard
24-07-2021, 12:08 PM
Hi Bojan,


With the info you have provided, this is what I think based on the error message.



Normally, there is a folder called 'libraries' under the Arduino installation folder where you would put your focuser library into. That way Arduino knows how to find the library. The error message you are getting is as it says as it can't locate the file. The sketch folder or below is not the library folder.


On my PC, the sketch location is: C:\Users\Redbeard\Documents\Arduino , but this is not where libraries should go.



The installation folder where I have installed Arduino software on my PC is G:\Arduino\


All my library files are stored in G:\Arduino\libraries\ as this is where Arduino software looks for them.



Arduino libraries are not normally stored in the sketch folder. It's annoying as the Arduino software does not list where it stores the libraries.


You don't need to copy the individual files to this location, just the folder with the files in it.



Ignore if you already know all this.


Cheers,
Damien.

bojan
24-07-2021, 02:32 PM
Hi Damien,
Thank you for the comment.

I came to the same conclusion as you suggested, but my Ardino IDE still can't find that library.
Funny thing is, that "myQueue.h" is in the folder of the same name, but there is nothing else in it, while other folders of the same package have other files, including *.cpp.
So I don't know what is happening here... still waiting for someone with similar experience with that particular "sketch" or from discussion group to reply...
Thanks again,

Bojan

bojan
24-07-2021, 08:36 PM
Still no joy...
No idea what is wrong here.

brown_rb
24-07-2021, 09:46 PM
Under no circumstances place this in the C:\program files etc


Arduino stores libraries in two places
1. In a libraries directpry along with executable program (normally C:\Program Files (x86)\Arduino)
2. In the users Documents folder


As these are user libraries, do not put them in C:\Program Files (x86)\Arduino


If Arduino IDE is running, close it


Unzip the firmware file.
Go into the myFocuserPro2libraries folder
Select all folders and then Copy
Go back to the Documents\Arduino\Libraries folder (from 2 above)
When in the Documents\Arduino\Libraries PASTE all those copied folders.


Then start Arduino IDE

brown_rb
25-07-2021, 12:04 AM
Somehow. in Arduino IDE, File, Preferences
The Sketch location is shown as
C:\users\Astra_1\Documents\Arduino\ libraries


which is wrong
it should be C:\users\Astra_1\Documents\Arduino


Because it is specified incorrectly, Arduino is looking for the user libraries in

C:\users\Astra_1\Documents\Arduino\ libraries\libraries


which aint gonna work

redbeard
25-07-2021, 11:00 AM
Hi Bojan,



This may help:
https://sourceforge.net/p/arduinoascomfocuserpro2diy/discussion/general/thread/15ce87a1/


I would definitely remove the 'libraries' reference as noted from the link for your preferences file. Change to: "c:\Users\Astra_1\Documents\Arduino" as Robert has pointed out.



Also the reference in the preferences file points to where your saved sketches files will be saved by default, not your libraries folder.


The libraries folder should be one level below where the actual installation of Arduino was done. For example, if you installed the Arduino software in say c:\Program_files(x86)\Arduino, then the libraries folder should be: c:\Program_files(x86)\Arduino\libra ries and that's where I would put the libraries.


I just placed the myQueue.h in an Arduino sketch and it compiled OK on my machine so I think file location and the above link may help.



Cheers,
Damien.

bojan
25-07-2021, 01:47 PM
Thank you all for your help guys, and special thanks to Robert (same Robert from SourceForge? who helped me on SF forum).

I just remembered I have lap with (not used much) Arduino installation, so first I will try to compile there, then I will clean this desktop and try from scratch.
Thanks again to all !

bojan
25-07-2021, 06:00 PM
I did all that was recommended, I still have the same problem.
I am now doing the clean installation of Arduino and hoping for the best.

bojan
25-07-2021, 06:35 PM
I am giving up..

It doesn't work.

bojan
25-07-2021, 08:15 PM
I really feel stupid now.
I placed content of myFocuserPro2libraries into F:\Data_disk\Arduino_libraries and it works.

I am sure I did exactly that earlier, but without success.. so re-installation must have helped.
Thank you all for your help, now I can start thinking about mechanics :)

redbeard
26-07-2021, 05:55 PM
Hi Bojan,


Great to hear you have it sorted. I was just about to send you a document to help but sounds like all is good now.


Cheers,
Damien.

bojan
26-07-2021, 06:36 PM
Damien, thank you.

Yes, it was my fault entirely - For some reason I placed lib files in wrong folder. What's worse, in the past I was manually updating Arduino libs, and I never made such a stupid mistake... I am getting old (and not reading instructions carefully enough) :sadeyes:

bojan
09-08-2021, 11:34 AM
Everything mounted in box, and it works :-)
Instead of buttons I have 3x1 switch... but I plan to have encoder instead.
This particular firmware combination (ULN2003 + encoder) is not available, but I will try to reshuffle source.. hopefully it will work.

I also designed and printed motor bracket, to be mounted on C11 using the existing threads around focuser and screws (idea came from Robert's documentation). Gears (or timing belt transmission) are on their way soon.

bojan
09-08-2021, 03:15 PM
Gears fit, but a bit too tight.. perhaps I will print them again, slightly smaller.
On the other hand, the red flange is not flash with scope back end, so the bracket is slanted and motor shaft is moved towards big focuser gear...perhaps 2x 0.5 mm spacers and longer screws will help here.
Anyway, not bad at all for first iteration :)


EDIT:

With washers under the bracket, gears fit perfectly (as much as plastic can...).

bojan
10-08-2021, 03:19 PM
I also printed the tightening mechanism for 55-teeth gear.
It is tightened with M6 screw and hex nut (which sits in between 3 "fingers" that go into the hollow of the focusing shaft, ø16 mm).
It is easy to remove the motor from bracket and use the gear-knob for manual focus instead of original rubber one.

bojan
24-08-2021, 08:59 AM
Latest update:
I managed to "marry" ULN2003 board and rotary encoder in code - it is a bit of a patchwork, but it reads encoder and moves the motor accordingly, apart from other functionality relevant to ULN2003 board.

bojan
15-01-2023, 12:49 PM
Small update for motor bracket..

Disengaging the focusing knob (for manual focus) can be done easily by rotating the motor body in the bracket (before this mod I was removing the motor from bracket.. which was also not hard - but this way it is better)

Sunfish
19-01-2023, 08:29 PM
Very interesting build. Is there focuser control under Onstep that could manage a stepper motor for focus?

bojan
19-01-2023, 10:21 PM
Thank you :-) This design was inspired by one of MyFocuserPro users..


OnStep supports up to 4 motors (AR/AZ, DEC/EL, rotation and focuser.) and there are ASCOM and INDI drivers, so interface to CdC od NINA for example is easy.

I am using MyFocuserPro to share electronics between different mounts and scopes..

bojan
20-01-2023, 09:59 AM
Because OnStep uses Arduino stepper drivers (STEP/DIR) for 4-wire steppers, and this motor has 5 wires (two coils with joined middle contacts) so you have to modify it first, by opening the blue plastic cover and add middle wire for another coil (after cutting the connection between coils)).

Then you can use only 4 wires (1/2 coil, Red-Blue and Black-Orange wires for 5V, the whole coils for 12V) to connect the motor to driver.

See details here (https://microcontrollerslab.com/28byj-48-5-volt-stepper-motor-guide/) and here (http://www.jangeox.be/2013/10/change-unipolar-28byj-48-to-bipolar.html).

ChrisV
20-01-2023, 02:55 PM
Works a treat. I've converted a few of these and other 5-wire stepper motors like this then run them on drv8825s tmc21xx drivers

Sunfish
20-01-2023, 03:22 PM
Thanks Bojan,
Interesting details.

R.

[QUOTE=bojan;1580106]Because OnStep uses Arduino stepper drivers (STEP/DIR) for 4-wire steppers, and this motor has 5 wires (two coils with joined middle contacts) so you have to modify it first, by opening the blue plastic cover and add middle wire for another coil (after cutting the connection between coils)).

bojan
22-01-2023, 09:26 AM
*.stl attached (2 versions + update).

Leo.G
12-02-2024, 12:08 PM
Interesting project overall!


What is the quality of the 3D printed gears in this project?
Not so much as in what is the quality and reliability of your work but in printed gears overall?
If I ever get to welding up the frame I have a milling machine here and a new cross slide table for it and I'd likely be more inclined to machine alloy gears but 3D printed would be so much easier (were I to get a 3D printer that is). I have a few telescopes I want to do electronic focusers for.


You make mention of an encoder, what type have you used for this project?
I recently purchased 6 very nice quality units from AliExpress quite cheap (compared to RS components) for another project my son is playing with and I'd like to incorporate one with a focus motor for repeatability. I know there's the 2 types, mine would be the cheaper type, incremental. I'd like some Absolute encoders to play with, I should check AliExpress come to think of it.
Though a remote focus unit I purchased used on here has the incremental encoder and it works OK except when I'm trying to use my phone to control the thing.
The only mobile phone screen I could actually consider useful would have to be 55" minimum, my eyes are far from good. Then it wouldn't be quite so mobile I guess.

bojan
12-02-2024, 02:26 PM
Leo,

Printed gears are quite adequate for this particular purpose (and many other).. and I am perfectly happy with their performance as part of this focuser (where there are no heavy loads - remember, this is plastics.. and printing is not as good as molding ).
Of course, when in doubt, the best approach is to try and see for yourself ;-)

As to encoder as additional input to focuser controller, I used similar to this one from ebay (https://www.ebay.com.au/itm/354569857746?hash=item528e02aad2:g: GtcAAOSwa6Rj4fGo&amdata=enc%3AAQAIAAAA0BZ0j3JlDB0jTD zOGTOfOqWGvidVE5cKGx3fF7R0wKxaAZR1f gzVmZ7txHPIBbz0FyuXZ1NaPpiILEXk46wl sEpsePEXoyplqDWZc26ITEgGKFs8v3mjU3V Y6cnYTT1TgADJQoUq%2Bkh3G2vKWBkLRT8k e6U1Q6QyC0y%2B6vOvl8m49w1pYJuWLALxk bFJEhRFIO7wk1ZllyiCYhjKkJN2dpRhZF6f xxkfdZSaODphVhTgeG0VlUoXADEzdFTOp7C NKgzftGAoNgQKmThUluHZDJI%3D%7Ctkp%3 ABk9SR9rGgbWzYw). It is incremental and I use it very occasionally (mostly I focus via USB).. More often, when I need to focus my C11 between presence of FR and native FL, I simply disengage the gears (by rotation motor bracket) and focus manually (as designed by Celestron).

Leo.G
15-02-2024, 11:16 AM
Thanks Bojan!
I would guess they are suitable because under general use there's not high torques required. Though that too would depend on whether viewing or imaging as far as load goes.
I would imagine it's also easy to print a spare when doing them (or sometime after) just in case and it's not going to cost a fortune.