how to program onstep into arduino mega 2560
Chris Lambert
Hi all.
please forgive me but i am a complete newb and novice at programming etc, but i am in need of desperate help. i am building my own telescope (https://www.instructables.com/Autoscope/) and i require to program and upload configuration files to my Arduino mega 2560 to get it to work. the onstep files i need are on this website https://www.instructables.com/Web-based-IOT-System-for-Telescope-Control/ and the files are on a google drive to be downloaded. the problem is, i have downloaded all the files, but then havnt a clue on how to upload/program them onto my arduino board as it keeps on coming up saying that there are errors etc. im even willing to pay someone to help program it for me, lol.
|
|
I do not believe an Arduino Uno or similar board will work. The MKS Gen L board, which I believe is based on the same processer (ATMega2560), does work. Please let us know the specific make/model of the board you are using.
|
|
John Petterson
That version of OnStep at that address is very very very old (v1.1g). I would strongly recommend loading the latest software (take the beta version, it is well tested and solid). See this web page for help configuring and building it for your hardware: https://onstep.groups.io/g/main/wiki/11217 The Mega2560 and RAMPS board are not the best but they are certainly serviceable. If you post the errors you are getting you can get some help with each of them. But first read the Wiki, it will tell you what libraries you need to download and add to your Arduino environment to get that working
|
|
Chris Lambert
im using the mega 2560 as mentioned in my 1st post
|
|
Chris Lambert
ok, so i didnt realise it was a very old version i was trying to use.
so if i just downloaded say the beta version and loaded that into it, should that work? or would i need additional files etc. is there also a way to see if my arduino already has files loaded into it?
|
|
George Cushing
Go to the Wiki for RAMPS & MKS Gen L. Not sure about the latest Beta, but v 3.16 should load. Get the Mega and the RAMPS 1.4 friendly first before diving into the rest of that Instructable. Good luck
|
|
Chris Lambert
OK, so I downloaded 3.16, but upon opening the folder, it has multiple other files inside, (see attached pic)
Do I just click on the file that says onstep.ino and load that?
|
|
George Cushing
OnStep.ino is a sketch most of the other files, libraries and sketches run inside or are called by OnStep.ino. So yes,
OnStep.ino is opened in the Arduino IDE. The IDE has to be able to find the supporting files and sub-directories. You can get OnStep with the GitHub app or download the zipped file. I'm not sure that you can just copy and paste the file structure.
|
|
So you have an Arduino Mega2560.
That is a supported board, but it also needs a RAMPS 1.4 or 1.5 shield, in order to connect the StepStick drivers that will drive the stepper motors. Use release 4.24, since it is the latest stable version. The process of downloading OnStep, compiling it, and uploading it to the board is described fully here: https://onstep.groups.io/g/main/wiki/3915
|
|
Chris Lambert
OK, so just had an idea, am I right in saying that all the configuration and settings etc are saved in the config.h file?
If so, would it be possible to install the latest version of onstep and then override the new config.h file with the old config.h file that has settings etc already saved into it? Would that work? Only reason I'm asking is because I don't fully know my telescope parameters .
|
|
On Wed, May 5, 2021 at 09:55 AM, <clambert24@...> wrote:
am I right in saying that all the configuration and settings etc are saved in the config.h file?That depends on which version of OnStep the old Config.h is from. In any case, it is best to manually edit the new Config.h with the values specific to your mount. That way, the defaults from the new Config.h are in effect. Only reason I'm asking is because I don't fully know my telescope parameters .You mean you have Onstep running on it, but you don't remember the values? If you attach the old working file, we can help with that.
|
|
Chris Lambert
OK. No I haven't got it working at all and having trouble uploading it and I have been told its a very old version I obtained. Hence why I asked if I can use a config.h file that someone else has previously written. And I don't know the telescope parameters as I have built it from files /3d printing etc.
|
|
You need to be specific so we can give you the right answers.
I assume from your wording that you got a mount from someone, and it is already running OnStep, but an old version. Is this correct? Can you get the Config.h from that person you got the mount from? If so, then attach it to a message. Otherwise, a lot of educated guesses are needed, e.g. by inspecting the mount, the gears/pulleys, and the motors.
|
|
"Guilherme Vênere
Khalid, i think the mount he's talking about is the one from the Instructables link he sent on the first email: The design uses a split ring fork mount with 3D printed parts. I guess in order to find the values for using in the config he would need to count the teeth in the split ring wheel and the reduction from motor to the gear connected to ring. The instructable seems to be from 2018, and the other link he provided is from a super old OnStep version (1.1 I think) and i don't think the config would be compatible. Maybe just copying the step size entries if they were there in 1.1, but the best thing is to get the actual values from the mount itself Guilherme
On Wed, May 5, 2021 at 11:44 AM Khalid Baheyeldin <kbahey@...> wrote: You need to be specific so we can give you the right answers.
|
|
John Petterson
On Wed, May 5, 2021 at 01:19 PM, Khalid Baheyeldin wrote:
You mean you have Onstep running on it, but you don't remember the values? Kahalid and George, I downloaded the distribution that he linked to earlier in this thread. The designer of the scope he is building used OnStep v1.1g and claims to have made some modifications to it. I did not even start looking at what might have been modifications, it is so out of date. I originally recommended he load the beta version and go form there. But he seems to have less of a software comprehension than I thought. So this is a new build, there is no working device or software, and he needs basic instruction. Both George and I have pointed him to the same OnStep page about the Mega2650/RAMPS builds. The config.h file does not exist, there are a bunch of different config*.h files. The configMega2560Alt.h is very different form today's config.h. It may be better to just start from scratch in working out a configuration file: // -----------------------------------------------------------------------------------
|
|
Chris Lambert
Hi John.
Many thanks for looking into my problem , but yes you are correct I basically have zero software programming experience unfortunately. I'm an electrician by trade and very good at building etc and following wiring diagrams hence why I have enjoyed building this telescope, and when it came to the software side of things, if I'm honest I just thought it would be simply a case of uploading all relevant files etc to the electronics as someone has programmed and done it before . (Obviously my mistake) so I would be very grateful for any help received.
|
|
John Petterson
Okay, here is my recommendation now. Read the Wiki. There is a lot or information there. Start at the top go though the pages. You have what is called a fork mount as far as this controller is concerned - an ALTAZ mount that is tilted to align the zeinith with the pole, so keep that in mind. You can ignore all the pages on other board combinations in the construction part of the Wiki, but read the first couple (simple and solderless breadboard) as they will give you good information. There is a lot of information about how to set up the Arduino environment and where to get all of the other libraries you will need. Under addons and accessories, you will need at least one of those to control your OnStep or else you can do it through the USB on the Mega board with the OnStep Ascom driver and a PC. I have not built one of those Mega based controllers, perhaps someone who has one can comment on what is best for that board. You will have to evaluate the gear ratios on the two axes to work out the steps per degree that is needed to tell the controller how to move. Read the wiki, come back with questions. The files at the link you posted are showing the defaults so I do not think they are modified for this telescope design. The solution is not going to be a plug-n-play like you hoped, but many people have these running and there is support to get it going.
|
|
John Petterson
One note to lift some concern - what is required to get this to work is not programming. It is configuration of parameters. You just have to learn what parameters and how to set them, and the Wiki will fill in most of that information for you.
|
|
Chris Lambert
You sir are a massive help, and I appreciate everything you have said and I shall definitely look into what you have said.
Also on a side note, I forgot to say that I have a raspberry pi to directly connect to the Mega to hopefully connect it to the Internet etc and to control it by using stellarium. I have hopefully already managed to set that up easier and would then just need to get them to talk to each other. Looks like I have got some studying to do and try to work things out.
|
|
Chris Lambert
HI again. been busy so not had a chance to look until now. i have just had a look at my build and counted the teeth on both axes and they are as follows.
for the side picture, the gear motor has 12 teeth and the main ring has 120 teeth for the front split ring picture, the main gear has 10 teeth and the split ring has 128 teeth. now those teeth that i have counted are all between those red marks i have made as it doesnt use the full amount of teeth that have been made due to the end stops and the telescope pysically not being able to move 360 degrees (if you know what i mean) and the range of movement is outlined with the red arrows shown. so i would like to know, what i would call those movements and how i would input that data into the wiki website as such? Many thanks Chris.
|
|