CANON EOS M6 Mark II

Have questions about the equipment used for macro- or micro- photography? Post those questions in this forum.

Moderators: ChrisR, Chris S., Pau, rjlittlefield

ray_parkhurst
Posts: 2726
Joined: Sat Nov 20, 2010 10:40 am
Location: Santa Clara, CA, USA
Contact:

Post by ray_parkhurst »

Adalbert wrote:Hi Ray,
For you one miscro-step (instead of the 256) would be better :-)
BTW, it is no problem; the number of the micro-steps can be changed dynamically by the software.
BR, ADi
Hi ADi...what software? I'm currently using mjkzz controllers exclusively for both single-axis stacking and 3-axis stack/stitch. The mjkzz software has 4 speeds, but no designation of what micro-stepping level is used for each speed. The fastest I believe is 1/4-step based on a post (or maybe an email) from Peter sometime back, but I have not timed the others to see how they divide-down.

I would hesitate running anything with full steps (I think that's wht you mean by one microstep) as the motion would be fairly jerky. Sure, if the software could go from 1/4 or 1/8 step and transition to full step once underway it might be OK, but I think the transition is needed, even if the steps were run at slower frequency...or maybe that would make it worse! But I have not written software for stepper control, so I have only partial practical experience with this.

Adalbert
Posts: 1134
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hi Kaleun96,
I use TMC5130A via SPI. STEP/DIR wouldn’t make any sense.
So, I have to calculate/determine the target-position and send it to the driver.
In my case the speed of the processor doesn’t play any role.
I’m afraid the speed of the step-motor is the bottle neck :-(
You only can improve the speed of the rail by the changing of the settings of the driver e.g. decrease the number of the micro-steps.
BR, ADi

Adalbert
Posts: 1134
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hi Ray,
Hi ADi...what software?
my software I have already published in https://www.photomacrography.net/forum/ ... highlight=
(but it was for TB)

BR, ADi

Adalbert
Posts: 1134
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hi Mike,
Not sure how you've got these Trinamics configured with the Arduino
My setting-method looks like follows:

Code: Select all

void Rail::tmcSetup(void) 
{
  pinMode(_tmc_CSN,OUTPUT);
  pinMode(_tmc_DRV_ENN, OUTPUT);
  digitalWrite(_tmc_CSN,HIGH);
  digitalWrite(_tmc_DRV_ENN,LOW);


  SPI.setBitOrder(MSBFIRST);
  SPI.setClockDivider(SPI_CLOCK_DIV8);
  SPI.setDataMode(SPI_MODE3);
  SPI.begin();

  Serial.begin(9600);

  tmcSendData(0x80,0x00000000);      //GCONF

  tmcSendData(0xEC,0x000101D5);      //CHOPCONF: TOFF=5, HSTRT=5, HEND=3, TBL=2, CHM=0 (spreadcycle)
  tmcSendData(0x90,0x00070603);      //IHOLD_IRUN: IHOLD=3, IRUN=10 (max.current), IHOLDDELAY=6
  tmcSendData(0x91,0x0000000A);      //TPOWERDOWN=10

  tmcSendData(0xF0,0x00000000);      // PWMCONF
  //tmcSendData(0xF0,0x000401C8);    //PWM_CONF: AUTO=1, 2/1024 Fclk, Switch amp limit=200, grad=1

  tmcSendData(0xA4,0x000003E8);     //A1=1000
  tmcSendData(0xA5,0x000186A0);     //V1=100000
  tmcSendData(0xA6,0x0000C350);     //AMAX=50000
  tmcSendData(0xA7,0x000186A0);     //VMAX=100000
  tmcSendData(0xAA,0x00000578);     //D1=1400
  tmcSendData(0xAB,0x0000000A);     //VSTOP=10

  tmcSendData(0xA0,0x00000000);     //RAMPMODE=0

  tmcSendData(0xA1,0x00000000);     //XACTUAL=0
  tmcSendData(0xAD,0x00000000);     //XTARGET=0
}
BR, ADi

kaleun96
Posts: 193
Joined: Sat Oct 20, 2018 3:47 pm
Location: Stockholm, Sweden

Post by kaleun96 »

Adalbert wrote:Hi Kaleun96,
I use TMC5130A via SPI. STEP/DIR wouldn’t make any sense.
So, I have to calculate/determine the target-position and send it to the driver.
In my case the speed of the processor doesn’t play any role.
I’m afraid the speed of the step-motor is the bottle neck :-(
You only can improve the speed of the rail by the changing of the settings of the driver e.g. decrease the number of the micro-steps.
BR, ADi
When you mentioned your slowest setting gave you 150mm in 3 minutes, is this the setting you often run at or just the slowest as an example?

I'm often only using 16 or 32 microsteps and find the noise and vibrations to be extremely low, even running at a fast speed. I've tried increasing the microsteps but I found it difficult to have the StallGuard trigger reliably that way. I would need to implement better ramping, maybe something similar to Mike with dynamic microstep control, to get it to work with StallGuard at high microsteps better I think.

I can however switch to high microsteps when I'm stepping small distances for a stack.
In my case the speed of the processor doesn’t play any role.
Can I ask which Arduino board you're using? As you say, using direct SPI control does make clock speed somewhat irrelevant given how fast it can communicate.

Someone should look into making a SPI-driven AccelStepper library. I vaguely recall looking into it myself but for some reason backed off the idea, perhaps it was more difficult than I first suspected.

The advantage is having a standard set of functions for acceleration, positioning, homing, controlling multiple steppers, etc. I imagine most here want more customization than that but those settings could still be worked into a generic library. At the moment, I suspect most of us are writing our own functions for these things and essentially replicating the same work multiple times independently.
BTW I've found that the Trinamic 5160 StepStick has the chip forced (wired) into the Step and Dir mode and can't be easily changed
Hey Mike, do you know if those are the same boards sold by Watterott? They do look very similar but the Watterott documentation doesn't seem to mention this limitation.
https://learn.watterott.com/silentsteps ... g/tmc5160/

Though I'm a little unsure how they are forced into STEP/DIR mode, I thought it was mainly a choice between using SPI and CFG for configuration, and if you're in CFG standalone mode you can only use the CFG pins to set microsteps and you have to control the stepper via STEP/DIR pins. But if you're in SPI mode, you can configure via SPI and step using the STEP/DIR pins or you can config via SPI and also control the motor via SPI.

It's been awhile since I read the datasheet so maybe I'm missing something!
- Cam

mawyatt
Posts: 2479
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater

Post by mawyatt »

Adalbert wrote:Hi Mike,
Not sure how you've got these Trinamics configured with the Arduino
My setting-method looks like follows:

Code: Select all

void Rail::tmcSetup(void) 
{
  pinMode(_tmc_CSN,OUTPUT);
  pinMode(_tmc_DRV_ENN, OUTPUT);
  digitalWrite(_tmc_CSN,HIGH);
  digitalWrite(_tmc_DRV_ENN,LOW);


  SPI.setBitOrder(MSBFIRST);
  SPI.setClockDivider(SPI_CLOCK_DIV8);
  SPI.setDataMode(SPI_MODE3);
  SPI.begin();

  Serial.begin(9600);

  tmcSendData(0x80,0x00000000);      //GCONF

  tmcSendData(0xEC,0x000101D5);      //CHOPCONF: TOFF=5, HSTRT=5, HEND=3, TBL=2, CHM=0 (spreadcycle)
  tmcSendData(0x90,0x00070603);      //IHOLD_IRUN: IHOLD=3, IRUN=10 (max.current), IHOLDDELAY=6
  tmcSendData(0x91,0x0000000A);      //TPOWERDOWN=10

  tmcSendData(0xF0,0x00000000);      // PWMCONF
  //tmcSendData(0xF0,0x000401C8);    //PWM_CONF: AUTO=1, 2/1024 Fclk, Switch amp limit=200, grad=1

  tmcSendData(0xA4,0x000003E8);     //A1=1000
  tmcSendData(0xA5,0x000186A0);     //V1=100000
  tmcSendData(0xA6,0x0000C350);     //AMAX=50000
  tmcSendData(0xA7,0x000186A0);     //VMAX=100000
  tmcSendData(0xAA,0x00000578);     //D1=1400
  tmcSendData(0xAB,0x0000000A);     //VSTOP=10

  tmcSendData(0xA0,0x00000000);     //RAMPMODE=0

  tmcSendData(0xA1,0x00000000);     //XACTUAL=0
  tmcSendData(0xAD,0x00000000);     //XTARGET=0
}
BR, ADi
ADI,


Just took a quick look, and don't see a VStart?

I use a Clock of 15.000MHz

Here's a general setup with some parameters for a TMC5130 with 400 step NEMA 17 motor on a KR20 with 1mm pitch.

VStart 10
VStop 20
V1 25000
D1 600
Amax 2200
Dmax 1700
A1 800
Vmax 512000

GSTAT 0
GCONF 04
CHOPCONF 100C3
IHOLD_IRUN 80F0A
TPOWERDOWN 0A
TPWMTHRS 01F4
PWMCONF 401C8
SWMODE 0825
RAMPMODE 0

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

mawyatt
Posts: 2479
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater

Post by mawyatt »

kaleun96 wrote:
Adalbert wrote:Hi Kaleun96,
I use TMC5130A via SPI. STEP/DIR wouldn’t make any sense.
So, I have to calculate/determine the target-position and send it to the driver.
In my case the speed of the processor doesn’t play any role.
I’m afraid the speed of the step-motor is the bottle neck :-(
You only can improve the speed of the rail by the changing of the settings of the driver e.g. decrease the number of the micro-steps.
BR, ADi
When you mentioned your slowest setting gave you 150mm in 3 minutes, is this the setting you often run at or just the slowest as an example?

I'm often only using 16 or 32 microsteps and find the noise and vibrations to be extremely low, even running at a fast speed. I've tried increasing the microsteps but I found it difficult to have the StallGuard trigger reliably that way. I would need to implement better ramping, maybe something similar to Mike with dynamic microstep control, to get it to work with StallGuard at high microsteps better I think.

I can however switch to high microsteps when I'm stepping small distances for a stack.
In my case the speed of the processor doesn’t play any role.
Can I ask which Arduino board you're using? As you say, using direct SPI control does make clock speed somewhat irrelevant given how fast it can communicate.

Someone should look into making a SPI-driven AccelStepper library. I vaguely recall looking into it myself but for some reason backed off the idea, perhaps it was more difficult than I first suspected.

The advantage is having a standard set of functions for acceleration, positioning, homing, controlling multiple steppers, etc. I imagine most here want more customization than that but those settings could still be worked into a generic library. At the moment, I suspect most of us are writing our own functions for these things and essentially replicating the same work multiple times independently.
BTW I've found that the Trinamic 5160 StepStick has the chip forced (wired) into the Step and Dir mode and can't be easily changed
Hey Mike, do you know if those are the same boards sold by Watterott? They do look very similar but the Watterott documentation doesn't seem to mention this limitation.
https://learn.watterott.com/silentsteps ... g/tmc5160/

Though I'm a little unsure how they are forced into STEP/DIR mode, I thought it was mainly a choice between using SPI and CFG for configuration, and if you're in CFG standalone mode you can only use the CFG pins to set microsteps and you have to control the stepper via STEP/DIR pins. But if you're in SPI mode, you can configure via SPI and step using the STEP/DIR pins or you can config via SPI and also control the motor via SPI.

It's been awhile since I read the datasheet so maybe I'm missing something!
cam,

The Watterott StepStick is probably the same, I got my 2 StepSticks from DigiKey.

The TMC5160 chip has a configuration SD_MODE (pin 21) which is connected to Vcc_IO underneath the chip, which is the smaller footprint QFN56 package (very difficult to manipulate without automated equipment). This forces the chip into the Step and Dir control rather than internal control.

https://www.trinamic.com/fileadmin/asse ... ev1.10.pdf

The TMC5160 BOB has SD_MODE (pin 21) tied to ground with R2, and a position for R1 to tie to Vcc_IO. I have no idea why they didn't do this with the StepStick, seems like a silly oversight IMO!

https://www.trinamic.com/fileadmin/asse ... Rev1.1.pdf

I have this nice PCB designed for the TMC5160 StepStick and TMC5072 BOB for 3 axis S&S, this was created to allow the high current 5160 for Z axis and lower current 5072 for X & Y. It's useless unless I can modify the StepStick. Still have the 5130 & 5072 based 3 axis S&S Controllers tho, but the 5130 can't handle the higher current (2.8A vs. 1.4A) of the 5160. Also have the dual 5072 4 Axis Controllers, but the current is lower at 1.1A on each of the 4 axises.

Best,
Last edited by mawyatt on Sun Jan 05, 2020 9:13 am, edited 1 time in total.
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

Adalbert
Posts: 1134
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hi Kaleun96,
is this the setting you often run at or just the slowest as an example?
yes, it was an example.
And yes I’m not interested in the speed of the rail but in its accuracy.
Usually I take the photographs with the microscope objectives with the NA >= 0.42 (3 shots a DOF or more).
Can I ask which Arduino board you're using?
Arduino Uno
https://www.photomacrography.net/forum/ ... c&start=45
BTW, I use my software only and can change and implement whatever I want :-)

BR, ADi

Adalbert
Posts: 1134
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hi Mike,
Many thanks for your settings!
BR, ADi

mawyatt
Posts: 2479
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater

Post by mawyatt »

Adalbert wrote:Hi Mike,
Many thanks for your settings!
BR, ADi
ADi,

You are welcome.

Next stop Piezo Stages :wink:

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

kaleun96
Posts: 193
Joined: Sat Oct 20, 2018 3:47 pm
Location: Stockholm, Sweden

Post by kaleun96 »

mawyatt wrote: The TMC5160 BOB has SD_MODE (pin 21) tied to ground with R2, and a position for R1 to tie to Vcc_IO. I have no idea why they didn't do this with the StepStick, seems like a silly oversight IMO!
Hey Mike, just noticed Watterott now have a v1.4 version of the TMC5160 that can enable the SD_MODE Motion Controller: https://learn.watterott.com/silentsteps ... g/tmc5160/
"To activate the motion controller the SD_MODE jumper has to be opened and the SD_MODE pin of the jumper has to be set to GND with a wire (SD_MODE=0). See Schematics."

I'm going to attempt to rewrite my project to take advantage of this when the new one comes in the mail. I can then do away with the AccelStepper library and limitations of DigitalWrite() on Arduino but the board I'm using (SAMD51 based) has little documentation for non-engineers so some things (timers, interrupts) will be difficult to work out at first.
- Cam

mawyatt
Posts: 2479
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater

Post by mawyatt »

kaleun96 wrote:
mawyatt wrote: The TMC5160 BOB has SD_MODE (pin 21) tied to ground with R2, and a position for R1 to tie to Vcc_IO. I have no idea why they didn't do this with the StepStick, seems like a silly oversight IMO!
Hey Mike, just noticed Watterott now have a v1.4 version of the TMC5160 that can enable the SD_MODE Motion Controller: https://learn.watterott.com/silentsteps ... g/tmc5160/
"To activate the motion controller the SD_MODE jumper has to be opened and the SD_MODE pin of the jumper has to be set to GND with a wire (SD_MODE=0). See Schematics."

I'm going to attempt to rewrite my project to take advantage of this when the new one comes in the mail. I can then do away with the AccelStepper library and limitations of DigitalWrite() on Arduino but the board I'm using (SAMD51 based) has little documentation for non-engineers so some things (timers, interrupts) will be difficult to work out at first.
Cam,

Thanks for the update on these, glad to see someone realize that the Trinamic PCB was seriously hampered by forcing into the Step/Dir mode, and not allowing access to the full suite of chip features. Hopefully these Watterott v1.4 versions will appear over here at Digikey or Mouser so I can get a few.

I took a quick look at the schematic and PCB layout and these Watterott v1.4 should work fine without any changes. Now I have a Triple Axis Trinamic controller with a TMC5160 and TMC5072 :D

I suspect you will find a significant improvement when utilizing the TMC5160 on-chip control features vs. the library. My experience has shown that hardware implementations significantly outperform software where control algorithms are concerned, mainly because hardware performs much faster than software.

Anyway, thanks for this info. Now I need to hope a US source for these shows up.

BTW you could now try the RPi, since you don't need the features of the Arduino and library now, just a thought.

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

kaleun96
Posts: 193
Joined: Sat Oct 20, 2018 3:47 pm
Location: Stockholm, Sweden

Post by kaleun96 »

mawyatt wrote:
Cam,

Thanks for the update on these, glad to see someone realize that the Trinamic PCB was seriously hampered by forcing into the Step/Dir mode, and not allowing access to the full suite of chip features. Hopefully these Watterott v1.4 versions will appear over here at Digikey or Mouser so I can get a few.

I took a quick look at the schematic and PCB layout and these Watterott v1.4 should work fine without any changes. Now I have a Triple Axis Trinamic controller with a TMC5160 and TMC5072 :D

I suspect you will find a significant improvement when utilizing the TMC5160 on-chip control features vs. the library. My experience has shown that hardware implementations significantly outperform software where control algorithms are concerned, mainly because hardware performs much faster than software.

Anyway, thanks for this info. Now I need to hope a US source for these shows up.

BTW you could now try the RPi, since you don't need the features of the Arduino and library now, just a thought.

Best,
No problem Mike. It may be worth asking if Digikey/Mouser are actually selling the new version but showing the old. The photos on Watterott are of version 1.3 but I confirmed with them that they're shipping the v1.4 now. If you would like I can take a photo of the new one to make identification easier, but you can also tell from the jumper for SD_MODE and different via layout on PCBs.

I'd offer to ship you one too but shipping from Sweden is outrageous even within the EU so probably not worth your hassle. Let me know if you're interested though!

I think I will still stick with the Arduino for now, the SAMD51's should be fast enough for my needs I think. I can also take advantage of some existing libraries (e.g. for the TFT displays) and there's a TMC Stepper library that can save me the trouble of identifying and writing to registers directly.

I'm also in the middle of writing a small button library for TFT displays, updating my the UI of my existing project for a 3.5" TFT display (previously 2.8"), and swapping out my main rail for a THK KR26. Want to get it all done before early summer so have probably bitten off more than I can chew for now :D
- Cam

mawyatt
Posts: 2479
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater

Post by mawyatt »

kaleun96 wrote:
mawyatt wrote:
Cam,

Thanks for the update on these, glad to see someone realize that the Trinamic PCB was seriously hampered by forcing into the Step/Dir mode, and not allowing access to the full suite of chip features. Hopefully these Watterott v1.4 versions will appear over here at Digikey or Mouser so I can get a few.

I took a quick look at the schematic and PCB layout and these Watterott v1.4 should work fine without any changes. Now I have a Triple Axis Trinamic controller with a TMC5160 and TMC5072 :D

I suspect you will find a significant improvement when utilizing the TMC5160 on-chip control features vs. the library. My experience has shown that hardware implementations significantly outperform software where control algorithms are concerned, mainly because hardware performs much faster than software.

Anyway, thanks for this info. Now I need to hope a US source for these shows up.

BTW you could now try the RPi, since you don't need the features of the Arduino and library now, just a thought.

Best,
No problem Mike. It may be worth asking if Digikey/Mouser are actually selling the new version but showing the old. The photos on Watterott are of version 1.3 but I confirmed with them that they're shipping the v1.4 now. If you would like I can take a photo of the new one to make identification easier, but you can also tell from the jumper for SD_MODE and different via layout on PCBs.

I'd offer to ship you one too but shipping from Sweden is outrageous even within the EU so probably not worth your hassle. Let me know if you're interested though!

I think I will still stick with the Arduino for now, the SAMD51's should be fast enough for my needs I think. I can also take advantage of some existing libraries (e.g. for the TFT displays) and there's a TMC Stepper library that can save me the trouble of identifying and writing to registers directly.

I'm also in the middle of writing a small button library for TFT displays, updating my the UI of my existing project for a 3.5" TFT display (previously 2.8"), and swapping out my main rail for a THK KR26. Want to get it all done before early summer so have probably bitten off more than I can chew for now :D
Good idea, I'll ping Digikey to see if they know and let you know. I did look closely at the layout of the V1.4 and noted the area where he jumpers are. Agree, shipping from anywhere outside the US seems expensive, I know!!

When utilizing the on-chip features of the Trinamic, you don't have to worry about counting steps and such since it's taken care of with an internal 32 bit counter, and you always know where you are on the rail. The various velocity profiles are very useful and make the actual motor/rail perform amazing smooth and still quite quick to move with the proper parameters. Think you'll be very pleased with how well this works since you are coming from a Step/Dir mode under software control situation.

Best,

Edit:
Checked with DigiKey and that don't know if they will have the 1.4 Version, and said they only supply the Trinamic boards. Also said evidently Watterott is the Trinamic supplier for these boards, so maybe the V1.4 will end up at Digikey someday.
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

kaleun96
Posts: 193
Joined: Sat Oct 20, 2018 3:47 pm
Location: Stockholm, Sweden

Post by kaleun96 »

I started experimenting with the Motion Controller mode of the TMC5160 this week.

Wow. Not only is the performance amazing, it seems to be so much easier to control and calibrate than relying on software control (i.e. via SPI). I could plug in some starting values and off it went. Using SPI really is a huge bottleneck for this driver, glad I tried this out this updated version.

Soldering the jumper from the pad to the GND pin was a bit tricky. If you solder SMD components (I don't) it's probably straight forward and while I managed to do it without trouble, it's not something I'd recommend for someone looking for a plug-n-play driver.

I haven't done any proper speed testing yet and I'm still dialling in the parameters. At the moment it seems to cover the 115mm length of travel (~370,000 microsteps at 1/16, 2mm pitch, 0.9 degree motor) in about 3-4 seconds. Previously this would have taken 15-20 seconds or so via SPI mode.

Goal for this weekend is to work out how to use StallGuard2 via this mode and also get the joystick mode working (nice of them to provide suggestions for this). After that, I hope it'll be a straight-forward implementation into my existing controller code.
- Cam

Post Reply Previous topicNext topic