×

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

Bi-monthly release with minor bug fixes and improvements

Astroberry PiFace

  • 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.

  • Posts: 983
  • Thank you received: 375

Replied by Radek Kaczorek on topic Astroberry PiFace


Have you tried using PiFace Focuser 2? The driver supports 2 stepper motors and the code for the second focuser is cloned from the first one, except other address is used i.e. IndiPiFaceFocuser1 (GPIOB) vs IndiPiFaceFocuser2 (GPIOA).
6 years 8 months ago #17864

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

  • Posts: 281
  • Thank you received: 29

Replied by Helge on topic Astroberry PiFace

Well, I have been using the Focuser 2 (GPIOA) from the beginning for the stepper that drives the focuser. For some reason, here the Output-pins 4-7 are powered.

Not sure where the pin base is set to 4, instead of 0, i.e. whether output 7 actually corresponds to MCP27s13-pin 28 (GPA7) or whether the sequence is twisted upside-down, i.e. output pin 7 is MCP23s17-pin 21 (GPA0), and 6 is pin 22 (GPA1) etc.? (See also schematics for PiFace digital).

For the filterwheel I wanted to use the Focuser 1 (which is assigned to GPIOB). Here the driver relates to the inputs 0-3, but that is not working. So question is, whether both focusers could be assigned to GPIOA, one to the Pins 0-3, the other (as is) to pins 4-7?

The below command from the library PiFace-focuser.cpp ( indiPiFaceFocuser2) refers to GPIOA, but could not get my head around, where the assignment to pin 4-7 comes from - would be really curious to understand:

mcp23s17_write_reg(payload, GPIOA, 0, mcp23s17_fd);

Could it just be a matter of transponing the stepstates for example like this:

int step_states[8] = {0xa, 0x2, 0x6, 0x4, 0x5, 0x1, 0x9, 0x8};

into ... = {0xa0, 0x20, 0x60, 0,40, 0x50, 0x10, 0x90, 0x80};

I.e. to change the bits from e.g. from 1010 to 10100000 thus accessing the pins further "to the right" on the PiFace board.

...providing both steppers are not run at the same time.
Last edit: 6 years 8 months ago by Helge.
6 years 8 months ago #17875

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 Helge. It's not going to work this way.
What you're really looking for is selecting ports A and B. Take a look at core library github.com/piface/libmcp23s17/blob/master/src/mcp23s17.h
See lines 54-55:
#define GPIOA 0x12 // port A
#define GPIOB 0x13 // port B
6 years 5 months ago #19997

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

Time to create page: 0.363 seconds