×

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

Bi-monthly release with minor bug fixes and improvements

Astroberry PiFace

  • Posts: 33
  • Thank you received: 5

Replied by Greg Jones on topic Astroberry PiFace

Well it winter again and may make some headway on an Pi-observatory controller. Upgraded to a Pi3, unfortunately got the PiFace digital 2 instead of the Relay plus. Just loaded up, the first 4 outputs work and all go on and if with the all-on/all-off buttons (for those that might find themselves in the same boat). No worries, fine for now.

Anyway, all else seems to work. I would like to use the Astroberry-Piface_relay as the initial controller. Does anyone have an Ekos startup script that toggles something via the astroberry-piface/indi server connection? Will figure it out if not, but would save a lot of time.

Thx,

Greg
7 years 2 months ago #13688

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

  • Posts: 33
  • Thank you received: 5

Replied by Greg Jones on topic Astroberry PiFace

Not to reply to myself... ;) but with a little wacking and hacking,I have full access to the PiFace Digital2. (Relay driver only).

Kaczorek, pretty easy to work on... THX.

Greg
7 years 2 months ago #13712

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

  • Posts: 983
  • Thank you received: 375

Replied by Radek Kaczorek on topic Astroberry PiFace

I'm glad it works with PiFace Digital2. It was not tested with this hardware but it's a good news that the driver supports both PiFace Relay Plus and PiFace Digital2.
You can control your relay with a python scripts. I have not developed these for my relays but there was a thread somewhere on the forum on this topic.
Last edit: 7 years 2 months ago by Radek Kaczorek. Reason: typo
7 years 2 months ago #13841

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

  • Posts: 281
  • Thank you received: 29

Replied by Helge on topic Astroberry PiFace

Hi Radek,

I was wondering about the following: as reported, I can run with the PiFace Digital2-Board the focuser. For the small stepper (28byj48), I do not need additional power supply, and obviously no additional driver board. For the focuser, the PiFace uses the pins 4-7 by default. I.e. Pins 0-3 are still available (and can be used for a second focuser). Now, couldn't those pins be equally used to run a filterwheel (was thinking about "upgrading" my manual filterwheel, by attaching a.m. stepper motor)?

I had a look at the lib, piface-focuser.cpp, but my programming skills are too limited to modify. I guess it is the section around IndiPiFaceFocuser1, but cannot directly see where the a.m. pins are addressed, etc.

If I may ask whether you were considering to also integrate the ability to drive a filter wheel?

Best, Helge
6 years 8 months ago #17799

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

  • Posts: 33
  • Thank you received: 5

Replied by Greg Jones on topic Astroberry PiFace

Radek,

I know this is the PiFace thread, but this may be of interest. It's Arduino based with some INDI and ASCOM support. Works with the small motors as well as larger ones and many stepper drivers. Attach to the Pi via USB and put the INDI server on the PI.... my plan anyway. Pi is then the mount "hub" with power and WIFI (or Ethernet) connection minimizing trip hazards.

If you want to omit the Arduino, you may find the example code for your setup useful.

I also have a 28byj48 in my filter wheel that I "borrowed" from someplace. A bit slow, but faster than I am.

BTW the 28byj48 is supposed to be pretty minimal for a focuser unless there's a good gear ration or it's light (eyepiece only??)..
Last edit: 6 years 8 months ago by Greg Jones.
6 years 8 months ago #17818

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

  • Posts: 983
  • Thank you received: 375

Replied by Radek Kaczorek on topic Astroberry PiFace


Yes, they can. However it's a bit more complicated than just using a stepper motor to get a wheel moving. Electronic filter wheels need to calibrate starting position and then track actual position. In majority of cases it's accomplished by either optical or magnetic encoder, which reads actual position of the filter wheel.


The PINs are not addressed directly. PiFace addon uses SPI bus available on RPi. This means that you need to access specific registers of mcp23s17 chip, which is the heart of PiFace, instead accessing specific PINs.


I would love to! However the issue raised in the first answer above stops me from doing this.
You can however use any stepper motor to drive your wheel with a PiFace Focuser 2. It is just workaround but this way you can move the wheel in both directions by a predefined number of steps. It's not going to be perfect because you miss a feedback from actual wheel position. You can try anyway!
Last edit: 6 years 8 months ago by Radek Kaczorek.
6 years 8 months ago #17821

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

  • Posts: 983
  • Thank you received: 375

Replied by Radek Kaczorek on topic Astroberry PiFace


Hi Gregj888, indeed it's interesting. I have been thinking of it recently. In such a setup you only use USB at RPi and don't mess with GPIO or any addons/hats. This approach however, requires a user to have a DIY mentality. The reason I developed drivers for PiFace was to help users that are aiming at plug-and-play approach. I'm in the process of developing a dedicated addon to RPi that can address key needs of an astrouser. Maybe Arduino will find its place in this project. Thanks anyway!
6 years 8 months ago #17822

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

  • Posts: 33
  • Thank you received: 5

