Jump to content

  •  

CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.

Photo

aGotino - a simple Arduino (Nano) Goto

  • Please log in to reply
71 replies to this topic

#51 yba2cuo3

yba2cuo3

    Lift Off

  • -----
  • Posts: 16
  • Joined: 19 Mar 2021
  • Loc: Okanagan, BC

Posted 19 March 2021 - 09:30 PM

I wanted to update my old Celestron dual axis drives, that did the job, but not for hopping between stars (too slow), so I went with your recommended setup for the mount motorization + arduino BT for the goto. Everything seems to work fine, scope moves between positions quick and smooth, the only issue I'm having is RA motor making a lot of noise when guiding, I've properly set the the Vref to 450-500V, it is normal that the drive is so noisy?. Very excited for the proper night to come to do the real testing.

Thanks for this great project and all the detailed information!

Noisy steppers normally mean they are being driven too hard. Did you try lowering the current limit?


  • gspeed likes this

#52 yba2cuo3

yba2cuo3

    Lift Off

  • -----
  • Posts: 16
  • Joined: 19 Mar 2021
  • Loc: Okanagan, BC

Posted 19 March 2021 - 09:36 PM

I'm noticing the odd glitch (in reverse direction) when the DEC switch is initially pressed & the stepper is in the rest position.  Anyone else seeing this?



#53 gspeed

gspeed

    Vostok 1

  • -----
  • topic starter
  • Posts: 101
  • Joined: 22 Apr 2020
  • Loc: Around Alps

Posted 20 March 2021 - 02:31 AM

I do -  it's because of the driver, DRV8825 (as well as A4988) has this behavior: when waking up from sleep it tends to move to "home position" which is a number (max 4?) of full steps. I believe when this happens in the opposite direction of the movement you note the glitch.

 

I read somewhere this can be solved by implementing acceleration - which I did on the goto movements, perhaps you can confirm that when goto, dec starts moving without  any glitch. The goto movements by the way occurs with full steps - until the very end when microstep adjustments are performed.

 

With DEC micro movement via buttons, there is acceleration as well - which you may barely notice since speeds are low - but I noticed as well the glitch remains, perhaps it should accelerate more slowly or since this is a microstep movement the trick just does not work... anyone any clue? I'd like to solve this as well!


Edited by gspeed, 20 March 2021 - 02:54 AM.

  • yba2cuo3 likes this

#54 yba2cuo3

yba2cuo3

    Lift Off

  • -----
  • Posts: 16
  • Joined: 19 Mar 2021
  • Loc: Okanagan, BC

Posted 20 March 2021 - 10:11 AM

Wondering if incorporating a library which supports microstepping & acceleration like StepperDriver would help?  https://github.com/l...9/StepperDriver



#55 comker

comker

    Lift Off

  • -----
  • Posts: 6
  • Joined: 23 Jan 2021

Posted 20 March 2021 - 01:12 PM

Noisy steppers normally mean they are being driven too hard. Did you try lowering the current limit?


Yep, checking on the fly to lower the noise and this is the closest I can get, I mean modifying the current with the circuit and motor on.

Edited by comker, 20 March 2021 - 01:14 PM.

  • gspeed likes this

#56 gspeed

gspeed

    Vostok 1

  • -----
  • topic starter
  • Posts: 101
  • Joined: 22 Apr 2020
  • Loc: Around Alps

Posted 20 March 2021 - 03:50 PM

Wondering if incorporating a library which supports microstepping & acceleration like StepperDriver would help?  https://github.com/l...9/StepperDriver

Can you perhaps try some basic examples with that library to confirm if any difference? I believe it is an hardware limitation, if you google for the issue you'll find a Pololu answer that goes on that direction:

https://forum.pololu...g-a4988/8423/11

https://forum.pololu...controller/7345

 

I'm wondering if drivers like TMC2208 would make the difference here.

 

Anyway, for visual use the glitch  is not a big deal. For astrophotography with ST4 port of course it would be, but since guiding pulses are needed continuously   DEC sleep mode is disabled so no glitches.


Edited by gspeed, 20 March 2021 - 03:56 PM.


#57 yba2cuo3

yba2cuo3

    Lift Off

  • -----
  • Posts: 16
  • Joined: 19 Mar 2021
  • Loc: Okanagan, BC

Posted 20 March 2021 - 04:43 PM

