×

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

Bi-monthly release with minor bug fixes and improvements

Rpi DIY mount stepper control upgrade?

  • Posts: 257
  • Thank you received: 22
Hi guys! Now that the camera situation is mostly handled, I'm getting ready to start version 2 of my telescope mount system and wanted to see if I could get a jump start on the code.
I've been using an arduino mega and dc/encoder motors for a long time but motor lope makes them too unstable for high magnification AP such as planetary. I've decided to make the switch to steppers and figured I might as well ditch the redundant and unreliable Arduino controller at the same time opting instead to use the gpio on the rpi already running on the mount. (Thanks to Kaczorek for pointing this out previously) I'm currently in the parts/info gathering phase.
No sense re-inventing the wheel, (or in this case the EQ controls) if someone has already laid the ground work. One problem i'm head scratching about is that the mount drivers I've been using are for serial connections to existing commercial mounts.

Does anyone have a link to some rpi code that interfaces mount RA and DEC steppers to indi directly using an Rpi/gpio for control?
6 years 10 months ago #16661

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

  • Posts: 151
  • Thank you received: 27
Hi! At least with Raspian you will have a problem without an interface. If interested, you can check the Github Wiki on my controller project and see whether that is of interest ... link is found on the wordpress page in the signature ...yours wolfi
6 years 10 months ago #16676

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

  • Posts: 151
  • Thank you received: 27
Hi! At least with Raspian you will have a problem without an interface. If interested, you can check the Github Wiki on my controller project and see whether that is of interest ... link is found on the wordpress page in the signature ...yours wolfi

tscatm.wordpress.com
The following user(s) said Thank You: Ray Wells
6 years 10 months ago #16677

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

  • Posts: 257
  • Thank you received: 22
The map cannot be displayed, you haven't specified a location yet.
Thanks, I'll check it out. :) [edit: checked out the git a bit, looks like a great place to jump in thank you!]
I currently run the Kstars/ekos interface on a PC and use the RPI as a headless server over a network. The system I'm using now emulates an LX200 in eq mode and connects to the pi via usb. using LX200 generic which works pretty good but does have that now redundant processor connection(originally standalone) i'm hoping to remove in the next version.
ideally i'd like to be able to connect one of the mount control divers directly to some motor drive software on the headless server's gpio for ra/dec/focus, goto, trim, guiding etc. [just like in your wiki] - we are indeed on the same path.
Starting from scratch seems like a daunting task to an old repair tech who was hacking up transistor radios for guitar amps before there was a name for it. :)

Link to my controller code at github: github.com/Blueshawk/arduino_cgem_driver
Last edit: 6 years 10 months ago by Ray Wells. Reason: added a link /followup
6 years 10 months ago #16679

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

  • Posts: 257
  • Thank you received: 22
I see you found the nifty rpi hotspot feature. I recently got one working on mine. Seems like a pretty good thing to do with the short ranged internal wifi adapter. Can't wait till I get some time to throw together a test unit on this. Woot!
6 years 10 months ago #16680

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

  • Posts: 151
  • Thank you received: 27
hi!
the issue is - in an OS like raspian, you cannot drive the stepper in a relibale fashion with the gpio pins by themselves. you need a little bit of realtime-capability. this can be spi-controlled stepper drivers like the dspin or something that communicates with a RT-microcontroller ...

yours
wolfi
6 years 10 months ago #16688

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

  • Posts: 35
  • Thank you received: 5
Loads of stuff around, came across this refrence to some interesting work relevant to your endeavour. This a RPi development in python that's worth following.
github.com/selste/TwoStepperControl.git
I'm interested in your progress, so keep the posts flowing.
The following user(s) said Thank You: Ray Wells, dolguldur
Last edit: 6 years 10 months ago by Rob Jones.
6 years 10 months ago #16692

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

  • Posts: 35
  • Thank you received: 5
No eBay APP ID and/or Cert ID defined in Kunena configurationNo eBay APP ID and/or Cert ID defined in Kunena configurationTo reliably control Stepper motors, my preference is to use a stepper motor controller board, which reduces the interface problem to two digital pins: Step and direction (CW/CCW). Its opto-isolated inputs and range of powers make them a good choice - but admittedly over kill! and there are smaller versions, but target the ones that are opto-isolated, as they provide protection to the electronics that is necessary(even when powered down, moving the motors will damage your system)!



