Hello to anyone reading this that may be able to help me.
For my year 12 research project i decided that I would research the most effective method to build a low budget portable observatory.
The final decision i came to was to have two low speed 12v motors with worm gear gear boxes to stop the telescope falling.
I have tested the whole system by directly connecting the motor to a battery so can confirm that it does work and doesn't draw anywhere near the maximum amps my system can handle.
Now I'm stuck on how to program the arduino I'm using to control it.
What im hoping is that one of you amazing people could please write me some code for an arduino duemilanove (ATmega328) in conjunction with a USB host shield expansion board and an L293D H-Bridge Motor Drive Shield.
What I'm trying to have is a set up so when a Logitech extreme 3D Pro joystick is connected to the USB host shield, the x and y axis control of the joystick control the two motors (direction and speed) and the trigger button on the joystick sets one of the motor outputs of the h-bridge to a constant value (will be used for a laser to aim the telescope)
I've been playing around trying to modify example code but am really having no luck. (the example code works i just have no idea what im doing...)
if anyone could please help me it would be so greatly appreciated!
I've been a telescope maker for nearly fifty years now. I must disagree most politely with MorganS, telescopes need not track the stars. The vast majority of telescopes, specifically dual telescope (binoculars) are used on Earth bound objects. I wouldn't fail you if the instrument wasn't capable of sidereal tracking.
My current project uses an Uno, an encoder board (shield) and a driver board (shield) to track and drive the motors. The code is simple enough. I read the analog inputs tied to a quadrant detector and activate the motors till the bright spot is centered.
I would frame your code similarly. Use a simple voltage divider with the joysticks and read the voltage. Readings below the center or above the center value would in a "while" statement activate the motors accordingly. I have 20msec time outs in the "while" conditions so I don't get stuck in them. When I drop out of the "while" as a result of timing out I know I'll be back around in short order to stop the motors if it's time. Immediately after I drop out of the "while" statement I check for the reason before I move on.
Here's a "while" from the "goto" function portion of the code
The difficult part of the control electrons was getting the encoder board and driver board not to conflict with one another. I had to give up both servos and one motor as well as cut pins and rewire the driver control lines. Corresponding changes in the code were made to accommodate the control line changes.
The encoder board came from Robogaia and the driver board is a generic off eBay.
I'm new to this forum so I want to emphases my disagreement with MorganS is meant to be taken in the friendliest possible way.
MorganS:
We won't do your homework for you. We do like helping you learn and we do like feedback to know if our suggestions worked.
You're putting motors on a telescope and you're not making it track the siderial motion? I would fail your project right there.
Start with the basic analog-in-analog-out example that comes with the Arduino software. Get one joystick axis working with one motor.
im not asking for anyone to do my homework for me... im asking for code which i could use in my homework...
i decided that i wouldnt have the telescope auto track the stars, this was a personal choice and i really dont get why you think that i should be failed for that...
i asked my teacher for advice the other day becuase i cant work out how to write the code, her response was to either find someone who can write code, post on a forum to find someone who can or just say that i found some on some website when i atually didnt...
so no, im not asking anyone to do my homework for me...
Steppers are extremely inefficient.
If you wish to save power by turning off the stepper between steps, then holding is a big problem.
The solution is a worm gear drive.
jremington:
Steppers are extremely inefficient.
If you wish to save power by turning off the stepper between steps, then holding is a big problem.
The solution is a worm gear drive.
..and that would be a worm gear drive with what kind of motor?