Encoder with zero switch?

Thread Starter

xtal_01

Joined May 1, 2016
227
Hey guys!

So, I want to learn about Arduino's ... never used one before.

Thinking about a simple clock for my desk. Individual dials so simple mechanics ... just something to play with ... a learning tool. I have been toying with two ideas .... step motors or a servo motor with an encoder.

So my question is about zeroing the clock say every 24 hours.

1) with using a step motor, what kind of switch would I use? it would have to be very accurate (since most step motors seem to have 200 steps ...1.8 deg).

2) similar problem with a servo ... I see encoders ... 360 or 600 pulses per rev ... $20 ...but how do you get the zero? Do any encoders have built in zero switches? 360 pulses is 1 degree and 600 is only .6 deg

Is there an affordable optical switch or what would you guys recommend?

Thanks .... Mike
 

pmd34

Joined Feb 22, 2014
529
Hi Mike,
Some good questions!
You can indeed get some position encoders that have a zero position as well as the regular pulses, but they are not so common, there are also "absolute encoders" that give you a binary number out to identify exactly where they are. You can then use a normal geared DC motor and actually get to position quite accurately without needing a stepper motor.

For stepper motors you would usually use a micro switch or something similar, to identify a fix position every revolution or an end stop, as you can in fact loose steps if you over power the motor. For example I have used an "inductive proximity sensor" to detect a small pin on a movable fixture. I zero my main mechanism, and then "tune" the fixture until it just sets off the sensor. It only works from one direction with this accuracy of course.

You can also use an optical switch, the reflection type optical sensors works well, detecting a hole in something for example, but they usually take a bit more fiddling with to set up.
Magnetic read switches are perhaps the simplest to implement, or for your application maybe even a tilt switch?
 

MaxHeadRoom

Joined Jul 18, 2013
30,655
2) similar problem with a servo ... I see encoders ... 360 or 600 pulses per rev ... $20 ...but how do you get the zero? Do any encoders have built in zero switches? 360 pulses is 1 degree and 600 is only .6 deg
If talking quadrature encoders, you can get them with a 1/rev marker pulse, known as the Z pulse.
The other two are known as A & B pulses.
Max.
 

Thread Starter

xtal_01

Joined May 1, 2016
227
Thanks for all the advice!

In my mind I would either need to know the absolute position of the hands all the time or I would need to have a "zero" position that the clock would go to once or twice a day.

As I said, this it just a "toy" ... a learning experience.

I originally thought of the step motors but after reading though maybe a standard motor with an encoder. Both seem to have pros and cons. Since this is learning experience, I may just build both to see how they work.

Somewhere down the road, I have a lot of projects that I have put on the back burner while building a new house and workshop. Most require motion. I even have an CNC vertical milling machine laying in storage. It was relatively cheap as the CNC part was dead.

Figure I have got to start learning somewhere and a clock seemed to be a fun project.

Thanks so much again!

Mike
 

MaxHeadRoom

Joined Jul 18, 2013
30,655
Somewhere down the road, I have a lot of projects that I have put on the back burner while building a new house and workshop. Most require motion. I even have an CNC vertical milling machine laying in storage. It was relatively cheap as the CNC part was dead.

Mike
What is the make/model of the CNC control?
Max.
 

Thread Starter

xtal_01

Joined May 1, 2016
227
Two things ...

First, just thinking about using a motor and encoder. I am guessing you would want a brushless motor. Am I correct that a brushless DC motor (say like you use on model airplanes) is really a step motor?

If so, step motors (well most) have 200 steps. I read about micro stepping but even when multiplied by 2 or 4 or 8 or ??? .. nothing divides by 60. This is great for a milling machine where I want something that divides by 10 (or 100 or 1000) but not for a clock.

