Jump to content

Banner.jpg.b89429c566825f6ab32bcafbada449c9.jpg

Arduino Focus control and Cloud sensor


ncjunk

Recommended Posts

Can you set board type default to 2 in the pde?

See code below for what it looks like. I dont think you have the option to change board type in the stand alone....cant remember.

That will then use the arduino motor shield compatible code instead of the easydriver.

Let me know if you have any questions or you already tried it!

Neil c

volatile byte MotorType = 0; // Motortypes, default is 0, Stepper motor, 1=Servo, 2=DC motor

volatile int BoardType = 0; // Boardtypes, default is 0, EasyDriver, 1=L293 chip, 2=LadyAda AFmotor board

boolean Direction = true;//True is one way false is other.Change to false if motor is moving in the wrong direction

boolean IsMoving = false;

Enviado desde mi GT-I9003 usando Tapatalk 2

Link to comment
Share on other sites

  • Replies 490
  • Created
  • Last Reply
Can you set motor type default to 2 in the pde?

See code below for what it looks like. I dont think you have the option to change motor type in the stand alone....cant remember.

That will then use the arduino motor shield compatible code instead of the easydriver.

Let me know if you have any questions or you already tried it!

Neil c

volatile byte MotorType = 0; // Motortypes, default is 0, Stepper motor, 1=Servo, 2=DC motor

volatile int BoardType = 0; // Boardtypes, default is 0, EasyDriver, 1=L293 chip, 2=LadyAda AFmotor board

boolean Direction = true;//True is one way false is other.Change to false if motor is moving in the wrong direction

boolean IsMoving = false;

Enviado desde mi GT-I9003 usando Tapatalk 2

BOARDTYPE not motortype

Sorry for the confusion i'm an idiot sometimes...i've correct the original post as well.

Enviado desde mi GT-I9003 usando Tapatalk 2

Link to comment
Share on other sites

Ahh ok...the board tyoe = 2 probably won´t work but using the example we can re-arrange the code slightly. Can you try cutting and pasting the expample code into a PDE and see if it runs for me (stepper works)?

Thanks

Neil C

Link to comment
Share on other sites

Not at the moment! No idea..(edit- there is a number of steps per revolution that may be incorrect and acount for the error...your motor has 200 steps per rev)

We have code to select a generic stepper but it doesnt have your bits initialised that you need. I'll cobble something together for you later....possibly a boardtype = 4 for your board and io config.

Wont be able to do it until around 11pm spanish though :)

Enviado desde mi GT-I9003 usando Tapatalk 2

Link to comment
Share on other sites

Hi Neil,

Just had another quick play with the example sketch and it's all working as expected, 360 degree turn works fine.

There's no rush for the code, please don't put yourself out :)

Do you know if the motor driver will do microstepping?

I think the Uno and arduino motor shield v3 would open this up to less technically minded people. The boards just stack and the shield has screw terminals for the motor and external power so minimal soldering needed for the finished focus controller.

I found this manual which may be of help too.

Thanks again for all your help, it's really appreciated.

Cheers,

Ian

Link to comment
Share on other sites

Ian,

Sorry for the delay...can you try the following code? I have rigged it to run off HalfStepper.H and in theory I think I have it set up correctly but you´ll have to try it and then shout at me when it doesn´t work!

I have forced the board type to "1" which uses the Halfstepper routine and then removed the code which changes the board type.

I have forced all your pins to the correct values.

Use the Arduino 1.0 software from the Arduino.cc site and install the attached libraries in the Arduino-Libraries directory.

Then run it and let me know what problems you get ;-D

Regards

Neil C

HalfStepper.zip

SGL_Focuser_Driver_nolcd_1_0_0_SF_TEST.zip

Link to comment
Share on other sites

I will have to re-write the code to configure the pins depending on the board selection as I have too many pin configurations flying around. I only noticed it when trying to alter the code for this.

I set the speed to 2 (halfstepper.setspeed(2) ) you might want to have a play with that setting.

Link to comment
Share on other sites

i don't think I can Reggie,

I think, need to review it, two of the systems use pin 13 but one as power and another as a dir or brake.

therefore it will be better to define generic names and define them at run time depending on board type.

hope your feeling ok at the moment Reggie!

Link to comment
Share on other sites

Hi Neil / Reggie,

I hope everything's okay Reggie :)

I tried the new sketch and libraries, all compiled and uploaded fine, the motor is energised, in so far as I can't move it. I now can't get the standalone app to connect. The arduino software was closed down before running the standalone and I definitely have the correct com port selected.

It did connect fine with the original sketch, and I'm sure I'm going through the right steps to test it. I press connect and nothing happens, I can't change any parameters at all - I assume form this it's not connecting properly?

All / any help really appreciated guys, I was thinking of posting to see if it would be easier to get a different motor driver, but you'd already replied when I looked today. The question still stands though, I'm not averse to throwing another £20/£30 at this to get it working quickly. I'm not sure what board to go for, the easydriver looks as if it's been discontinued, and the motor draws too much current for it anyway.

Thanks again,

Ian

Link to comment
Share on other sites

an easy driver board should cope with that stepper motor, slightly undercurrenting it won't hurt for what you're doing :) You'll be driving it differently anyway :) The easy driver is a chopper driver I believe, so it would actually run your 3.8v motor at 12v but as it's limiting the current it won't break anything.

Link to comment
Share on other sites

Hi Neil / Reggie,

I hope everything's okay Reggie :)

I tried the new sketch and libraries, all compiled and uploaded fine, the motor is energised, in so far as I can't move it. I now can't get the standalone app to connect. The arduino software was closed down before running the standalone and I definitely have the correct com port selected.

It did connect fine with the original sketch, and I'm sure I'm going through the right steps to test it. I press connect and nothing happens, I can't change any parameters at all - I assume form this it's not connecting properly?

All / any help really appreciated guys, I was thinking of posting to see if it would be easier to get a different motor driver, but you'd already replied when I looked today. The question still stands though, I'm not averse to throwing another £20/£30 at this to get it working quickly. I'm not sure what board to go for, the easydriver looks as if it's been discontinued, and the motor draws too much current for it anyway.

Thanks again,

Ian

If you dont mind a little delay I'd like to get this working.

The comms problem is an error on my part . the example motor code uses serial 9600 baud and i pasted that into my code where i have the software configured for 19200 so broke the connection.

Link to comment
Share on other sites

I am just doing another version of the standalone which enables you to change the comm baud rate to either 9600 or 19200. I´ll then send you two versions of the PDE code one working at 9600 and one at 19200. If you can check to see if either works that would be great.

Link to comment
Share on other sites

I´ve uploaded a version of the stand alone that allows you to select the baud rate. Could you try that with the PDE that I sent you last time (which is set to 9600).

Run the standalone select 9600 then the comm port and then connect and see if it connects?

http://f1.grp.yahoofs.com/v1/gMKaT2UacAiXc_qTmK6g2Z6hG8H9D-z0vNOtG2EoL2yxTdHDqjO7nRcRI9SBiFM5FyGFJZd_0xInhPLdx_s4Lw/SGL%20Software/Focuser/Beta%20Version/SGL_Focus_Standalone.zip

added pde with 19200 comms

Thanks

SGL_Focuser_Driver_nolcd_2_0_0_SF_TEST_19200.zip

Link to comment
Share on other sites

Hi Neil,

I've just tried it and by setting the correct baud rate it works :(

A few comments;

1) after an hour connected up the motor is quite warm, such that I can barely hold it. Is this just because it's permanently energised? Does it go to sleep after a defined period of inactivity, or can it be made to sleep? My focuser holds position just fine and I wouldn't want it pumping out that much heat while I'm imaging.

2) 200 steps = 1 full rotation so it appears that I'm not getting half stepping.

4) with the default speed of 500 it works when I first connect it up. If I try to change the speed it will then only work below 100.

Thanks again,

Ian

Link to comment
Share on other sites

Hi Neil,

I've just tried it and by setting the correct baud rate it works :p

A few comments;

1) after an hour connected up the motor is quite warm, such that I can barely hold it. Is this just because it's permanently energised? Does it go to sleep after a defined period of inactivity, or can it be made to sleep? My focuser holds position just fine and I wouldn't want it pumping out that much heat while I'm imaging.

2) 200 steps = 1 full rotation so it appears that I'm not getting half stepping.

4) with the default speed of 500 it works when I first connect it up. If I try to change the speed it will then only work below 100.

Thanks again,

Ian

:( Cool...so its working just have to tidy it up a bit.

1) With the Easy Driver an option was added to turn the power off after 20 secs of no movement, we´ll do something for yours as well. I don´t think the heat is too much of a problem but sounds like yours is hotter than mine. Have you tried adjusting the current and seeing where it starts stalling?

2) Ok I´ll have a look.

4:confused::D) ok, I´ll see what settings I´ve got. The Speed setting is for the Easy driver and is a delay timing so I need to integrate it into the code better for the new board.

Thanks for the update! I´ll try a power off bit of code for you next.

Link to comment
Share on other sites

I have integrated the code but I can´t really test all the board options so we´ll just see how yours works. I have to update the Ascom driver with a fourth option for your board at some point (I am pushing my luck today so no more coding as I want to watch the football at 12:30...fortunately the 3 year old has been happily watching postman pat for the past two hours!).

It should turn the power on when running and then turn it straight off again. I have configured your board type as 3 (under the functions void FocusINFun and void FocusOUTFun you can see Case 3 contains the code for your board)

Let me know if it works...the speed setting is now linked in the code and set to a default of 500.

Hope it works! :(

Try this:-

SGL_Focuser_Driver_nolcd_2_0_1.zip

Link to comment
Share on other sites

After many weeks of faffing about and mostly waiting for things to arrive by post, I finally have all my parts and I've assembled my focuser and made a bracket to attach it to my Moonlite. The motion transfer to the focuser is done by timing pulleys. It seems to work ok.

However, there is quite a lot of vibration when the motor turns. This seems to depend on the step size (full steps cause the most, 1/4 steps or smaller get progressively less vibration). I don't think this is an issue with the circuit or anything like that since the motor turns exactly as I command it and does the right thing. It's just that if I have the setup sat on my desk, the thing creates such a vibration noise that I wonder if this is usual.

I am using my own Arduino sketch to run this, not the SGL shared one in case it matters.

Can anyone confirm whether their motor also makes a lot of vibration/noise or whether this might indicate some problem? Would a youtube video of the issue help?

David

Link to comment
Share on other sites

have you tried running at faster speeds? if the delay is too long between steps it may cause some jerkiness at full step. obviously 1/4 or 1/8 stepping will be smoother even if you have the delay too long as its performing intermediate steps which will smooth the movement.

if you have the delay too short it will cause other problems but i'd have a play with that first.

mine is direct coupled and quite smooth whilst running but it jerks a little when it stops as it stops suddenly.

it makes a fair bit of noise (200 step non geared motor). the geared stepper i have is much smoother and a lot less noisy.

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.