The small added complication is that RPis work on 3.3v and these microcontrollers may not (TTL=5v, and needs c4.5v to register a logical true). But using a voltage level shifting circuit you can connect them up and they work very reliably.

Last edit: 6 years 10 months ago by Rob Jones.
6 years 10 months ago #16693

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

  • Posts: 151
  • Thank you received: 27
hi! well, it is actually genuine c++ :) ... the driver boards used are cool (phidget 1067) but account for 100 bucks each. their power and rather coarse resolution of 16 microsteps render them mainly suitable for large scopes with big worm wheels ...
yours wolfi
6 years 10 months ago #16694

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

  • Posts: 257
  • Thank you received: 22
Do you mean the gpio is unstable/noisy/ill-timed with a desktop gui running? Or do you refer to the need for current handlers/ h-bridge drivers?
On the latter question, I'm planning to use l298 driver boards similar to those I used in the arduino project for the final outputs similar to the one I have handling motor PWM signals from the arduino mega. As set up now, the arduino gets overloaded by the LCD UI setup, especially in the version I made with extra screen writes. I'm planning for verison 2 to only use serial commands( or if possible direct gpio/drivers) in the next version to simplify the loop and reduce latency errors.
The RPI3 I'm using as an Indiserver now doesn't have a gui (Raspian lite/SSH/indi - no GPU/vnc or desktop gui) and is very stable, running for weeks at a time without glitching or hanging. Impressive little computers if they aren't overloaded.
6 years 10 months ago #16695

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

  • Posts: 257
  • Thank you received: 22
Voltage differences in interfacing aren't a big deal as long as they are current limited and age old standard practice is to avoid fanout issues by operating pull down (logic low) on things anyway. As for the motor regenerative issue, the h-bridge used in most controllers isolates from that pretty well, but the optos are a good idea anyway as they allow you to drive with isolated supplies, which keeps the cpu supply more stable...see L293 or L298N for a good example. It's starting to sound like the Arduino is already ahead of the game at the control end if the RPI gpio can't reliably output pwm to make the sign/cosign needed for microstepping. Hope none of that comes off as snarky, as it's not my intention. I'm on the fence and any discussion is wonderfully helpful. :D


I could leave most of my hardware as is if I reuse the arduino and if there's no control stability to be gained by making the change to the pi then i'm inclined to take the familiar path and just rewrite for that, using the arduino as an lx200 emulator and leaving the pi in place as the indi/ccd comm hub. The dspin is on my mind at this point in either case, if I can find a dip one or a driver board for cheap it'll be even better, pretty much making the hardware swap to steppers a snap to recode.
6 years 10 months ago #16698

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

  • Posts: 30
  • Thank you received: 3
What is the current state of your 2 motor stepper control library-- seems an issue with the latest commit?

I am interested in using the phidgets 1067 boards to control two stepping motors for RA and DEC control. I have used phidgets quite a bit for varios projects including the 1061 servo motor controller and prefer to work in python just because I am more familiar. Unfortunately, I only have 180 tooth worm drive in an old Meade LX3 to work with for my experiment. However, I have disassembled and the condition of the drive and worm is excellent and was well machined at the time.

I was thinking of swapping the 1/8 rpm motor with a Stepper and giving it a try to see what kind of results I might get For deep sky tracking, this drive would need to advance 1 tooth every 480 seconds with 2.5 steps per second without microstepping (based on 1.8 degree step angle?) Obviously, I am a complete newb to this but very attracted to the idea of stepper control. The 1067 micro stepping of 16 (while coarse by professional standards) would give me 40 steps per second theoretical? which would seem to limit vibration. Can you recommend a specific NEMA motor and a barebones strategy for a newbie approaching this task (assuming to start...DEC LOCK, one 1067 phidges controller and a raspberry pi 3 or windows machine available?? Thank you for any information.
6 years 8 months ago #17718

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

Time to create page: 1.162 seconds