Author Topic: step motors: how to extract info from the coils  (Read 2464 times)

0 Members and 1 Guest are viewing this topic.

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
step motors: how to extract info from the coils
« on: May 04, 2018, 04:04:36 pm »
no doubt a thing that is not what it is purported to be, but ...

... but I have a closed-source 3d-printer device that handles three step-motors and it doesn't bark-report the X-Y-Z position to the operator, and it would be useful to know at which step of the gcode-model it has arrived during the process.

Due to dimension (and silly design of the engine) problems, I can't mount encoders  :palm: :palm: :palm:

So, you have three bipolar step-motor, powered at 24V, and you can't hack the motherboard to extract the command line (that is TTL), you are after the driver, everything else is a black-box (literally).

It’s a common approach in the industrial world to micro-step a stepper motor to achieve better resolution in the system. The movement of the stepper motor is caused by exciting currents through the motor coils, and since the goal is to divide a full motor step into multiple micro-steps, the “how-to” part of the task is very straightforward – simply generate multiple current levels. This is the so-called “current regulation” in stepper motor controls.


two H-briges are used to drive the motor, one bridge per coil
I do not know how the driver works internally, but probably
it applies PWM to the "V+motor supply" of the bridge in the fig.


Thus, on a pure logic level I can design a mini-CPLD module able to follow the microstepping increment/decrement (that means I can have a status array, {X,Y,Z}, to be queried on demand through a serial connection, from this CPLD to a .. say .. linux board), but I have some doubt about the physical interface, (how to sense the current?) and more specifically about HOW to extract this information on the driver side at coils: cause I can only access coils!

Trough a couple of Optoencoders per coil? Ummmm


Tips? Idea?  :D
« Last Edit: May 04, 2018, 04:08:58 pm by legacy »
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4427
  • Country: dk
Re: step motors: how to extract info from the coils
« Reply #1 on: May 04, 2018, 04:36:47 pm »
no doubt a thing that is not what it is purported to be, but ...

... but I have a closed-source 3d-printer device that handles three step-motors and it doesn't bark-report the X-Y-Z position to the operator, and it would be useful to know at which step of the gcode-model it has arrived during the process.

Due to dimension (and silly design of the engine) problems, I can't mount encoders  :palm: :palm: :palm:

So, you have three bipolar step-motor, powered at 24V, and you can't hack the motherboard to extract the command line (that is TTL), you are after the driver, everything else is a black-box (literally).

It’s a common approach in the industrial world to micro-step a stepper motor to achieve better resolution in the system. The movement of the stepper motor is caused by exciting currents through the motor coils, and since the goal is to divide a full motor step into multiple micro-steps, the “how-to” part of the task is very straightforward – simply generate multiple current levels. This is the so-called “current regulation” in stepper motor controls.


two H-briges are used to drive the motor, one bridge per coil
I do not know how the driver works internally, but probably
it applies PWM to the "V+motor supply" of the bridge in the fig.


Thus, on a pure logic level I can design a mini-CPLD module able to follow the microstepping increment/decrement (that means I can have a status array, {X,Y,Z}, to be queried on demand through a serial connection, from this CPLD to a .. say .. linux board), but I have some doubt about the physical interface, (how to sense the current?) and more specifically about HOW to extract this information on the driver side at coils: cause I can only access coils!

Trough a couple of Optoencoders per coil? Ummmm


Tips? Idea?  :D


I think rand() will be slightly more accurate 




 
The following users thanked this post: nugglix

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: step motors: how to extract info from the coils
« Reply #2 on: May 04, 2018, 05:26:20 pm »
I think rand() will be slightly more accurate

oh, well, humor.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: step motors: how to extract info from the coils
« Reply #3 on: May 04, 2018, 05:38:25 pm »
why do you need to quote the whole universe to reply a bullshit?

... looking at my shoes ...

... but that's not the irritating point. These 3d-printers are made to be irritating ... you know? the task takes 14 hours to complete, and it's missing just 4 minutes to fully complete the job, when ...

oh-oh-oh the electricity is interrupted, and you have to start from the beginning  :palm: :palm: :palm: :palm: :palm:

but, you can't hack the printer!  Do you want extra features? like resume from electricity interrupted? those dudes know how to make it impossible, and you have to pay more money for the enhanced version.