More details.  If I take the dec motor out of sleep mode, the glitch never occurs.  Also, if I remove line 391, the problem remains; i.e.

 

i.e. // FIXME: blocking for 2millis, any better alternative?
      delayMicroseconds(2000); // as per DRV8825 specs drivers needs up to 1.7ms to wake up and stabilize



#58 yba2cuo3

yba2cuo3

    Lift Off

  • -----
  • Posts: 16
  • Joined: 19 Mar 2021
  • Loc: Okanagan, BC

Posted 20 March 2021 - 05:24 PM

Can you perhaps try some basic examples with that library to confirm if any difference? I believe it is an hardware limitation, if you google for the issue you'll find a Pololu answer that goes on that direction:

https://forum.pololu...g-a4988/8423/11

https://forum.pololu...controller/7345

 

I'm wondering if drivers like TMC2208 would make the difference here.

 

Anyway, for visual use the glitch  is not a big deal. For astrophotography with ST4 port of course it would be, but since guiding pulses are needed continuously   DEC sleep mode is disabled so no glitches.

Based on the links you provided, it sure sounds like the drivers are at fault.  Maybe I'll order some TMC2208's to see if there are any differences.


Edited by yba2cuo3, 21 March 2021 - 03:06 PM.


#59 yba2cuo3

yba2cuo3

    Lift Off

  • -----
  • Posts: 16
  • Joined: 19 Mar 2021
  • Loc: Okanagan, BC

Posted 20 March 2021 - 07:08 PM

OK I tried the StepperDriver library & got the same glitch problem.  It is certainly pointing towards the DRV8825 drivers being at fault & not the software.



#60 gspeed

gspeed

    Vostok 1

  • -----
  • topic starter
  • Posts: 101
  • Joined: 22 Apr 2020
  • Loc: Around Alps

Posted 21 March 2021 - 01:48 AM

Many thanks for the tests!
  • yba2cuo3 likes this

#61 yba2cuo3

yba2cuo3

    Lift Off

  • -----
  • Posts: 16
  • Joined: 19 Mar 2021
  • Loc: Okanagan, BC

Posted 21 March 2021 - 06:49 PM

I'm noticing that the RA stepper skips at intervals of approximately 0.5 secs & it only occurs at 1x speed.  If I bring out pin 19 of the DRV8825 chip; i.e. DECAY, I'm able to adjust the decay mode to fast, which significantly reduces this effect.  By default, pin 19 is floating on the DRV8825 carrier board; i.e. set to mixed decay.  Alternatively, if I set the driver to slow decay, the problem worsens.  Problem also worsens for 1/32 microstepping & becomes decreasingly less prominent at 1/16, 1/8, etc.  Mixed decay mode (default) appears OK, however, at the faster speeds, even at 1/32.


Edited by yba2cuo3, 21 March 2021 - 10:08 PM.

  • gspeed likes this

#62 gspeed

gspeed

    Vostok 1

  • -----
  • topic starter
  • Posts: 101
  • Joined: 22 Apr 2020
  • Loc: Around Alps

Posted 22 March 2021 - 06:06 AM

Wow, did you solder the TI chip pin manually!? Great job. Do you know if this is a common behavior for this driver - I'm wandering why the fast decay is not the default.

#63 yba2cuo3

yba2cuo3

    Lift Off

  • -----
  • Posts: 16
  • Joined: 19 Mar 2021
  • Loc: Okanagan, BC

Posted 22 March 2021 - 09:56 AM

It wasn't easy but yes, I managed to solder a wire to that pin.

 

According to the datasheet: "Mixed decay mode begins as fast decay, but at a fixed period of time (75% of the PWM cycle) switches to slow decay mode for the remainder of the fixed PWM period. This occurs only if the current through the winding is decreasing (per the indexer step table); if the current is increasing, then slow decay is used.”

 

It appears that mixed decay works better as the speed of the motor increases. For slow stepper speeds, fast decay may be needed and then as the motor speed increases mixed decay can be used, assuming that one has access to DECAY pin. 

 

Slow decay benefits:  Reduced noise, less ripple in current waveform resulting in slightly higher RMS currents (and thus torque) compared to fast decay.

 

Slow decay drawbacks:  Increased thermal load on driver, can run into issues following target indexer waveforms based on certain L/R combinations, which means stepper position can momentarily be lost and/or steps be lost. As in the case above, microsteps became erratic and uneven.

 

