Go Down

Topic: Just starting -feeling confident. a couple of questions (Read 1 time) previous topic - next topic

Botolph

I have a project so I went down to Maplin bought an UNO and a motorshield and some components including some LDR and some other bits. There's a huge amount of information here but it can be quite difficult identifying which bits are relevant. I hope I can get some help.

So the questions:

1. For this project the core is a state-machine for which I think the code will all be sequential but is there a time clock interrupt for implementing a time sliced process?

2. Can you suggest a motor or what do I need to consider. I need to be able to drive a motor to rotate in fixed 60 deg (or multiples thereof and forwards or backwards) but no more than 360 deg in one movement. A movement needs to be complete in about 0.1 second. The item it is driving is a hollow cylinder about 40mm in diameter and weighing about 120gm. I'm happy to pay for something reliable.

3. I bought the LDR because I need to identify whether there is a threshold of light in 4 places. My first thought is to link each one up to a digital input. But is there a better way of doing this? I did wonder if I could get the input as a bit set binary number.

PS The programming seems to be reasonably straightforward (at the moment). The electronics wil become a challenge.
PPS I wonder whether I should have split this up into seperate threads.




PaulS

Quote
1. For this project the core is a state-machine for which I think the code will all be sequential but is there a time clock interrupt for implementing a time sliced process?

Yes, no, and maybe. You'll need to provide more details on what you want to do.

Quote
2. Can you suggest a motor or what do I need to consider.

I'm partial to the Chevy 350. Of course, that might be just a little bigger, or smaller, than what you need. Hard to say, without knowing what the motor is for.

Quote
I need to be able to drive a motor to rotate in fixed 60 deg (or multiples thereof and forwards or backwards) but no more than 360 deg in one movement. A movement needs to be complete in about 0.1 second. The item it is driving is a hollow cylinder about 40mm in diameter and weighing about 120gm. I'm happy to pay for something reliable.

Oh, OK. This is better. Is "a movement" 60 degrees? How is the hollow cylinder supported? How is the motor going to actually move the cylinder?

Quote
3. I bought the LDR because I need to identify whether there is a threshold of light in 4 places. My first thought is to link each one up to a digital input. But is there a better way of doing this? I did wonder if I could get the input as a bit set binary number.

An LDR is not a digital device. You can set a bit if the value is over a threshold, or clear it if the value is under a threshold.

johnwasser

> 1. For this project the core is a state-machine for which I think the code will all be sequential
> but is there a time clock interrupt for implementing a time sliced process?

There are timers that can generate interrupts but there is no OS to provide pre-emptive multi-tasking.  In 99% of cases you don't need the overhead of a multi-tasking operating system to do anything you want.

> 2. Can you suggest a motor or what do I need to consider. I need to be able to drive a motor
> to rotate in fixed 60 deg (or multiples thereof and forwards or backwards) but no more
> than 360 deg in one movement. A movement needs to be complete in about 0.1 second.
> The item it is driving is a hollow cylinder about 40mm in diameter and weighing about 120gm.
> I'm happy to pay for something reliable.

To get that kind of speed (360 degrees in 0.1 seconds = 600 RPM) you would likely need a hefty DC motor with position feedback (rotary encoder).  A stepper motor is likely too slow and a servo motor generally only turns about 180 degrees total, let alone 360 at a time.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Botolph

Thanks for the fast replies.

1. For the motor. The whole assembly is something I hope to get built up in January. I can design in mounting for the motor in whatever way is appropriate eg

  • I had just assumed the obvious of a central axel and a motor attached in line with the axle. As this is simplar to make

  • It could be geared if this is useful

  • But as I am typing this it occurs that it could a gear around the circumference and a motor off to the side. Although I think this would be difficult to make.

 

2. Time slicing. I don't need it for this project. The sort of reason for thinking about it is: a process which is controlling motion and needing to check every 1/10 sec for inputs on any sensor.

PaulS

Quote
2. Time slicing. I don't need it for this project. The sort of reason for thinking about it is: a process which is controlling motion and needing to check every 1/10 sec for inputs on any sensor.

Turning a motor on is all that is needed to get it going. Turning it off after the proper duration does not require continuous monitoring. You can read sensor input, then see if it is time to turn the motor off. No "time slicing/multi-tasking" required.

Turning a motor exactly 60 degrees, at an average speed of 600 rpm is going to be a challenge, no matter what motor or drive arrangement you come up with.

Go Up