Jump to content

NLCbanner2024.jpg.2478be509670e60c2d6efd04834b8b47.jpg

Nexstar Raspberry Pi Controller


tekkydave

Recommended Posts

12 minutes ago, tekkydave said:

You are missing a library. Not sure how to get it. My install didn't fail on this. I think it's mentioned in the INSTALL file in the astroberry directory.

I suspected as such - I'll see what I can find :)

Link to comment
Share on other sites

Astroberry page says

Quote

Requirements
============
* INDI available here http://sourceforge.net/p/indi/code/HEAD/tree/trunk/
* libgps (for Astroberry GPS only) available here https://github.com/wdalmut/libgps
* RTIMULib (for Astroberry AltIMU only) available here https://github.com/richards-tech/RTIMULib
# bcm2835 (for Astroberry Focuser and Astroberry Board) available here http://www.airspayce.com/mikem/bcm2835/

Highlighted in yellow.  The missing library - but needed for Astroberry AltIMU only!  And the link doesn't work - 404 error.

Edited by Gina
Link to comment
Share on other sites

I'm sure the must be a way of compiling only those Astroberry drivers we want.  How about deleting files for unwanted ones? - maybe a file containing a list as well.?

Indi on Raspbian 08.JPG

Link to comment
Share on other sites

It puts the four individual drivers into separate directories as per this list :-

Indi on Raspbian 09.JPG

The only one of interest currently is the rpifocus so why make the others???

Link to comment
Share on other sites

I think I'm going to look into INDI driver writing because there are other things I want to do with the GPIO pins on the RPi and I want to control them from Ekos remotely.  I know it's possible to write drivers including all the info for producing the controls in Ekos by specifying parameters in the driver.  I just need to take it all in :D  I'm learning all the time :)

  • Like 1
Link to comment
Share on other sites

I've been looking for the source files in Astroberry but they seem well hidden.  I think there are other drivers that control the GPIO interface.  Could probably modify one of those.

Link to comment
Share on other sites

How accurate is controlling a stepper motor directly from the Pi?

I've been toying with the idea of getting a moonlite focuser and using the Pi for remote control of it (currently I use a olimex A20 to control CCD, Guider, Scope mount and filterwheel remotely via ekos). However, when I was thinking about using gpio from the Pi + a driver chip I wasn't sure if the Pi would be accurate enough to send the motor on pulse for just the right duration without potential delays due to non real-time OS.

I was thinking instead about using a PIC chip and implementing the moonlite protocol on that so that the Pi could use serial to communicate with the Pic, random delays/jitter wouldn't matter there and then the Pic would be able to do very accurate driving of the motor via a driver chip.

That said, you've both now got me curious about how accurately the Pi 3 can drive its gpio pins. Do either of you have an oscilloscope and a way to capture a trace of the motor pulses to see how well the Pi does? My main concern was that with it not being a real-time OS, there's a chance it could start the motor then be pre-empted and other processes run a little before it can turn off the motor, causing the stepper to move more than intended. Is that a valid concern?

If the Pi is capable of decent enough accuracy I may have to revise my original plans.

Link to comment
Share on other sites

There is no reason why the accuracy should not be superb - you can use micro-stepping for greater accuracy.  I currently use a 28BYJ-48 tiny stepper motor only half stepped and easily get focus well within a pixel on my ASI1600MM-C camera with 3.8micron pixels in a four-thirds sensor chip.  These stepper motors can be modified for bipolar drive and can then use the A4988 micro-stepping controller with 16x micro-stepping giving 8x the resolution/accuracy I currently use.

That's using an Arduino Nano but you can do just the same with an RPi.

Quote

My main concern was that with it not being a real-time OS, there's a chance it could start the motor then be pre-empted and other processes run a little before it can turn off the motor, causing the stepper to move more than intended. Is that a valid concern?

No, I don't think it is.  The time scale involved in focussing is much slower than the microprocessor speed.  The A4988 for example has direction bit (on/off) and micro-stepping (1x, 2x, 4x, 8x,16x) then a pulse sent to the STEP input moves the stepper motor by one step with that step size depending on the micro-stepping setting.  Hope that makes sense :)

Edited by Gina
Link to comment
Share on other sites

Hi Gina.

Just checked the chip you mention, that would likely avoid the issues I was on about. I didn't realise you were using that, I thought you were just using a basic driver chip rather than a controller.

The Arduino I imagine is likely similar to the setup I was considering with a Pi -> Pic -> driver -> Motor.

I may have to give a bit more thought to my project. Although I will likely still make a custom Pi hat as I want to do a little more than just control the focuser I likely don't need the Pic if I choose a suitable controller chip instead and drive that from the gpio.  Just need to find one I can manage to solder :)

  • Like 2
Link to comment
Share on other sites

9 hours ago, Gina said:

I've been looking for the source files in Astroberry but they seem well hidden.  I think there are other drivers that control the GPIO interface.  Could probably modify one of those.

The source is in the .cpp files and the .h headers. I think to control what gets compiled we need to modify the cmake files. I'm not familiar with cmake, only the older make utility. I'll take a look later. I'm curious as to why I didn't get the error you get. 

  • Like 1
Link to comment
Share on other sites

Looks like the CMakeLists.txt file is the main driving file. Not sure but commenting out sections in here may exclude them from the build.

It would be better to install correct library. From googling it might be

sudo apt-get install librtimulib7 librtimulib-dev

Edited by tekkydave
  • Like 1
Link to comment
Share on other sites

I agree with that Dave :)  I too don't understand why it worked for you and not me.

I think I was well on the way to puzzling it out last night when I ran out of steam.   I'm looking at the cmake system for compiling C++.  I already understand how .cpp & .h files work.  I'm beginning to understand the .xml files for interfacing with INDI and Ekos - these determine the controls that appear in Ekos.  Seems a very flexible system and much better than the VB app I wrote to control my Arduino focuser.

For my all sky cam, I only need a simple focus control as once set it shouldn't need touching.  It's only needed in the first place because the dome shifts the focus a bit.  OTOH I would like to switch a dew heater on/off.  For DSO imaging I want preset differences for different filters and an auto-focus facility would be nice.

  • Like 1
Link to comment
Share on other sites

26 minutes ago, tekkydave said:

Looks like the CMakeLists.txt file is the main driving file. Not sure but commenting out sections in here may exclude them from the build.

It would be better to install correct library. From googling it might be

sudo apt-get install librtimulib7 librtimulib-dev

Thanks for that I may try the different library but OTOH I can't see that I shall ever want the function provided by that driver and probably prefer not to include it.  But how far it's worth going to reduce the size of the overall package is debatable.  However, I would like to understand how things work and maybe write my own drivers - this system is so powerful it seems a waste not to make good use of it :)

Yes, CMakeLists.txt is one of the files I looked at - I plan to work out exactly how the compiler works :)

Link to comment
Share on other sites

OK -here we go again :D

Nice bright new session with Putty - been having a look round the file system.  My brain is not entirely error free this morning but working reasonably well :D

Indi on Raspbian11.JPG

Here we see the content of the libindi_1.2.0_rpi directory with the .deb files for the INDI drivers plus directories for astroberry - svn and indi - astroberry.

Edited by Gina
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.