Replied by Greg Jones on topic Astroberry PiFace

Kaczorek, No real difference in the computer based DIY aspect that I can see. Plug in the stepper drivers or wire us 3 wires per, so some. The hard part is doing the mechanicals. 2 advantages for the Arduino option are: 1) more stepper driver options at a lower cost and; 2) electronic package is much smaller and lighter. There's no reason the focuser and a filter wheel can't be run from either a Pi or Arduino (nano for instance). I would with the PI, not so with an Arduino with the decision based on size. Once the DIY hat is on... :-)

On the filter wheel, a couple of bi-polar hall sensors (IE. A1309KUA-9) and a 6 magnets can do 8 filter slots with position and filter encoding ( if I did it right: NNSSN-S- adjacent sensors, several options for 5, I'm using SN-NS, full feedback). Magnets give N, S and none with 2 sense positions 1 slot apart.
6 years 8 months ago #17829

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

  • Posts: 281
  • Thank you received: 29

Replied by Helge on topic Astroberry PiFace

"The PINs are not addressed directly. PiFace addon uses SPI bus available on RPi. This means that you need to access specific registers of mcp23s17 chip, which is the heart of PiFace, instead accessing specific PINs."

Apparently, the IndiPiFaceFocuser1 seems to address the Input-ports 0-3 of PiFace Digital 2, (i.e. GPB 0-3), see datasheet for mcp23s17. So far checked with the voltmeter/continuity tester. I have seen in your code that focuser1 addresses GPIOB, so that seems to make sense. However, with that I cannot run the stepper. Presumably, because those are input ports (?).

So for running a second stepper via PiFace Digital 2, the focuser1 also needed to be assigned to GPIOA, question remains how to address GPA0-GPA3? If the assignment could be done, it would already be a big step ahead, since it would allow steering the filterwheel, as you say just via number of steps, taking advantage of the presets. Maybe it is already reasonably precise, even without optical encoder? With the a.m. Input-pins, one might be able to add an encoder at a later stage.

Best, Helge
Last edit: 6 years 8 months ago by Helge.
6 years 8 months ago #17855

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

  • Posts: 33
  • Thank you received: 5

Replied by Greg Jones on topic Astroberry PiFace

Helge,

You can run a step based system, but they tend to not be robust. Best with hard slip proof connections (gears or timing belts or mounted to the motor shaft). Biggest issue is the wheel will need to be at a "home" position each time you turn it on or you'll have the re-calibrate it (tell it where it is).

For a couple of bucks a hall sensor can give you a "Home position" and for a couple of more you can get a full closed loop readout. You can even use a DC motor then, though it needs to run slow enough to sense. Feed hall output to an ADC pin and will read mid scale for blank and 0 or full scale for a magnet depending on polarity (bi-polar hall sensor). Watch for max absolute value |A |+|B| from the 2 sensors after adjusting each for the 0 offset. This also should give repeatable positioning of the filter for flat field cal.

IMHO no real difference between GPIO and SPI/GPIO except some loss of high speed over SPI that will not matter on a motor. Programming is different, but not with the right library.

Here's mine- Knockoff Arduino nano.... Second sensor not yet in place but would be covered anyway.
6 years 8 months ago #17858
Attachments:

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

  • Posts: 281
  • Thank you received: 29

Replied by Helge on topic Astroberry PiFace

Thanks Greg, never thought into that direction, will have a closer look.

How is the motor driver and sensor connected to the Rpi? Directly or via the PiFace? Would be great if you could share more details/picture of your project!

Best, Helge
6 years 8 months ago #17859

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

  • Posts: 33
  • Thank you received: 5

Replied by Greg Jones on topic Astroberry PiFace

Motor is has a spindle with an O-ring around it for friction drive to the filter wheel. Small 1/16" diameter magnets are glued into holes in the filter wheel using a home made jig for location. Hall sensors sense magnetic fields so no physical connection between wheel and sensors.

Motor can slip under the posts and the spring fixed to the fixed posts supplies tension/force on the friction drive.

The wheel portion (that holds the filters) is actually flipped upside down from it's original configuration and the detente balls and springs removed so wheel is free to spin.

The 2 boards are screw mounted to the case using tapped holes in the case (small holes, like #1 screws ). Sensors are mounted over holes in the case (holes probably not needed in the aluminum) with slots milled to allow the sensor to get closer to the wheel (may also not be needed. Once working I'll "pot" the sensors in epoxy or similar.

Connection to the RPI (or other) is via USB to the Arduino Nano (skinny board shown).
The following user(s) said Thank You: Helge
6 years 8 months ago #17860

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

Time to create page: 0.743 seconds