Fast decay benefits:  More precise positioning, especially at slower speeds, since stepper can be made to precisely conform to stepper index table. More forgiving thermal performance. A quick test with a heat gun, one can expect 15 to 20 degree increase in ambient temperature margin in fast mode versus slow mode before FAULT condition is reported. Slow decay at room temp with no motion faults every 10 to 15 seconds. Fast decay at 35C with no motion never faults.

 

Fast decay drawbacks: Higher ripple currents can lead to unwanted noise & slightly reduced overall torque due to reduced RMS currents.


Edited by yba2cuo3, 22 March 2021 - 09:57 AM.

  • gspeed likes this

#64 yba2cuo3

yba2cuo3

    Lift Off

  • -----
  • Posts: 16
  • Joined: 19 Mar 2021
  • Loc: Okanagan, BC

Posted 22 March 2021 - 11:49 AM

I've ordered some of these to try out: https://www.amazon.c...chk_typ_imgToDp

 

Will provide an update once they arrive.


  • gspeed likes this

#65 yba2cuo3

yba2cuo3

    Lift Off

  • -----
  • Posts: 16
  • Joined: 19 Mar 2021
  • Loc: Okanagan, BC

Posted 25 March 2021 - 06:06 PM

Swapped out the DRV8825's for TMC2208's.  Huge improvements observed!  Much smoother motion with no glitches, or missed microsteps on either motor. Certainly worth incorporating these new drivers in this design if you are looking for smoother motion.  BTW, the TMC2208's were configured in Mode 1: Legacy; i.e.

- Drop-in equivalent to the A4988, or DRV8825,
- 1/16 microstepping with 1/256 interpolation,
- StealthChop2,
- Manual Vref /Stepper Current Adjustments.

 

The drivers can also be operated in two additional modes;

 

Mode 2: OTP Pre-Configuration
- As Legacy Mode,
- Optional PERMANENT change to SpreadCycle from StealthChop2,
- Achieved via jumper wires/PC software & ONE TIME PROGRAMMING.

 

Mode 3: Dynamic UART
- Needs to be wired to mainboard, Arduino Nano in this case,
- Software sets Vref / Stepper Current,
- Dynamic changing between Spreadcycle & StelthChop2 possible,
- Up to 1/256 native microstepping,
- Gcode Diagnostics for 3D printers.

 

I don't see any advantages incorporating Mode 2 or 3 in this application.  Many nice features available in Mode 3, but it would require the use of an additional UART port.


Edited by yba2cuo3, 25 March 2021 - 09:37 PM.


#66 gspeed

gspeed

    Vostok 1

  • -----
  • topic starter
  • Posts: 101
  • Joined: 22 Apr 2020
  • Loc: Around Alps

Posted 26 March 2021 - 05:43 AM

Great! Many thanks for testing this - I believe I'm going to order a couple of these drivers too.

 

Without changing any wiring, just by swapping the driver, how many microsteps gets enabled in mode 1? I see you wrote "1/16 with 1/256 interpolation", we should try to get 1/32 (as for  drv8825)



#67 yba2cuo3

yba2cuo3

    Lift Off

  • -----
  • Posts: 16
  • Joined: 19 Mar 2021
  • Loc: Okanagan, BC

Posted 26 March 2021 - 10:53 AM

Great! Many thanks for testing this - I believe I'm going to order a couple of these drivers too.

 

Without changing any wiring, just by swapping the driver, how many microsteps gets enabled in mode 1? I see you wrote "1/16 with 1/256 interpolation", we should try to get 1/32 (as for  drv8825)

For the specific TMC2208 carrier boards I ordered, I needed to make the following changes to the schematic.

 

On both RA & DEC Drivers:

  1. ENABLE (with pull-up on carrier).  Connect to GND to enable.
  2. Remove connections to M3, RES & SLP,
  3. Adjust Vref (0 to 2.5V via 0.11ohm sense resistor) 0.75v @ approx 0.5A,
  4. PDN/UART (with pull-down on carrier).  Defaults to automatic standstill current reduction,
  5. CLK (with pull-down on carrier). Defaults to internal clock,
  6. VIO connected to regulated +5VDC from Arduino.  I/O voltage set to +5V.

The DEC driver will enter into automatic standby; i.e. low current mode, when it detects no steps being received.

 