That's life. Anyway  :popcorn:
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: step motors: how to extract info from the coils
« Reply #4 on: May 04, 2018, 06:03:26 pm »
so, what have we learned?
- 3d-printers do use micro stepping
- micro stepping is more complex

how accurate is micro stepping? an article on hackaday.

Interesting  :popcorn:
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: step motors: how to extract info from the coils
« Reply #5 on: May 04, 2018, 06:11:12 pm »
( as far as I have understood, "probably" 3d-Printers benefit from micro stepping by reducing surface artifacts )
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11648
  • Country: my
  • reassessing directives...
Re: step motors: how to extract info from the coils
« Reply #6 on: May 04, 2018, 11:46:30 pm »
... but that's not the irritating point. These 3d-printers are made to be irritating ... you know? the task takes 14 hours to complete, and it's missing just 4 minutes to fully complete the job, when ...
oh-oh-oh the electricity is interrupted, and you have to start from the beginning  :palm: :palm: :palm: :palm: :palm:
i think the last 4 minutes is on the last layer. i will just scrap the last layer and live with it i dont think its too important, its not like you have to scrap 7 hours or 10 hours job. with many layers to go and the printed output still exposing holes on it.

but, you can't hack the printer!  Do you want extra features? like resume from electricity interrupted? those dudes know how to make it impossible, and you have to pay more money for the enhanced version.
i thought about this, but if it doesnt exist you have to make yourself well.... the cheaper solution maybe is battery backup UPS and auto start GenSet. to avoid power outage

That's life. Anyway  :popcorn:
yes 3d print operators well aware of this. the people involved in OSS reprap development should easily implement this by providing "pause" and "resume" print for power outage issue. but we havent seen that happening its ironic, if i know the code i'm the one who will do that. pause meaning, saving in temporary file in sdcard the location of the last executed gcode file location and name, and last coordinate and other necessary setting for the next "resume" printing when power is restored. i saw "pause" and "Resume" function but i dont think its for power outage situation, when printer is OFFed everything back to zero we have to start again. but this feature will still require battery backup ups regardless, to give time to save the necesary parm before shutting down. and when shutted down, you absolute cant touch anything inside the 3d printer, leave it as it were or you'll screw up when resume printing.

back to your question, i think hacking into motherboard to tap the stepper pulses command will be much economical in term of time and cost developing your state of the art current detection stepper motion. thats why i think you got a funny reply ;) ymmv.
« Last Edit: May 04, 2018, 11:49:59 pm by Mechatrommer »
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline Nusa

  • Super Contributor
  • ***
  • Posts: 2416
  • Country: us
Re: step motors: how to extract info from the coils
« Reply #7 on: May 05, 2018, 01:09:39 am »
Just be aware that some of the smarter stepper drivers and/or software will switch between full stepping and various levels of microstepping depending on what motion is required. Which is all countable in terms of phase changes, but don't expect microsteps to be individually detectable at all times.

 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: step motors: how to extract info from the coils
« Reply #8 on: May 05, 2018, 02:30:59 am »
Micro-stepping is just a fancy name for driving a stepper motor with AC like signals vs two digital levels. In the past you might have used a pair of DAC's. The ratio between the two DAC outputs gives you control between the digital steps with the bits of the dac the number of microsteps.

Today, a stepper driver is using the ratio of currents and using ON/OFF to control the current. The stepper winding inductance is the filter. Due to the ON/OFF control the winding is averaging the result. So you have a ratio of voltages across the windings.

To say this a different way, some control methods for a brushed DC motor use a 50% reverse & 50% forward PWM for stop. As long as the forward & reverse match, output is stopped. For steppers you have time ratio between steps controlling shaft ratio.

To sense, think you want to measure the voltage across each stepper winding & filter some.

Todays stepper drivers are using a larger voltage source to force a faster current change in the windings, for better control.

C

« Last Edit: May 05, 2018, 02:36:19 am by C »
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: step motors: how to extract info from the coils
« Reply #9 on: May 05, 2018, 09:36:27 am »
back to your question, i think hacking into motherboard to tap the stepper pulses command

unfortunately, the motherboard is made in a very irritating way: there is a big heat sink on the top of three stepper drivers and it seems stuck on them. There are no screws, probably it's really stuck, and I can not remove without causing damage. Also, around these chips, there is a sort of black resin that makes impossible to touch pins.

the label on the control chip got blanked, what is that? Atmega? Xmega? which part? you do not need to know  :palm: :palm: :palm:

There is no jtag/programming header for any programming cable, so you can't neither try to download the firmware (that of course, it's protected)
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: step motors: how to extract info from the coils
« Reply #10 on: May 05, 2018, 09:42:21 am »
i saw "pause" and "Resume" function but i dont think its for power outage situation, when printer is OFFed everything back to zero we have to start again

Yes, a sort of pause and resume. My CPLD board would come with an independent battery, and if it's able to follow the 3d printer, it's also able to save the last position inside an NVRAM.

But imagine you also want to change the color of the printing wire. You need a triggering circuit that puts the printer into pause, so you can change the printing wire, and resume.

This kit does not exist for my 3d printer, you have to replace the whole printer with an enhanced version.

 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: step motors: how to extract info from the coils
« Reply #11 on: May 05, 2018, 10:31:18 am »

I would think that best long range thing to do is

1. use as is.

2. replace control electronics so that you gain control and can then make program & electronic changes.
Many open source 3d printer controllers exist.

C
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: step motors: how to extract info from the coils
« Reply #12 on: May 05, 2018, 11:03:13 am »
I also own an open source 3d-printer, and nothing has worked as expected. It's the reason why I bought this closed-source 3d-printer that has always done a good job.

Anyway, back to the topic, perhaps ... I have an idea to solve the pause-resume problem.
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: step motors: how to extract info from the coils
« Reply #13 on: May 05, 2018, 11:05:40 am »
yes 3d print operators well aware of this. the people involved in OSS reprap development should easily
implement this by providing "pause" and "resume" print for power outage issue. but we havent seen that happening

'we' have seen this happening, you haven't looked. It's already been done.

Quote
its ironic, if i know the code i'm the one who will do that. pause meaning, saving in temporary file in sdcard the location of the last executed gcode file location and name, and last coordinate and other necessary setting for the next "resume" printing when power is restored.

And you'll fail because there isn't time to write to an SD card if the power goes out.

Quote
this feature will still require battery backup ups regardless, to give time to save the necesary parm before shutting down.

No batteries required.

Quote
and when shutted down, you absolute cant touch anything inside the 3d printer, leave it as it were or you'll screw up when resume printing.

Nonsense. They have to rehome anyway.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: step motors: how to extract info from the coils
« Reply #14 on: May 05, 2018, 11:18:30 am »
Todays stepper drivers are using a larger voltage source to force a faster current change in the windings, for better control.

Yup. It's 24V.
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11648
  • Country: my
  • reassessing directives...
Re: step motors: how to extract info from the coils
« Reply #15 on: May 05, 2018, 12:51:07 pm »
back to your question, i think hacking into motherboard to tap the stepper pulses command
the label on the control chip got blanked, what is that? Atmega? Xmega? which part? you do not need to know  :palm: :palm: :palm:
you do have manual x/y/z control by the knob on the printer's menu right? probing each mcu pin (or the trace whichever convenient) while moving x axis stepper will enable you find the x axis control pin.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: step motors: how to extract info from the coils
« Reply #16 on: May 05, 2018, 01:15:55 pm »
you do have manual x/y/z control by the knob on the printer's menu right? probing each mcu pin (or the trace whichever convenient) while moving x axis stepper will enable you find the x axis control pin.

yep. Excellent idea! This can be done  ;D
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11648
  • Country: my
  • reassessing directives...
Re: step motors: how to extract info from the coils
« Reply #17 on: May 05, 2018, 01:31:24 pm »
be careful dont short anything ;)
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9018
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: step motors: how to extract info from the coils
« Reply #18 on: May 05, 2018, 03:33:10 pm »
Quote
this feature will still require battery backup ups regardless, to give time to save the necesary parm before shutting down.

No batteries required.
Both the Prusa MK3 and the CR-10S use capacitors for that purpose.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4427
  • Country: dk
Re: step motors: how to extract info from the coils
« Reply #19 on: May 05, 2018, 03:41:01 pm »
I think rand() will be slightly more accurate

oh, well, humor.

sorry,

ignore the microstepping, opto in parallel with each coil lots of filtering and treat the signal as you would a quadrature encoder
will get you in the ball park



 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf