Jump to content

Banner.jpg.b83b14cd4142fe10848741bb2a14c66b.jpg

Arduino Focus control and Cloud sensor


ncjunk

Recommended Posts

Yay, well my Arduino and stepper motor driver board + motor arrive today.

I've wired them together in a breadboard for testing and run a quick test sketch. With this I've managed to get the motor rotating CW and CCW and I can also vary the number of micro step divisions the driver board will produce. It seems like a pretty cool bit of kit.

Now I've proven that everything works, I'll have a look at the focuser code that is kicking about in this project and see if I can get that to do sensible things.

I've been thinking a bit about the mechanics also. I figure I'll have to connect the motor to the 10x speed reducer side of my Moonlite. That should effectively give my 200 step motor a 10:1 gearing, making it equivalent to a 2000 step system.

I've been a bit worried about backlash in the coupling, so I was thinking either of a direct coupling to the focuser shaft (which will be difficult mechanically to hold the motor in place), or a friction coupling of some sort where I put a larger diameter wheel in place of the focuser knob and a smaller diameter wheel on the motor and a rubber O-ring around one of the wheels to produce the friction.

I think the friction approach should produce pretty well zero backlash, but I'm not sure if there will be enough traction such that there won't be slippage if the draw tube is loaded with gear.

Anyway...these are all things to be tried out. Has anyone tried a friction coupling already?

David

Link to comment
Share on other sites

  • Replies 490
  • Created
  • Last Reply

Dave,

Let me know how the testing goes and if you have any issues with the software.

Oh and the friction coupling as well, it's always good to get some info on other methods of connection and how they work. My universal coupling works great as it copes with my rubbish mounting bracket which isn't alligned correctly.

Regards

Link to comment
Share on other sites

  • 2 weeks later...

Hi, hopefully someone can give me some ideas as to what might be going wrong with my focuser stepper motor testing.

I've got everything hooked up (arduino, driver board, stepper motor) and I've got a quick test program that I can use to make the motor move a certain number of steps.

Today I decided that I'd test whether telling it to move 200 steps would in fact produce a 360 degree rotation. I'm glad I did, because this doesn't work reliably although the motor is specced as 200 steps per revolution.

What seems to happen is that 200 steps will make it rotate more than 360 degrees - more like 400 degrees.

If I tell it to move say 175 steps, it gets close to a 360 degree rotation, but seems to randomly overshoot or undershoot the mark slightly.

If I change the sketch so that the time delay between pulses to the stepper driver board is longer or shorter, this has an effect on how many steps it will take to rotate fully. For example, if I shorten the delay between step pulses, then 200 steps will cause a rotation of less than 360 degrees.

I notice that the firmware on the yahoo site uses 500 microseconds between pulses (between falling and rising edge of pulse). I tried that with my driver board and it seems that this is too fast and the motor doesn't move. I am currently doing HIGH, 2000us delay, LOW, 5000us delay, to send the pulses to the driver board.

I can't understand why the motor is so inaccurate. I would have thought that 200 steps should have been close to the mark for a full rotation. And also, why on earth it doesn't seem to behave in a repeatable manner (sometimes overshooting, sometimes undershooting).

My guess is that the pulses are being missed by the driver board or something like that. This makes me think slowing things down ought to produce more predictable behaviour. But even when I did this, 200 steps still doesn't produce an accurate 360 degree rotation. I am not sure if it repeatedly did the same thing though. Slowing things down doesn't seem very reasonable though - I mean I was doing maybe 4 steps per second which is pretty slow.

Does anyone have any ideas what could be happening here?

I'm using the Mercury Motor 42BYG011-25 from cool components in the UK and also their stepper motor driver board with A4983 driver chip.

David

Link to comment
Share on other sites

UPDATE: I took apart the motor to see what happens inside and the shaft is attached to a green wheel with cog teeth (50 of them). Since there is a 4 phase system for driving the coils, this translates to the 200 steps per revolution.

I marked the green wheel and verified that 200 steps does result in a 360 degree rotation. This seems to work and is repeatable.

I then put my wooden wheel back on the motor shaft and tried 200 steps and found that the cog wheel in the motor went round 360 degrees but the wooden wheel on the motor shaft appeared to rotate slightly more than 360 degrees, which is highly odd.

Scratching my head, I replaced the wooden wheel with a bit of masking tape stuck like a flag on the motor shaft and repeated the 200 step test. This time both motor cog and tape flag rotated exactly 360 degrees (and did so repeatably).

So, I'm thinking that the wooden wheel I was using on the motor shaft must somehow be rotating with its own inertia or something. I.e. there is slippage going on between wood and shaft despite the wooden wheel having what seems like a fairly tight fit. The "jolt" of the motor each time it does a step must be causing some amount of slippage each time resulting in the random behaviour I was seeing.

This is a bit odd, but I seem to have gotten to the bottom of it. And at the same time ruled out the use of my wooden wheels as friction drive components since I don't think I can reliably get them to attach to the motor without slippage. I'll have to use something metal with a set screw to hold things in place.

I think I will look into timing belts and pulleys next. Although this will result in some degree of backlash, I think that focusing software will be able to handle this by only doing the focusing operation in one direction of travel (like FocusMax does).

David

Link to comment
Share on other sites

David,

only just saw your message. You are correct about the speed in that you have to adjust it. The 500 ms?? , I forget the exact value, is an initial value but due to the microstepping it can be too fast and cause the motor to stall as there is not enough torque. I assume that increasing the time it stays on each step allows the full current to be applied and the motor to move correctly.

One of the more difficult things in this project is getting the mechanical linkage right. There are many ways of doing it but, for instance, on my system I used a universal coupler but didn´t have the crayford shaft screwed down tight enough so got slippage. Also if you are using the Easydriver it is good to adjust the current, play around with the Pot on the board to decrease the current until it stalls then increase it back up.

I would have thought that wooden wheels would cause too many problems.

Regards

Neil C

Link to comment
Share on other sites

I've been following this thread with interest for ages now and it seems like time I built myself a stepper controlled focuser.

I've read a lot on here and the Yahoo group. I'd like to check that I've got my kit list correct for my application, or suggestions for other kit, and whether I can get the bits more cheaply elsewhere.

I'll be using it on an f/4.8 10" newt with a CR2 Moonlite, I guess I'd have to gear it to get the required resolution. I was thinking of a toothed belt system - any good resources for this kit?

Arduino Uno R3

Arduino Motor Shield

Stepper motor

Cheers,

Ian

Link to comment
Share on other sites

Starflyer, I'm building a focuser too for a moonlite CR2 on an MN190.

I think the motor you've chosen might not have enough torque. It's only a 3V motor and the torque is a quarter of the motor I'm using. My feelings on my own motor are that it might be touch and go with the torque. I've not hooked it up to the scope yet but I can tell from the way it feels that it might only just be ok. Ncjunk has also reported some issues with my motor although I think he overcame them. However he went for a more powerful motor for a subsequent focuser I believe.

The one I'm using is the stepper motor that coolcomponents.co.uk sell. It's about 10 quid and runs off 12V. I'm not sure what others have gone for exactly.

How do you plan to attach to your Moonlite? I am planning to use the tension screws by replacing them with longer bolts and a nut midway up the bolt to hold the motor bracket to the focuser. Then I'm thinking of using timing pulleys and a belt in a 2:1 ratio onto the slow motion side of the Moonlite. This should give me enough gearing, approx 20:1 from a 200 step motor driven with up to 16 microsteps.

David

Sent from my iPad using Tapatalk

Link to comment
Share on other sites

Hi,

I'm not too sure about the motor selection either. I picked a 12v one with more torque than you have. 12v to make it easier to power it as i have 3 12v power supplies for the mount etc

It uses up to 650mA as well which is within the easydriver maximum supply current.

On the c11 i have a geared stepper that is directly coupled to the focuser but i would suggest for direct coupling you need a geared stepper.

Enviado desde mi GT-I9003 usando Tapatalk

Link to comment
Share on other sites

Thanks for the replies, I'd rather buy the right kit to begin with so your input is really appreciated, I'll have another look around for a more suitable motor.

As far as coupling goes I was thinking of using a timing belt with the focuser pulley attached to a machined aluminium adapter. The adapter would slide over the 10:1 knob and grip it with 2 or 3 tiny grub screws, this would make for easy removal if needed. I'm not sure of the ratio to use and don't really understand the maths to work it out to get the required resolution - more reading needed I think :D

I already have a 'spare' hole in the tube from an old finder and I'm happy to drill another to take the motor mount. It took me a while to get the tension screws set up correctly to hold the weight of the camera and give me a smooth focus - I'd rather not use them to hold the motor mount :headbang: I guess it's different for you David, with a newer scope and the added complication of a corrector plate to remove before drilling holes I think I'd look for alternative mounting methods too.

Thanks again,

Ian

Link to comment
Share on other sites

The maths isnt too hard if you know the critical focus zone size for your scope and this can be computed by online tools. For me it's around 75 microns.

But basically I thought about it like this. The focuser shaft is 3/16ths of an inch in diameter (I think). As it rotates it directly moves the drawtube. So how far does the drawtube move with one rotation of the shaft? It will move a distance equal to the circumference of the focuser shaft. We can calculate this as PI x 3/16th = 0.589 inches or 14.96 millimetres.

So every time we rotate once, we move nearly 15mm. With the 10:1 reduction knob, one rotation will move the drawtube 1.5mm, or 1500 microns. So the critical focus zone of 75 microns represents 0.05 of a rotation, or 18 degrees of rotation.

Therefore if we can get a stepper that provides a decent number of steps, say 1.8 degree full steps, and even finer with microstepping enabled, we should be able to sample the critical focus zone pretty well. So a direct coupling should be ok, or pulley wheels in 1:1 ratio. More gearing doesnt hurt, but will just mean it is slower to move the drawtube any appreciable distance.

Hope this helps!

David

Sent from my iPad using Tapatalk

Link to comment
Share on other sites

Thanks David.

So the CFZ for my f/4.8 newt is ~50 microns

I've just roughly measured my CR2 and it gives 15.0mm for one rotation. I thought the reduction on the Moonlite CR2 was 10:1 but I've just checked and it's 8:1, so 1 rotation = 1.875mm drawtube travel.

50 microns = 9.6 degrees of rotation, or about 5 x 1.8 degree steps. I'm guessing this isn't enough resolution so I'd need to use microstepping and / or gearing? Can you clarify how many steps I should be looking for to take me through the CFZ?

I'm not having much luck finding a motor, anyone have any suggestions?

Thanks again,

Ian

Link to comment
Share on other sites

Ian,

I don't think you'll get issues with the same motor I have.

http://www.coolcomponents.co.uk

Have a search on there for their stepper motor. They only sell one. It has 4 times the torque of the one you were looking at. It uses 12V but only 0.33A per coil. It cost just under £10.

I also bought the stepper motor driver from the same site. It should be compatible with the easy driver that the focusing project uses, but it needs some wiring or software tweaks to set the microstepping. I can help you with that if you decide to get that driver board.

Also, good to know about the 8:1 reduction on the CR2. I was going to get a 2:1 timing pulley set, but I hought it was 10:1 so my calcs would have been out.

On the number of steps you need to sample the CFZ, I am not really sure. Is it sufficiently focused when you're anywhere in the zone, or are some spots in the zone better than others? Given I don't know the answer there, I am thinking to have around 20 steps through the zone. I reckon that will give good enough precision.

In your case, I'd say the 5 full steps through the zone is ok. With 4x microstepping or better, you'll get 20 steps. If you go for the driver board from cool components, it does up to 16 microsteps and you can set the microstep ratio in software if you wire the driver board right. If it were me I'd not worry about extra gearing.

David

Sent from my iPad using Tapatalk

Link to comment
Share on other sites

Many thanks David, great information. Is this the motor driver that you bought?

Is there anything else I should get at the same time, either essential or helpful? When I've tinkered before I've just wrapped or soldered wires for prototyping, would a breadboard help with setting up and testing or is it straight forward enough to make the complete circuit up and test it on the bench?

Sorry for all the questions, I'd rather get this right so I have a chance to try using it this season :)

I suppose I should physically check the CR2 reduction, mine's a couple of years old and I was fairly sure it was 10:1 until I looked at the Moonlite site.

Cheers,

Ian

Link to comment
Share on other sites

Ian,

I got this driver board. I haven't used the easy driver more commonly used in this project, but I believe this board can be wired up in a pin compatible way. Also, I like the fact it can be programmed easily to change the number of micro steps it will do from 1, 2, 4, 8, or 16. Combining this with the ability to change the inter-step timing (and hence speed of rotation) makes for a pretty flexible setup. I also didn't like the fact that the easy driver board will apparently blow up if you disconnect the motor while it is powered up. Maybe all driver boards are prone to that, but I didn't see any such warnings with this board, although I am cautious not to do that just in case.

I also got an Arduino Nano instead of the full blown Arduinos. Thinking practically, I have to fit the Arduino and the driver board onto a PCB and mount that (probably in a small project box) on the bracket I am making to hold the motor. So I went for a small footprint Arduino that seems to pack a lot of punch.

I have thing set up on a breadboard and all the connections done with a pack of jump wires. These two things have been immensely useful purchases whenever I have done any tinkering with electronics. I build the circuits up and test them on the breadboard, and when I'm satisfied and don't need to change it anymore, I'll migrate the design to a suitably sized piece of Stripboard (basically like a breadboard only you solder stuff onto it and cut the copper tracks where you don't want connectivity).

I haven't got to the point of doing the strip board design for my focuser yet as I'm still tinkering with the circuit and firmware. I may add a relay to allow software control of the power to the motor, for example. I've been quite busy at work the past few weeks and not had access to my scope either, so hardly made any progress with things of late.

Hope this helps!

David

Link to comment
Share on other sites

The board looks good and has the same functionality as the A3967 chip on the easydriver. I wonder if this can cope with motors being disconnected as I assume that it is the connecting and disconnection of the coil that induces a high voltage spike...don´t know what circuitry is in there for the supression of that (All I can remember from Uni is the diode across a relay coil to surpress it).

Looking on the website link you gave this would be an ok motor to use:-

Stepper Motor with Cable from Cool Components

Just set up the max supply current on whatever board you use to the 0.33A limit of the motor.

In the Arduino code on the SGL automation group we do now use the power off signal to the easydriver board to remove the power to the motor if it is not used for 20 seconds. That could help to prevent accidental damage of the motor. It depends it the mechanical properties of your system will hold focus without using the motor holding torque.

As for the Arduino size I went for a Mega as I have put it in a largeish box underneath the mount as I using it for other control. I may mount my easy driver on the telescope or just leave it as it is with a cable running the motor connections back to the easydriver, which is in the large box.

Link to comment
Share on other sites

Thanks Guys, I ordered the motor and all the electronic bits this morning. When I've got them in front of me I'm afraid there's bound to be another bout of questions :)

I've left the hardware for the time being, I'd like to work out the best size enclosure by looking at the bits and bobs together and then sort out the mounting and coupling.

Thanks again, your help is muchly appreciated,

Ian

Link to comment
Share on other sites

Keep us updated and let us know of any problems or advice for others. The more information we have on different setups/ideas the better.

I am now going to build a Power distribution and cable box so will mount the Arduino and all my usb hubs in that.

Link to comment
Share on other sites

Can anyone advise me on timing pulleys and belts?

My Moonlite has a 3.175mm shaft that is 12mm long once I remove the slow motion knob. My motor has a 5mm shaft that is 18mm long.

My intention is to order some timing pulleys and belts from hpcgears.co.uk and get them to sort out the exact bore diameters for me.

The dilemma I am having is deciding on exactly which pulleys to go for. I want a 1:2 or 1:3 (preferred) ratio. However, since my motor has a relatively thick shaft, yet needs the small pulley, I don't think I can physically get a pulley with less than 15 teeth. I am aiming for MXL pitch by the way.

They don't seem to make pulleys with 45 teeth that I can find, but they do have 40 or 48-teeth versions. These wouldn't give me an evenly divisible ratio which means N rotations of the motor won't give me exactly 1 rotation of the focuser shaft. For some reason this bothers me, but I'm trying to work out if this does not actually matter.

I think I've convinced myself that it doesn't matter at all, since the focuser shaft will move a certain amount with every rotation of the motor shaft no matter what gearing I have, integer divisible or not. It doesn't matter how much the focuser shaft rotates for each revolution of the motor.

Am I right in my thinking, or can anyone see a problem with getting say a 15:40 tooth pulley set?

What about my other parameters? Is MXL a good pitch to use for this application, or would T2.5 or something else be better?

What have others who have used timing pulleys purchased, and from where?

David

Link to comment
Share on other sites

Sorry I can't help as I have a hate hate relationship with pullies.

So i've used direct coupling and a gear.

Matching the number of turns to whole numbers won't matter but the resolution provided by each step will (i never calculated mine and just went for the suck it and see method)

Have a look on the sgl automation yahoo group (see my signature) and ask there as well as there are a few other people who use that site that might be able to help.

Enviado desde mi GT-I9003 usando Tapatalk

Link to comment
Share on other sites

  • 4 weeks later...

Hi all,

Circumstances have meant that I'm only just getting around to putting this together. I had a go today and have hit my first snag... I'll explain what I've got and how it's set up first;

Arduino Uno R3

Arduino Motor Shield R3

12V, 1.8 degree stepper

Arduino 1.0 software

The motor shield is plugged into the Uno, I've got 12v from a small lead acid battery going into the shield and the two pairs of motor wires attached - see images below. I've double-checked the motor wires with a meter and I'm convinced they're in pairs.

I've got all the software installed and everything is working on that side of things, I can compile and upload the sketch but it doesn't seem to be working.

When I run the SGL standalone focuser app, connect and and set the step rate as suggested in the getting started guide nothing seems to happen. The stepper is definitely energised when I push in or out and makes a very high pitch whine if I gently try to rotate the shaft. The motor LEDs on the motor shield only light for channel A.

Any ideas what's wrong?

Can I just plug the motor shield into the top of the Uno, or do some pins need to be removed or disabled in software?

Do I need to make some changes to the sketch with the shield using the L298P controller, different pins etc?

post-13749-133877763301_thumb.jpg

post-13749-133877763316_thumb.jpg

Link to comment
Share on other sites

I'm certain I've identified the motor wire pairs correctly, 43ohms between the wires of a pair and open between the pairs.

I'm good at following basic wiring diagrams and instructions but useless at reading schematics etc and I just don't know how to figure this out, or where to look for the pin mappings :confused:

I'm in need of some noob type advice please :)

Cheers,

Ian

Link to comment
Share on other sites

I'm certain I've identified the motor wire pairs correctly, 43ohms between the wires of a pair and open between the pairs.

I'm good at following basic wiring diagrams and instructions but useless at reading schematics etc and I just don't know how to figure this out, or where to look for the pin mappings :confused:

I'm in need of some noob type advice please :)

Cheers,

Ian

As long as you havent screwed onto the insulation when you inserted the motor wires it sounds like that side of it is ok (43ohms sounds ok).

Can you move the stepper when it is energised? I cant on either of mine so that may indicate a power/wiring fault.

Enviado desde mi GT-I9003 usando Tapatalk 2

Link to comment
Share on other sites

Just reading through the motor shield now...its slightly different to the easy driver so i'll let you know once i've figured out if we need to change something in the code.

Give me half an hour..:)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.