go away spammer

Author Topic: Robotic Arm Control  (Read 7551 times)

0 Members and 1 Guest are viewing this topic.

Offline VenulollaTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Robotic Arm Control
« on: December 05, 2011, 06:34:36 AM »
I've decided to Control a Robotic Arm using Stepper motors as my Project in Electrical Engg. and I'm thinking to control these stepper motors using the Parallel Port of PC through MATLAB.

I'm impressed with this SOR site this is helping me a lot :)

I'm now thinking to do a 3 DOF arm.
i got the idea about how to control the stepper motor using Parallel port o/p from MATLAB...

Can the o/p from the parallel port be used to control one motor at a time?? and then the next motor....can i use MUX or something there?
I need help here at this point  :(

Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: Robotic Arm Control
« Reply #1 on: December 05, 2011, 06:51:53 AM »
Hi,

You normally have stepper motor driver between a stepper and PC, having said that, You will not be able to drive stepper directly from any port of PC. When You get stepper driver, make sure it can support 3 motors - and there You have it  ;)

EDIT: Something like 4 Axis CNC Stepper Motor Driver Board Controller TB6560 should do  :)
« Last Edit: December 05, 2011, 06:56:33 AM by newInRobotics »
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline VenulollaTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: Robotic Arm Control
« Reply #2 on: December 20, 2011, 09:27:48 AM »
thank you  :)

i've gone through that....for my project i need to make that circuit(they wont accept it if I buy it  ??? )...i've to control two stepper motors
(one at the base of arm & other at joint)

For the End Effector i'm using a solenoid which can attract some ball bearings provided....

i've seen some circuits and thinking to use L293....but with that i can control one stepper motor wat about the second one??  :(

The IC ULN2003 cant be to used to rotate the motor in both directions? is that true??


Offline absentwizard

  • Jr. Member
  • **
  • Posts: 12
  • Helpful? 0
Re: Robotic Arm Control
« Reply #3 on: December 20, 2011, 01:38:18 PM »
Get two L293s. Get input for them from a shift register. Serial input to the shift register (RS232 level shifter to drive SPI from computer serial port).

However, I think it'll still be more reliable to get a little MCU to handle that for you instead of trying to run it from a computer directly.

Offline VenulollaTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: Robotic Arm Control
« Reply #4 on: December 21, 2011, 11:11:47 AM »
thanks for the advice :)

i've to use parallel port only!  :-\
ya i got that circuit using two L293s..
the i/p for those L293s, i'll be giving them through MATLAB or a C program.

but to interface them to parallel port i'm getting confused  :(


Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Robotic Arm Control
« Reply #5 on: December 22, 2011, 02:56:03 AM »
Hi,

You might wanna take a look at the combo of L297 and L298.
You'd need two sets and they can be driven from your parallel port very easily.

These lines to the PC can be paralleled:
CW/CCW (direction: Clockwise if "1", Counter-Clockwise if "0")
/Clock (Advances one step [or half step] on low pulses)
Half/Full step (Half step if "1", Full step if "0")
/Reset (Reset on low pulse)

And then you define which of the two motors you're commanding by bringing its "Enable" high.

This would take 6 lines (5 if you make one "Enable" the complement of the other).


Or... You could drive both concurrently, which will be a better solution, rather than having to fiddle with switching back and forth between the two.

You could still parallel the Clock and the Half/Full step (or just hard-wire it to full step mode).
You could probably leave the Reset inputs tied "high" if needs be and if you keep both motors Enable high, all you need is clock and direction for each, so it could be driven from down to 4 lines.


Depending on the parallel port (whether it's SPP, EPP, ECP or whatever) you'll have a number of outputs and inputs to use. Even with the oldest (SPP), you have 12 outputs (and 5 inputs of which one is inverted, pin 11 to be exact), so you can either make it simple or more complicated - plenty of I/O for using two L297/L298 pairs any way you like - driven directly from the parallel port.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline VenulollaTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: Robotic Arm Control
« Reply #6 on: December 25, 2011, 07:17:11 PM »
thats cool !!
thanks a lot  :)  :)

I saw that combination...the pins CONTROL, SYNC, HOME  ???
Where should I connect them?  :-\ ground??

I found another circuit while browsing....with a pair of L297s connected to Parallel port and to two motors. does it do the same thing as u said?
http://farm2.static.flickr.com/1401/863692370_6bbae1f58c.jpg

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Robotic Arm Control
« Reply #7 on: December 26, 2011, 09:51:52 AM »
Hi,