Would you (or can you) microstep the motor (just turn the controller on or off .. don't even pay attention to the # of steps) and just rely on feedback from the encoder to start and stop the motor at the right location? It may end up only "close" (but for a clock who cares) ... maybe one time stepping 3 steps and the next 4. I believe this is how a milling machine works.

Second ... the mill.

It is an MB-14 Fryer. Looked in decent shape. Ball screws were in good shape, ways, table, everything decent. The guy said the electronics had become unreliable ... seems he had to call someone in every few weeks to work on it and boards were on obsolete. He got a new one. This one if I remember had some odd servos ... maybe 140 or 150 volt. I was thinking of retrofitting it with a Mach 3 software ... not sure of the hardware I will need .. maybe Gecko drives or ???

I just attached a picture ... hard to tell .... maybe Miltronic Manufacturing on the controller.

I have a 3500 sq ft pad poured ... planning to build the work shop this summer. With luck this will be next winters project. It is sitting coated in oil in a garage.

Thanks .... Mike
 

Attachments

pmd34

Joined Feb 22, 2014
529
Hi Mike, for DC motor.. no actually the good old fashioned ones with brushes work fine, and they tend to be more reasonable current, cheaper and smaller. There are a few DC motor controller ICs (like the A4953) around that make controlling them simple and with a little gearing, you can actually get positioning as good as a stepper (with an encoder.)
The RC brushless motors, are kind-of stepper motors, but with very few steps, I think more like a 3 phase motor maybe(?)

Micro stepping is a way to position the stepper between 2 steps, but the motor coils have to be active to keep it in position, and this gobbles power (and heats things up a bit).
But for a compact clock face I guess a "pancake" silm stepper motor would certainly save you gearing it. You can even get 0.8 degrees steppers fairly easily so even harder to tell any errors.

For a milling machine.. I converted a manual one myself (I prefer to call it a Hybrid CAM system as I can still use it manually too.. and it sounds very sophisticated), you can buy stepper motor controller modules pretty cheaply (or make your own) based on the A4988 IC for example. But it gets more complicated going up above about 3A. I found that it can be a bit hard getting fast movement between locations when not cutting, as when you increase the speed you can start loosing steps. I do actually have a digital readout from optical scales on my mill, so i have thought about using those for feedback. (Also because is uses standard lead screws, I have had to calibrate the slack when changing direction which is a bit messy!)

I would see what the mill has already anyhow, and see if there is any slack in the feeds. A DC servo motor control would be nice, as you can move fast and also get an idea of the cutting resistance - how much current the motor is taking (not so with stepper motors). But its more of an art form to drive them I think.. acceleration and deceleration phases etc. But you should be an expert by then anyhow and in need of new challenges!!
 

MaxHeadRoom

Joined Jul 18, 2013
30,655
Many of that model were fitted with Anilam control, it does look like a Miltronic on there now.
If keeping the DC servo's maybe remove/check the brushes and blow them out, I converted a couple of XLO mills, but used Galil Motion based controller.
Max.
 

Thread Starter

xtal_01

Joined May 1, 2016
227
Very interesting!

I am sure when I start to covert this mill, I will have a bunch of question!

Thanks for the explanation!

For my clock project ... so you are suggesting a standard brushed DC motor with an encoder? If you let it run 24/7 (even thought there is literally no load), will the brushes not wear out just from mechanical pressure?

If I do used a brushed DC motor, would you use PWM? Gear the motor say 10 to 1 (or what ever since you would need a couple of revolutions just to start and stop it (unlike a step motor where you could do a few micro sets).

I do agree ... everything I read mentions how power hunger step motors are in this type of application.

Thanks so much again!

Mike
 

MaxHeadRoom

Joined Jul 18, 2013
30,655
The only problem with a DC motor and encoder for the clock is you need some form of PID/positioning control, you could gear a stepper motor as it does not require an encoder if the steps are known.
The old typical way of an analogue clock is a AC synchronous (clock) motor.
Of course a digital version would be way easier with an Arduino or micro.
Max.
 

Thread Starter

xtal_01

Joined May 1, 2016
227
Thanks again for all the info!

Think I will need to buy a bunch of parts and just start playing. As I said, I just want to learn more about the Arduino, how it works and how to use it.

One off topic question comes to mind ... wayyyyyy back when, I was told ac motor have slip so you only ge say 1740 rpm's (I've seen name plates with 1725, 1740, 1760 ...) .. not 1800. So do they gear the clock for 1800 or for 1740 ... or is there a way of a motor really turning 1800 (which makes sense at 60 Hz)?

Mike
 

MaxHeadRoom

Joined Jul 18, 2013
30,655
For a typical induction motor there has to be slip in order to run, hence you do not see 3600 or 1800 on 60Hz. (2pole/4pole etc).
The AC clock motors are constructed to be synchronous so there is no slip.
Max.
 

pmd34

Joined Feb 22, 2014
529
Very interesting!
For my clock project ... so you are suggesting a standard brushed DC motor with an encoder? If you let it run 24/7 (even thought there is literally no load), will the brushes not wear out just from mechanical pressure?
If I do used a brushed DC motor, would you use PWM? Gear the motor say 10 to 1 (or what ever since you would need a couple of revolutions just to start and stop it (unlike a step motor where you could do a few micro sets).
I do agree ... everything I read mentions how power hunger step motors are in this type of application.
Thanks so much again!
Mike
Good point you might need to look into a few numbers and see how many revs. a motor is good for, but I guess it should not be too bad as you will only by pulsing the motor every minute (I guess its not for the second hand?)

To give you a practical example, I use something like this:
https://www.ebay.co.uk/itm/DC24V-46...=362278635852836a8ac30c8b49bcb216499262d2adbf

Connected directly to a 360 pulse / turn rotary encoder (actually via a 1:1 gearing). Many motor controller ICs do automatic PWM current limiting, so I set it up so that the motor is just able to turn (minimum current @ slowest speed). The microcontroller then simply enables the motor until one or more pulses have been received and then stops (actually shorting out the motor to actively break it). There is actually no noticeable overshoot and I was surprised how accurately I could actually position the motor what with its inertia and all!

The stepper motor is still OK though, but no micro steps, you would simply enable the drive, make a whole number of steps, and then disable it, so relying on the magnets in the motor to hold it in place without power. If you micro stepped and disabled the power it would jump to the nearest whole step. So long as you don't over power the motor, then it should simply stay on track without any feedback.

So it would still be hard to choose between them! Encoders are not so cheap I guess... but it depends a bit on how much mechanical design effort and fabrication you want to invest in. You could even use a DC and a stepper motor, one for each hand, if that is the type of clock you are making! Then you get to see for yourself the pros and cons of each!
 

Thread Starter

xtal_01

Joined May 1, 2016
227
It is interesting you mention the inertia. I did some reading on converting this old CNC machine. Sooooo many things to look at like accelerating, maintaining and de-accelerating to stop it without overshooting.

I gather a lot of these functions are built into the drives.

I have a lot to learn!

Looks like that motor would be great. When I think about it, anything above 1 RPM would work. Trigger ... count the pulses for 1/60 of a turn ... off ...

I guess you could get fancy .... assuming the rate of the pulses are programmable ... start at 100% .. slow to 50% ... with one or two pluses to go slow to 10%.

Wow ... lots to think about!

I am just looking at Arduino start kits now. I don't know if one is better than another. Lots on the market to choose from!

Thanks again .... Mike
 

MaxHeadRoom

Joined Jul 18, 2013
30,655
It is interesting you mention the inertia. I did some reading on converting this old CNC machine. Sooooo many things to look at like accelerating, maintaining and de-accelerating to stop it without overshooting.

Mike
When sizing a motor for a particular CNC application there is a motor to load inertia rating that is observed and this ratio is usually kept at 10:1 or below.
There are some motor sizing programs out there such as free one from Kollmorgen etc.
If you already have the motor on the Mill then presumably they are sized right.
Max.
 
Top