Author Topic: the last challenge is: how to detect if a stepper-motor is rotating  (Read 7229 times)

0 Members and 1 Guest are viewing this topic.

Offline Nusa

  • Super Contributor
  • ***
  • Posts: 2416
  • Country: us
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #25 on: August 19, 2018, 07:31:29 pm »
You need to work on your basic knowledge of stepper motors first. What you describe in your original post is right for a 4-phase unipolar motor. That would require 5 wires minimum if a common ground is used, 6 wires for a common ground per phase, or 8 wires if the coils are independent. But you later say there are only 4 wires going to the motor, which means you have a TWO-phase bipolar stepper motor. (6 and 8 wire unipolar motors can wired in a bipolar configuration. 5-wire motors can't.)

Most motors you come across in consumer-level 3-d printers are going to be bipolar. The full-step sequence for the a two-phase bipolar motor is accomplished by reversing the phases in sequence like so: ++, +-, --, -+, ++. For half-stepping you it would be: ++, +0, +-, 0-, --, -0, -+, 0+, ++. For microstepping you keep dividing the number of steps between full-range + and -, trading torque for precision. Some degree of microstepping is usually used in printers...you don't need a huge amount of torque. The really good drivers will actively switch between full-stepping and microstepping as required.

Anyway, back to the actual problem. I'd suggest the easiest way to is simply to put a cheap camera pointed at the device with software set up to detect movement. If it fails to detect movement for a configurable amount of time, sound the alarm for someone to check on it.
« Last Edit: August 19, 2018, 07:34:13 pm by Nusa »
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #26 on: August 19, 2018, 08:02:20 pm »
What you describe in your original post is right for a 4-phase unipolar motor. That would require 5 wires minimum

The motor used to move the printing-wire is a unipolar motor, I was talking about the four wires for the 4-phases, the 5th wire was not mentioned since it doesn't add any contributions to the idea I was describing  :popcorn:
 

Offline Nusa

  • Super Contributor
  • ***
  • Posts: 2416
  • Country: us
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #27 on: August 19, 2018, 08:12:16 pm »
Hey, we can only go on what you tell us, not what you omit.

Quote
Four wires go the stepper-motor from the driver. Right? You can't cut them to add a patch to them, in order to know if the current flowing through them. This is what I called (current) "sniff".

Now if you'd said five wires, then I'd immediately say you have no need to sense the first four wires. Looking for current changes in the common ground would be sufficient to detect activity. And it would work with micro-stepping.
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4422
  • Country: dk
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #28 on: August 19, 2018, 08:30:43 pm »
Hey, we can only go on what you tell us, not what you omit.

Quote
Four wires go the stepper-motor from the driver. Right? You can't cut them to add a patch to them, in order to know if the current flowing through them. This is what I called (current) "sniff".

Now if you'd said five wires, then I'd immediately say you have no need to sense the first four wires. Looking for current changes in the common ground would be sufficient to detect activity. And it would work with micro-stepping.

the fifth wire would normally be supply and the current shouldn't change much,  it is just "alternating" between the coils

 

Offline JS

  • Frequent Contributor
  • **
  • Posts: 947
  • Country: ar
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #29 on: August 20, 2018, 01:23:29 am »
Are you trying to close the loop or just check if the thing is moving?

If all is wired correctly as you send the signal to the driver the current will be there, so I don't see the point just seeing if the driver is actually trying to drive the motors. With some sensitive care in the current sensing you can detect you are missing steps but how many is hard to tell and just knowing you are missing them allows to pause the print and throw away less plastik but not to get a better print. If you do close the loop with encoders or whatever you can get better and faster prints, as you know how much you moved and keep moving till you get there, you can push the thing harder and don't mind missing a few steps that you are going to recover.

JS

If I don't know how it works, I prefer not to turn it on.
 

Offline besauk

  • Contributor
  • Posts: 25
  • Country: us
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #30 on: August 20, 2018, 01:33:58 am »
Try looking at the transient voltage on the lines with a scope when stepping and when restricted from turning.  I think you'll see a notch in the voltage when the stepper moves, and that notch will be noticeably missing when it is kept from turning.  An analog differentiator and comparator could be set up to 'catch' that notch.  Same idea applies when trying determine if a solenoid really moved or got stuck.  Just a thought.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #31 on: August 20, 2018, 07:30:05 am »
Try looking at the transient voltage on the lines with a scope when stepping and when restricted from turning.  I think you'll see a notch in the voltage when the stepper moves, and that notch will be noticeably missing when it is kept from turning.  An analog differentiator and comparator could be set up to 'catch' that notch.  Same idea applies when trying determine if a solenoid really moved or got stuck.  Just a thought.

Wow, that's definitively an intriguing idea. Thanks, I will for sure experiment it!
 

Offline In Vacuo Veritas

  • Frequent Contributor
  • **
  • !
  • Posts: 320
  • Country: ca
  • I like vacuum tubes. Electrons exist, holes don't.
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #32 on: August 20, 2018, 02:39:26 pm »
A camera with OpenCV?
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4422
  • Country: dk
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #33 on: August 20, 2018, 05:39:46 pm »
Try looking at the transient voltage on the lines with a scope when stepping and when restricted from turning.  I think you'll see a notch in the voltage when the stepper moves, and that notch will be noticeably missing when it is kept from turning.  An analog differentiator and comparator could be set up to 'catch' that notch.  Same idea applies when trying determine if a solenoid really moved or got stuck.  Just a thought.

but that requires connection to the wires which apparently isn't possible
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #34 on: August 20, 2018, 06:31:06 pm »
That's what dual shaft steppers and rotary encoders are for.
and you can't change your steepers, neither add an encoder, in my case: you can't, that's *THE* problem :D
I think I have already warned you not to use steppers without encoders.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #35 on: August 20, 2018, 07:33:36 pm »
I think I have already warned you not to use steppers without encoders.

feel free to address your claim to the company who built the 3dprinter. They offer the warranty but only if don't modify the frame/motors, and it's so fscking irritating, no doubt about it is, but that's is the problem I have to solve  :D

edit:
for the record, it's also irritating that a 2500 euro 3d printer doesn't come with all the sensors already installed, including a holy sensor to stop the printing-wire motor to rotate when the wire is blocked, and feature like x,y,z coordinates exported(1) to resume the print from the point it was interrupted when the electricity is lot; for such amount of money we wish all of this already built-in ... and it didn't happen,  that's life.

(1) we sorted out by adding a UPS battery in the hope the electricity comes back online with a time windows of one hour as batteries won't last long.
« Last Edit: August 20, 2018, 07:43:55 pm by legacy »
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #36 on: August 20, 2018, 07:53:30 pm »
How about simply returning it and buy something which works? You already knew where to look for: encoders on the steppers so why did this POS made it past your doorway?
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #37 on: August 20, 2018, 09:33:06 pm »
How about simply returning it and buy something which works?

in my team I am THE person who wishes to return the printer, but ... you know about the democratic theory of voting? well, the rest of the group say No-Go! Probably because we can't return the 3d-printer without wasting up to the 40% of the money. More than one month has already gone since the purchase, and that is what is written in the contract  :palm:

That 3d-printer isn't so shitty, anyway, it's solid, it comes with a decent slicer that is 100% compatible with SolidWorks, and it does a good job, it's also certified on the paper to be hosted and used in a public a room (e.g. a toy shop) since it has a fire hazard alarm.

But it's definitively hilarious that it has a built-in fire hazard alarm, but not a fscking sensor to stop the printing wire, and to completely stop the unit when there is a problem with the extruder.

This makes it irritating when we use certain 3d-printing wires, and they block the extruder while the stupid printer goes ahead, and we waste time before realizing what happened, praying to what might also happen, like a bit damage to the wire-loader mechanism, that is, of course, covered by the warranty, but ... it takes up to three weeks to be replaced, and for sure we can't babysit the machine for twenty hours of printing to avoid it happening :palm: :palm: :palm:
 
« Last Edit: August 20, 2018, 09:44:04 pm by legacy »
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #38 on: August 20, 2018, 11:21:24 pm »
Is the back end of the stepper-motor visible?  Even if the shaft doesn't extend beyond the motor body?
I have seen examples where people just glue something on to the end of the shaft which can be used to visually sense movement.
It can be easily snapped off if you need to restore the gadget for return, etc.
Some integrated motor controllers just glue a disc magnet onto the end of the shaft and use a hall-effect sensor to detect rotary motion.

Photos would quite possibly stimulate further ideas for solutions.
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4422
  • Country: dk
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #39 on: August 20, 2018, 11:32:58 pm »
Is the back end of the stepper-motor visible?  Even if the shaft doesn't extend beyond the motor body?
I have seen examples where people just glue something on to the end of the shaft which can be used to visually sense movement.
It can be easily snapped off if you need to restore the gadget for return, etc.
Some integrated motor controllers just glue a disc magnet onto the end of the shaft and use a hall-effect sensor to detect rotary motion.

Photos would quite possibly stimulate further ideas for solutions.

https://www.kickstarter.com/projects/301805155/ustepper
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #40 on: August 22, 2018, 12:08:27 pm »
What about a simple microphone ?
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #41 on: August 22, 2018, 12:50:07 pm »
What about a simple microphone ?

I have already used an ultrasonic microphone with an LO (local oscillator) to report the frequency into the audio-spectrum, and used a dsPIC to sample, filter and trigger-detect the event, which in this case is "the rotor of the motor is rotating", whose spectrum and proprieties - I suppose - must be unique, therefore identifiable from the ambient noise with a decent S/N ratio in order to have a low failure rate at false positive. This is what I am worried about the microphone method :-//

anyway, I am waiting for HAL sensors, and other components to be delivered, then I will try all the suggested methods  :D
 

Offline perieanuo

  • Frequent Contributor
  • **
  • Posts: 838
  • Country: fr
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #42 on: September 14, 2018, 09:17:24 am »
Once I had to measure rpm speed of a 45 KW motor, cheef engineer says the motor was tooo slow.
I put a reflexive aluminium little piece of adhesive alu, put 5V on a reflexive optical sensor,put my multimeter on Frequency position and that's it.That was in 1996,my first year as engineer
Not much intrusive as method...
And yeah,the motor had the correct speed.
So just draw some star lines on the back of the shaft with some black marker, get o slower sensitivity on the optical sensor and you can obtain even rotor position.
It's not theory,it works.
But if you guys want sophysticated hall sensor solutions with peak monitor pid monitoring,it can be done.
It depends on what you need,see if motor turns or more precise position redings.
Regards,pierre


Envoyé de mon iPad en utilisant Tapatalk
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #43 on: September 14, 2018, 01:29:10 pm »
So just draw some star lines on the back of the shaft with some black marker, get o slower sensitivity on the optical sensor and you can obtain even rotor position.
A sensor from an optical mouse would be great for sensing movement of the pattern. It is just a low-resolution camera and light source in a tiny package. And you can get one for free (or the cost of a cheap, generic optical mouse)  Nice and small to mount on the end of the motor.  And should be pretty simple to interface. You are just looking for a CHANGE in the image (to indicate rotation). You don't need to actually measure movement, etc.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #44 on: September 14, 2018, 01:48:28 pm »
So just draw some star lines on the back of the shaft

all good and neat, but ... there is no space back of the shaft  :palm: :palm: :palm: :palm:
 

Offline perieanuo

  • Frequent Contributor
  • **
  • Posts: 838
  • Country: fr
the last challenge is: how to detect if a stepper-motor is rotating
« Reply #45 on: September 14, 2018, 03:40:01 pm »
So just draw some star lines on the back of the shaft

all good and neat, but ... there is no space back of the shaft  :palm: :palm: :palm: :palm:
You're shure?I worked with 39x39 step motors,can be done.if not in the back side,find a point in the front side shaft or on the mechanical moving part.
I worked (in fact,manufactured) once laser reflexion detection sensors, expensive of course,the beam was 1-1.5mm diameter,if you got a laser point it om moving part and stick some reflexion aluminium for example,then detecting returning laser beam is piece of cake,I used modulated 10 KHz beam to avoid interference.You need 1 square mm free space on moving part to do it like this.for detecting laser returning beam I used light detector sensor with incorporated lens .worked from 2cm distance up to several metres with class 1 or 2red laser.
But I'm sure you can do it with generic light reflexion sensor, i had experiences from for example textile industry,I had detection like this for fabric detection.and if detection was too strong (like light source for machine operator) I put some semitranslucide stuff between and get the sensor trigerring even with great light 20 W halogen present at less than 10 cm.
Try,you can succeed with no more than a few euros from farnell if you "fabric" yourself the detector.and stick to infrared imho.
Laser solution works great but cost is elevate.
Regards,pierre


Envoyé de mon iPad en utilisant Tapatalk
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #46 on: September 14, 2018, 04:37:52 pm »
all good and neat, but ... there is no space back of the shaft  :palm: :palm: :palm: :palm:
It would be extraordinarily helpful if you could post photos of what you are dealing with.
Else we are all just wasting our time shooting around here in complete darkness.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #47 on: September 14, 2018, 06:06:39 pm »

optical flow sensor, 128x128bit, SPI output

due to the frame of the 3d printer, there is absolutely no space on the back side and there is absolutely no space in the front side shaft. Can't be done with an optical sensor like an optical flow like the one in the pic, unless you are willing to use a fiberglass wire ... which is frankly crazy and costly.
« Last Edit: September 14, 2018, 06:27:09 pm by legacy »
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #48 on: September 14, 2018, 06:10:12 pm »
we are wasting our time

I have already solved the problem with a HAL sensor, attached to flat-cable. You can avoid wasting your precious time.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: the last challenge is: how to detect if a stepper-motor is rotating
« Reply #49 on: September 14, 2018, 06:24:14 pm »
oh, about that, the circuit I have made is able to detect the notch made by the motor of a quartz watch, it just needs to be the closest possible.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf