×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Astroberry Focuser with Adafruit Motor HAT

  • Posts: 1309
  • Thank you received: 226
Hello Kaczorek. Recently I noticed that although I have indi_amh_focuser.xml in /usr/share/indi, the driver is not on my list now. It only appears in a profile I have already set-up earlier. Not sure how to address this.
The driver does still function in that profile mind you.


Nevermind. I fixed it by moving the executable from /usr/local/bin to /usr/bin
Last edit: 6 years 8 months ago by Andrew.
6 years 8 months ago #17850

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

  • Posts: 1309
  • Thank you received: 226
Hello Kaczorek. I wish to report issues I've been having with the driver you wrote for this. Although initially it appeared everything was fine, I still struggled to set my backlash. Today I took some data points and believe I uncovered a bug in the way the backlash compensation is applied over a range of drive steps.
>Please refer to the attached images.
The photo illustrates how I was measuring the position. Each tick, 0-8 was drawn at 100 step increments.
The chart includes my data set. Each line represents a backlash value of 0 to 500 at 50 step increments. The drive-steps to take are along the X axis, 1 to 400. And the position reached from Zero with the compensation is the field of data points. Values of 0.1 only mean the needle budged indicating clearance of true backlash, which I now believe is under 50 steps, clearly evident in the chart on the far left.

Notice that as I increase the drive step value to travel further, the position obtained actually Decreases. Only once the drive step value is greater than the backlash setting does it trend back upwards linearly.

In addition, recall I set the scale with 100 step increments, but a difference of just 50 backlash comp steps results in a full position increment up the scale, rather than just a half position. So a backlash step is also traveling double what it should.Curious. Above, I see it moved 49 steps overall when changing position. That is 2x Backlash (25) Minus 1 travel step.
Total Travel 400 Steps. Now backlash had no effect at all. As if it were 0
When they do count they count for double. And they only count after the travel steps are done.
It is as if there needs to be a delay to finish the travel before compensating backlash.

Please have a look once more when you have the time.
Thank you.
Last edit: 6 years 6 months ago by Andrew.
6 years 6 months ago #19650
Attachments:

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

  • Posts: 983
  • Thank you received: 375
Thanks for the report. I need to take a look at the code to figure out what's happening here. Stay tuned!
6 years 6 months ago #19736

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

  • Posts: 1309
  • Thank you received: 226
Thank you. I'm glad you understood what I was trying to convey. I did not have an easy time trying to explain the odd behaviour.
It really took me this long to realize something was up because of a combination of few opportunities to use it over months of bad conditions and doubt that my design was sound.

I did have a buddy look at the code, and he thought maybe associating an integer value with a floating point number on line 146 is related. Only you would know.

And if you have the time, can a console option for stepper mode be added? (Single, Double, Interleave, Micro). I reason that will make it more convenient for DIY builds with different specs to not required recompiling for it.

Thanks again.
6 years 6 months ago #19741

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

  • Posts: 1309
  • Thank you received: 226
Here is an annotated segment of log as I take small travel steps of 1, with a backlash setting of 25. Note it is directed to go twice the backlash minus the set travel step, also the EKOS pane reports the result with expected value +- 1 step.
2017-10-01T23:34:33	Adafruit Motor HAT Focuser moved to position 0					
2017-10-01T23:35:08	Adafruit Motor HAT Focuser is moving outward by 100					
2017-10-01T23:35:10	Adafruit Motor HAT Focuser moved to position 100					
2017-10-01T23:35:17	Adafruit Motor HAT Focuser backlash compensation by 25 steps...					
2017-10-01T23:35:17	Adafruit Motor HAT Focuser is moving inward by 1					
2017-10-01T23:35:18	Adafruit Motor HAT Focuser moved to position 51	
	^Moved 2x set backlash minus travel steps (1). EKOS reports focuser moved to position 99.
2017-10-01T23:35:21	Adafruit Motor HAT Focuser is moving inward by 1					
2017-10-01T23:35:21	Adafruit Motor HAT Focuser moved to position 98					
2017-10-01T23:35:22	Adafruit Motor HAT Focuser is moving inward by 1					
2017-10-01T23:35:22	Adafruit Motor HAT Focuser moved to position 96					
2017-10-01T23:35:22	Adafruit Motor HAT Focuser is moving inward by 1					
2017-10-01T23:35:22	Adafruit Motor HAT Focuser moved to position 97					
2017-10-01T23:35:23	Adafruit Motor HAT Focuser is moving inward by 1					
2017-10-01T23:35:23	Adafruit Motor HAT Focuser moved to position 95					
2017-10-01T23:35:25	Adafruit Motor HAT Focuser backlash compensation by 25 steps...					
2017-10-01T23:35:25	Adafruit Motor HAT Focuser is moving outward by 1					
2017-10-01T23:35:26	Adafruit Motor HAT Focuser moved to position 144
	^Moved 2x set backlash minus travel steps (1). EKOS reports focuser moved to position 96.
2017-10-01T23:35:33	Adafruit Motor HAT Focuser is moving outward by 1					
2017-10-01T23:35:33	Adafruit Motor HAT Focuser moved to position 97					
2017-10-01T23:35:34	Adafruit Motor HAT Focuser is moving outward by 1					
2017-10-01T23:35:34	Adafruit Motor HAT Focuser moved to position 98					
2017-10-01T23:35:34	Adafruit Motor HAT Focuser is moving outward by 1					
2017-10-01T23:35:34	Adafruit Motor HAT Focuser moved to position 99					
2017-10-01T23:35:35	Adafruit Motor HAT Focuser is moving outward by 1					
2017-10-01T23:35:35	Adafruit Motor HAT Focuser moved to position 100					
2017-10-01T23:35:43	Adafruit Motor HAT Focuser backlash compensation by 25 steps...					
2017-10-01T23:35:43	Adafruit Motor HAT Focuser is moving inward by 1					
2017-10-01T23:35:44	Adafruit Motor HAT Focuser moved to position 51	
	^Moved 2x set backlash minus travel steps (1). EKOS reports focuser moved to position 99.
2017-10-01T23:35:45	Adafruit Motor HAT Focuser is moving inward by 1					
2017-10-01T23:35:45	Adafruit Motor HAT Focuser moved to position 98					
2017-10-01T23:35:46	Adafruit Motor HAT Focuser is moving inward by 1					
2017-10-01T23:35:46	Adafruit Motor HAT Focuser moved to position 96					
2017-10-01T23:35:46	Adafruit Motor HAT Focuser is moving inward by 1					
2017-10-01T23:35:46	Adafruit Motor HAT Focuser moved to position 97					
2017-10-01T23:35:47	Adafruit Motor HAT Focuser is moving inward by 1					
2017-10-01T23:35:47	Adafruit Motor HAT Focuser moved to position 95					
2017-10-01T23:35:49	Adafruit Motor HAT Focuser backlash compensation by 25 steps...					
2017-10-01T23:35:49	Adafruit Motor HAT Focuser is moving outward by 1					
2017-10-01T23:35:50	Adafruit Motor HAT Focuser moved to position 144 
	^Moved 2x set backlash minus travel steps (1). EKOS reports focuser moved to position 96.
2017-10-01T23:35:53	Adafruit Motor HAT Focuser is moving outward by 1					
2017-10-01T23:35:53	Adafruit Motor HAT Focuser moved to position 97					
2017-10-01T23:35:54	Adafruit Motor HAT Focuser is moving outward by 1					
2017-10-01T23:35:54	Adafruit Motor HAT Focuser moved to position 98					
2017-10-01T23:35:54	Adafruit Motor HAT Focuser is moving outward by 1					
2017-10-01T23:35:54	Adafruit Motor HAT Focuser moved to position 99					
2017-10-01T23:35:56	Adafruit Motor HAT Focuser is moving outward by 1					
2017-10-01T23:35:56	Adafruit Motor HAT Focuser moved to position 100					
6 years 5 months ago #19930

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

  • Posts: 983
  • Thank you received: 375
Hi Andrew. The driver has been fixed. Please update your sources from git and let me know if it works for you.
The following user(s) said Thank You: Andrew
6 years 5 months ago #19996

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

  • Posts: 1309
  • Thank you received: 226
Fantastic! Everything appears to move as expected now. Thank you very much Radek.
For a final tweak, I suggest setting the stepper mode to Double by default in the code. The added torque is useful to avoid skipped steps. And finally to update Astrobery Server with this version.
And with that it appears we have two mature focus drivers for the Raspberry Pi people can choose from. For the Adafruit Motor HAT, and Piface Digital driver boards.
Amazing work.
6 years 5 months ago #20001

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

  • Posts: 983
  • Thank you received: 375
I'm glad it works for you. Now the default stepper mode has been set to DOUBLE. Update your sources and have fun ;-)
I will add the latest version to Astroberry Server next release.
6 years 5 months ago #20009

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

  • Posts: 24
  • Thank you received: 1
I compiled and installed the Adafruit Motor HAT driver. So far so good. I run the Raspberry Pi as remote INDI server. I run the KStars/Ekos client on Windows 10 on my desktop. But the "Motor HAT Focuser" is not showing in the list of focusers in the KStars Profile Editor, so I can not add it to my profile.
I checked that the .xml file is in the /usr/share/indi folder and it is.

Any suggestions?
Windows 10 64-bit with remote access to Embedded Raspberry PI 3 with Ubuntu Mate 16.04.3 LTS and KStars 2.9.8, Skywatcher HEQ5 PRO, Robtics 80mm F7 doublet apochromaat refractor + CentralDS CDS-600DII
6 years 4 months ago #20753

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

  • Posts: 1309
  • Thank you received: 226
berendj:
Place the executable in /usr/bin, not in /usr/local/bin
6 years 4 months ago #20754

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

  • Posts: 24
  • Thank you received: 1
Thanks for that suggestion Ihoujin.
I moved the file, but it still does not show in the profile editor. (see attachment)
When i open the Web Manager in my browser, the Motor HAT Focuser does show in the drivers select box in the focuser group and is select-able.

I installed KStars/Ekos also on the Raspberry PI itself, but the result is the same.

Lost this battle, but hope to win the war.
Windows 10 64-bit with remote access to Embedded Raspberry PI 3 with Ubuntu Mate 16.04.3 LTS and KStars 2.9.8, Skywatcher HEQ5 PRO, Robtics 80mm F7 doublet apochromaat refractor + CentralDS CDS-600DII
6 years 4 months ago #20757
Attachments:

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

  • Posts: 983
  • Thank you received: 375
It works over webmanager because the xml file does exist on the machine the webmanager is running on.
But it doesn't exist on the macine you are running KStars/Ekos on. Probably you need to copy it to your windows machine. Just find the place where all the other driver's xml files are, and copy it there.
The following user(s) said Thank You: BJ Ruiterkamp
6 years 4 months ago #20758

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

Time to create page: 2.639 seconds