I saw that combination...the pins CONTROL, SYNC, HOME  ???
Where should I connect them?  :-\ ground??
Control: If you use the L298 as well, it can be either "0" or "1". If "0" (i.e. connected to ground), the current chopper modulates the INH1/2 lines and if "1" (i.e. connected to +5V), the current chopper works on lines A..D - Either will work.

Sync: Is only used if you want to synchronize the current choppers of more than one L297, in which case you only connect the resistor and capacitor (pin 16) for the chopper oscillator on one L297, all Sync inputs are connected together and is thus driven from the one with the RC on pin 16.
If you use separate (which I'd recommend), you just leave this line unconnected.

Home: Just leave it unconnected. It's an open collector output that pulls low when the step sequence is at the "home" position (ABCD = 0101). It's not necessary to know the "home" position in your application.


I found another circuit while browsing....with a pair of L297s connected to Parallel port and to two motors. does it do the same thing as u said?
http://farm2.static.flickr.com/1401/863692370_6bbae1f58c.jpg
No, they're L298's :)
It is simpler, by not using the L297's, but it's made by a person who don't understand the chip very well, as there's no reason to use sense resistors when you don't control the current. This is exactly why you should use the L297, as it introduces a current chopper which makes sure your motors doesn't get too much current going slow.
If you wanna skip the L297, you should use some circuitry to take advantage of the sense resistors and then let the microcontroller do the chopping - by using the L297, your life (or at least your programming) gets a little easier.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline VenulollaTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: Robotic Arm Control
« Reply #8 on: January 03, 2012, 10:03:21 AM »
HAPPY NEW YEAR  :D

oh :) that's great :) thank you !

I've attached a circuit along with this post.
That is the combination (of L297 and L298) you've told me right?
The circuit consists of CW/CWW, CLOCK, HALF/FULL, RESET, ENABLE total 5 pins.

As you said I'll be using two sets of these so
1. RESET, ENABLE (which will be high as I'm using both motors concurrently)
2. CW,CCW
3. CLOCK
4. HALF/FULL STEP

The Parallel port pins (I'm using DB-25) which has 8 data pins. As there are two sets 4 from each, so I'll be using total 8 pins. :) is that correct?



Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Robotic Arm Control
« Reply #9 on: January 04, 2012, 03:55:43 AM »
Hi,

HAPPY NEW YEAR  :D
Right back at you :)


As you said I'll be using two sets of these so
1. RESET, ENABLE (which will be high as I'm using both motors concurrently)
2. CW,CCW
3. CLOCK
4. HALF/FULL STEP

The Parallel port pins (I'm using DB-25) which has 8 data pins. As there are two sets 4 from each, so I'll be using total 8 pins. :) is that correct?
If you don't plan on using the Reset and wants to Enable the drivers all the time, there's no need to drive those lines from the PC - just strap them to logic "1" (+5V) on the PCB.

If you plan on using either half or full steps you can strap Half/Full Step high or low as well, I think you'd want to use only one of the modes.
Half steps are half the size of full steps, but with less torque.

Connecting just the Clock and direction (CW/CCW) and strapping the rest of the inputs to the appropriate logic levels, should be fine for most applications.
That would take a total of a nibble (4 bits), or half the pins of the data port.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline VenulollaTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: Robotic Arm Control
« Reply #10 on: January 11, 2012, 07:15:48 PM »
Ok. :)
that's great.

I've simulated the same in PROTEUS software and got the results :)
I'll parallel the clock and thinking to use Full step as it needs High torque, it should move the arm, gripper and load.

Now should buy the components and should start the work.   :)

Which material should i use for the Arm weight to be as minimum as possible?
I'm thinking to go for Aluminum sheets as i can cut it for the length i need. Some other are available but they're of fixed length.


Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: Robotic Arm Control
« Reply #11 on: January 12, 2012, 02:07:30 AM »
If You want to be hardcore - go for carbon fiber  ;D

Nah, just kidding, aluminium will do nice  ;)
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Robotic Arm Control
« Reply #12 on: January 12, 2012, 09:35:52 AM »
Hi,

No need to be kidding when mentioning carbon fiber. That was my initial thought as well, when I read the question.
3 round carbon fiber tubes in parallel in a triangular pattern and with rods of a smaller dimension (say 4..5mm rods for 8..10mm tubes, scale up/down as needed) in between making small triangles - Well, sort of like this...

Just bonded with epoxy or similar, rather than bolted together.

Carbon fiber rods and tubes aren't that expensive, considering that the arm will probably not be very large.

Prepare/clean/degrease the bonding surfaces thoroughly to get maximum strength.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline metalworkertom

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
Re: Robotic Arm Control
« Reply #13 on: January 12, 2012, 10:38:52 AM »
If it were me and I decided to use alum. I would use a preformed "C" channel beam  VS. sheet as this will give you strenth with out having to do any joining of alum. This would also make attatchment of componants easier. also the channel works nicly for tucking things into.

Offline VenulollaTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: Robotic Arm Control
« Reply #14 on: January 18, 2012, 10:39:44 AM »
That's great thanks a lot :)

The L297 and L298 combination has a CLOCK pin.
Clock is nothing but a series of Square wave right? Can i use a Square wave generator wit 555 Timer circuit there??

The output from that circuit will be given to Clock pin. Can it be used like that?
« Last Edit: January 27, 2012, 04:58:26 AM by Venulolla »

Offline VenulollaTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: Robotic Arm Control
« Reply #15 on: January 31, 2012, 02:51:54 AM »
That's great thanks a lot  :)

Right now i'm able to send data from my MATLAB program to Parallel Port.
I've tested it using LEDs and its working  :D

1) The L297 and L298 combination has a CLOCK pin.
Clock is nothing but a series of Square wave right? Can i use a Square wave generator wit 555 Timer circuit there??

The output from that circuit will be given to Clock pin. Can it be used like that?

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Robotic Arm Control
« Reply #16 on: January 31, 2012, 10:27:32 AM »
Hi,

1) The L297 and L298 combination has a CLOCK pin.
Clock is nothing but a series of Square wave right? Can i use a Square wave generator wit 555 Timer circuit there??

The output from that circuit will be given to Clock pin. Can it be used like that?
Why not generate the clock on the parallel port?
No need for bringing in external circuits.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline VenulollaTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: Robotic Arm Control
« Reply #17 on: January 31, 2012, 07:27:17 PM »
Yeah.  :)
That means giving alternate '1' and '0' when i want to rotate the motor...right??  :)
Then i should put it in a loop of alternate (1 and 0) when i want to operate my motor. Is that correct? But what about the delay?
A general CLOCK has a duty cycle. so how much delay i should provide for that? :(

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Right now I'm using 6 pins from Parallel port for motors and another pin (7th) for an optocoupler for the solenoid at other end of it.

I'm giving the data 1 from parallel port at one end of optocoupler and the other I'll connect a solenoid with a (230-18V) Transformer supply. If i connect it like this does the optocoupler work or burn??  :-\

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Robotic Arm Control
« Reply #18 on: February 01, 2012, 01:28:41 PM »
Hi,

That means giving alternate '1' and '0' when i want to rotate the motor...right??  :)
Then i should put it in a loop of alternate (1 and 0) when i want to operate my motor. Is that correct? But what about the delay?
A general CLOCK has a duty cycle. so how much delay i should provide for that? :(
The motor steps on the rising edge, so duty cycle (I guess that's what you mean with "delay") is not important, as long as you leave at least 5..6µs minimum to either phase, which shouldn't be a problem, as the motors steprate will be magnitudes slower.

The rate at which you clock it determines the rotational speed - remember to ramp the speed up and down or you'll loose steps.
To determine the max. speed and ramping speed, run it for eg. 1 meter and let the software count the steps you issued - when you start loosing steps, you're going too fast.
When you find the highest velocity where it doesn't skip steps, reduce the top speed a further ~20% to cater for cold operation, oil gumming up a little etc.


I'm giving the data 1 from parallel port at one end of optocoupler and the other I'll connect a solenoid with a (230-18V) Transformer supply. If i connect it like this does the optocoupler work or burn??  :-\
Not sure that I understand your setup completely, but you cannot drive a solenoid from an opto coupler!
You need to let the opto drive a solenoid driver made for however this solenoid works (mains, 18V, AC/DC or whatever).
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline VenulollaTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: Robotic Arm Control
« Reply #19 on: February 21, 2012, 04:25:19 AM »
Thank you :)

Yeah i got rid of that optocoupler and went with a solenoid driver circuit.
Finished the Gripper and I'm able to control it through my MATLAB software via Parallel port. :)

Now i purchased the stepper motor ICs L297 & L298.
Now i'm able to send the data through the parallel port for the other pins along with the Gripper Circuit :)


Quote
Not sure that I understand your setup completely, but you cannot drive a solenoid from an opto coupler!
My setup consists of a Robotic Arm with two steppers motors for Actuators and Gripper is a Magnetic One. It's a Pick and Place Robotic Arm :)

The motors are present at Base and another at the Arm, which are controlled with two pairs of L297 & L298.
Its a 2 DOF Arm controlled with MATLAB software via Parallel port.

I've considered Magnetic Gripper to pick up some Iron Ball bearings from one place to another. And in the Gripper I've attached a small cup type thing in which I've taken a LED and LDR at two ends of that cup.
When the Load(Iron Ball bearings) are present i.e., when the solenoid attracts the balls, it blocks the Light from the LED.
If the Load is not present the LDR gets the light from the LED and i've connected a small Buzzer which indicates that Load is not present.

Thats my College project in B.Tech for 200Marks  :D
And I'm including your name in my Acknowledgement of Project book :)

************************************************************

The only doubt i've got is about the CLOCK pin of L297 :(

For the CLOCK pin, the signal should have a OFF time and ON time?
I'm thinking to send the Logic 1 for 0.5sec and Logic 0 for 0.5 sec.
Thats a square pulse of Vcc 5V as i'm sending from the parallel port right.
I saw that the Vref pin is max of 3V! Can i send 5V to the CLOCK pin?


I've read the data sheet but got confused   :-\
I saw your reply but i didn't understand that properly :(
Ya I've read that the motor steps on the Rising Edge. And for the Robotic Arm i need torque. That means low speed? As when the torque is more the speed is low.

If the Clock frequency, consider 1Khz and 100Hz. In which case the speed of motor is High?

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Robotic Arm Control
« Reply #20 on: February 22, 2012, 05:12:55 PM »
Hi,

For the CLOCK pin, the signal should have a OFF time and ON time?
I'm thinking to send the Logic 1 for 0.5sec and Logic 0 for 0.5 sec.
Thats a square pulse of Vcc 5V as i'm sending from the parallel port right.
Yes, it's a (very slow) square wave.

I saw that the Vref pin is max of 3V! Can i send 5V to the CLOCK pin?
Yes, the VREF is an analog input used with the sense resistors to set a max current and above that, the current is chopped.
The Clock input, is a logic level signal and should be 5V (assuming VS is 5V).


If the Clock frequency, consider 1Khz and 100Hz. In which case the speed of motor is High?
The speed (RPM) depends on the number of steps per revolution. If you have a motor with say 7.5°/step (48 steps/rev) a Clock frequency of 1kHz equates to 1250RPM.

  Motor RPM = frequency * deg_per_step * 60 / 360

The more steps on a single revolution, the slower the motor will be.

If you make your square wave 10'000 Hz and the motor is a 1.8°/step (i.e. 200 step/rev), the resulting speed will be 10000*1.8*60/360  = 3000RPM.
Since I don't know your motors, you have to calculate this yourself.

You will need to ramp up and down the speed for starting and stopping (or you'll loose steps in the beginning and over-shoot in the end of a move). The easiest way to do this might be to make a pulse of say 10µs each time you want the motor to step and then adjust the delays between the pulses to set a certain speed.


EDIT: Blunders in formulas corrected - thanks to rbtying's sharp eyes :)
« Last Edit: February 23, 2012, 07:02:19 PM by Soeren »
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline rbtying

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
Re: Robotic Arm Control
« Reply #21 on: February 22, 2012, 07:23:30 PM »
Soeren,

Wouldn't the proper conversion between frequency and RPM be frequency * deg_per_step * 60 / 360, seeing as Hz in periods per second, not per minute?

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Robotic Arm Control
« Reply #22 on: February 23, 2012, 06:54:45 PM »
Soeren,

Wouldn't the proper conversion between frequency and RPM be frequency * deg_per_step * 60 / 360, seeing as Hz in periods per second, not per minute?
You're absolutely right, good catch, I better edit that post (and double check what I write when I'm so tired that my eyes burns and runs - don't know how I got to 2667RPM either, probably a wrong key press on the calculator and too little light to catch it).
Thanks!  :)
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline VenulollaTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Robotic Arm Control
« Reply #23 on: April 20, 2012, 06:30:22 PM »
Hey guys  :)

Guess what....completed my Robotic Arm !  :)

"Design and Control of a Two Degree of Freedom Robotic Arm using MATLAB GUI"

It worked....finished my project and got an A++  8)  :D

Thanks to all people who helped me in building this Robotic Arm. Love this site :)
Especially a great thanks to Soeren :)

The following is the Robotic Arm which i made...its kinda' mess with all those wires  :D

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Robotic Arm Control
« Reply #24 on: April 24, 2012, 10:00:55 AM »
Hi,

It worked....finished my project and got an A++  8)  :D
Way to go... Congrats, it was well deserved - you sure spanked the learning curve into submission  ;D ;D ;D
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

 


Get Your Ad Here