The TMC2208 doesn't support 1/32 native microstepping in standalone mode.  However, with Trinamic's proprietary 256 microstepping interpolation, there is no need.  The steps are much smoother as compared to DRV8825 with 1/32 steps.  If someone really wanted 1/32, they would have to move to the TMC2224 driver.

 

Depending on the carrier board you order, you might need to change some of the jumpers &/or make additional changes to make it work the way you want.


  • mikefulb and gspeed like this

#68 yba2cuo3

yba2cuo3

    Lift Off

  • -----
  • Posts: 16
  • Joined: 19 Mar 2021
  • Loc: Okanagan, BC

Posted 27 March 2021 - 10:42 AM

 

Hi all! here is the video of my setup noise, any advice on what's the possible reason or how to get rid of it would be appreciated.

https://youtu.be/eWbc9nJD5hc

Try using TMC2208 drivers instead of the DRV8825's.  It should quiet things up quite a bit.  You'll need to make a few mods to the schematic however to get it to work properly.  Search this topic for my comments on TMC2208 mods.


  • gspeed and comker like this

#69 gspeed

gspeed

    Vostok 1

  • -----
  • topic starter
  • Posts: 101
  • Joined: 22 Apr 2020
  • Loc: Around Alps

Posted 27 March 2021 - 12:29 PM

@yba2cuo3 if I got it correctly, TMC2208 allows an extra-smooth movement thanks to the 1/256 interpolation - although, in "mode 1", namely each microstep is 1/16 of a full step when MS1&2 are HIGH.

 

The downside is the minimum movement we can ask to perform is twice as big as the one DRV8825 can provide when at 1/32:  0.56 vs 0.28 arcsec/microstep  if I did the math right with the default gears in an eq5. Clearly, no-one needs such a sub arcsec precision when goto - and  the mount/gear/pulleys backlash is way more than that.

 

Another advantage is no need to "sleep" the driver since it gets automatically in power saving status when no steps are being received. Final plus, no noise.

 

Thanks for trying it out! I'm going to update the github page soon.


  • yba2cuo3 likes this

#70 yba2cuo3

yba2cuo3

    Lift Off

  • -----
  • Posts: 16
  • Joined: 19 Mar 2021
  • Loc: Okanagan, BC

Posted 27 March 2021 - 03:28 PM

Correct on your first paragraph.

 

Yeah, I was wondering about the decrease in precision & if that was going to cause an issue.  Thanks for clarifying that.

 

The automatic standstill current reduction on the DEC motor is an nice option vs. sleep.  No observable glitches.
 



#71 yba2cuo3

yba2cuo3

    Lift Off

  • -----
  • Posts: 16
  • Joined: 19 Mar 2021
  • Loc: Okanagan, BC

Posted 27 March 2021 - 05:25 PM

According to the datasheet, it appears that native 1/32 microstepping is supported on the TMC2208, but only if the appropriate registers are set via UART in Mode 3; i.e. MSTEP & MRES registers.  Otherwise, actual microstep resolution becomes extrapolated to 256 microsteps for smoothest motor operation.


  • gspeed likes this

#72 gspeed

gspeed

    Vostok 1

  • -----
  • topic starter
  • Posts: 101
  • Joined: 22 Apr 2020
  • Loc: Around Alps

Posted 15 July 2021 - 04:56 PM

Some minor updates
  • LX200 :Mx# commands supported, now slow motion movements can be performed via Skysafary/Stellarium/INDI interface (i.e. arrows on screen) in addition to the physical buttons
  • ST4 Port code has been integrated in main branch, uncomment #ifdef ST4 line in source code to enable ST4 port on pins A0,A1,A2,A3 (North, South, East, West)
  • RA direction on slow-motion button has been inverted, so at second push it is the same direction of tracking: this avoids shifts due to pulleys backlash when observing at very high magnifications.
  • Added notes about TMC2208 on Agotino GitHub page (thanks @yba2cuo3)
  • Code readability and inline documentation improvements
Not much but actually I don't need anything else at the moment. I may think about a 2-star alignment to compensate EQ polar alignment errors or pulley backlash but really precision when doing goto is at the level I need (i.e. within 30° stays within 5-10' so the target object is always in my EP) and for astrophoto I believe the polar aligment routines provided by phd2/ekos would do the job much better.

Edited by gspeed, 16 July 2021 - 05:37 AM.

  • yba2cuo3 likes this


CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.


Recent Topics






Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics