Robot arm: feedback sensory (Skutter v0.2)


93 posts   Page 4 of 4   1, 2, 3, 4
by Ravenous » Thu Jun 14, 2012 9:11 am
At best you only need one switch per axis/degree of freedom. When the robot initialises just make it move in one direction until it hits the switch. You need to make sure the robot is always parked a bit away from the switch when shutting it down (and always on one particular side of it so it will find the switch on the next start up).

You can use an opto sensor instead of a switch - I've seen a few industrial encoder discs that have, alongside the usual slots, a tiny hole for an opto sensor. Every time the arm goes past this the home position for that axis can be updated. (Can't remember what I saw them on though, an expensive industrial thing no doubt.)

You only need this for incremental encoders though - remember for your suggested graded grey stripe (or those tilt sensors on the arm) it should know where it is immediately it's powered up.
Posts: 1455
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK
by SN » Thu Jun 14, 2012 9:16 am
morphy_richards wrote:That could work well. So, if you told the arm to :
(1) Start rotating (say) left until it triggers the switch and then
(2) Start timer and start rotating right
(3) On hitting right switch stop timer and rotation.
(4) Divide time by 270 /* The base can rotate by 270 degrees. This would give the time needed for the arm to rotate by 1 degree
You would need two switches per joint. Counting joints - there are shoulder, elbow, wrist (not counting the gripper ATM) and base. That would mean 8 switches are needed which would be well within the scope ogf the GPIO. Even 10 is do-able so you can do the gripper as well.
Image
That method would also be a solution for the rotary - non absolute opto encoder method that Ravenous has pointed out. Rotate arm segments until the opto encodes report there is no more movement occuring and treat that point as first position. Then take all subsequent movements from there.

Exactly. I have a more complex C program (than the one I posted up here a couple of weeks ago) that has all the definitions of how long (in roughmilliseconds) it takes to drive each joint from one extremity to the other (1700ms for the gripper) which can be used for this
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?
User avatar
Posts: 1009
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
by morphy_richards » Tue Jun 19, 2012 10:43 am
Quick update:

I've expanded the hall effect sensor network to use 6 sensors and only one magnet. That will ensure that at any one time there will be either one or two sensors in range of the magnetic field. The sensors have been soldered on to strip-board and have been fixed in place using sticky back Velcro tape.
Image (I now have a Pi!)
I have obtained a number of PCF8591P 8bit A-Dconverter with I2C interfaces. These chips have 3 bits available for setting the I2C interface address and have four analogue inputs. Two of these chips will supply the Pi with the values from the 6 sensors.

I intend to get values of base angle as follows.

I will write a "simple" (famous last words) calibration program using Python. This will prompt the user to manually rotate the arm to 0 degrees. It will then record the values from those 6 sensors. The user will then be prompted to rotate the arm by increments of ten degrees and click a UI control on the screen to confirm the position. The values from the six sensors will be read again. This will happen from 0 degrees through to 270 degrees. On completion the data will be saved to a CSV file where it can subsequently be accessed by an "interpolation object". This will interpolate the known points which are separated by ten degrees and allow subsequent higher level control programs to request movement down to one degree accuracy. (hopefully)
User avatar
Posts: 858
Joined: Mon Mar 05, 2012 3:26 pm
Location: London
by Ravenous » Tue Jun 19, 2012 11:19 am
Will this scheme allow you to uniquely measure the position?

What I mean is, if the magnet is slightly to the right or left of hall3, it will give the same reading in both positions. So you won't be able to tell which of those two positions it is - unless the magnet can also be seen weakly by either hall2 or hall4 on either side, in which case it's OK.

If not, maybe two magnets separated by some specially worked out distance (1.5x the halls' spacing?) could be the way to do it...
Posts: 1455
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK
by morphy_richards » Tue Jun 19, 2012 12:12 pm
I get what you mean... there is "crossover" as two adjacent sensors pass by a magnet - if you scroll further back up this thread and look at the graph from my first experiment with three sensors. It will be the values from 2 sensors that will enable me to judge the postion... ah... and let this be a lesson to me, read things properly before jumping and replying. Exactly as you say "unless the magnet can also be seen weakly by either hall2 or hall4 on either side"

Looking forward to getting this bit done. Once I've got rotation done I'm going to have lots of fun with the Sharp IR Rangefinder.
User avatar
Posts: 858
Joined: Mon Mar 05, 2012 3:26 pm
Location: London
by morphy_richards » Tue Jun 26, 2012 2:02 pm
Not really part of the feedback thread but folks might like to know that PyUSB1.0 works really well on a Raspberry Pi and that the arm can be controlled easily with Python. This video is the arm running a control program jointly written by the MagPi team and I.
(I really really wish there was a way to embed youtube videos in posts)
User avatar
Posts: 858
Joined: Mon Mar 05, 2012 3:26 pm
Location: London
by morphy_richards » Wed Jun 27, 2012 12:48 pm
Blast and counfound it! Why is this happening?

When I had only 3 hall sensors I got nice smooth outputs.
Image
Now I have 6. I've cannibalised some old cat 5 cable to wire them up and now I have outputs like this:

Image

There was some interference on the first experiment but the curves were smooth. Now the interference is all over the curves as well. Why is this happening? Should I try to add shielding to the cat 5 cable?

Is this another doomed experiment that needs to be consigned to the proverbial rubbish dump?

Argh.
User avatar
Posts: 858
Joined: Mon Mar 05, 2012 3:26 pm
Location: London
by Ravenous » Wed Jun 27, 2012 1:02 pm
Is the +5V (or whatever) supply to the Hall sensors smooth? Poor connection to it (dodgy breadboard connection, etc)?

All sorts of possibilities. When was the smooth curve done, on a different day & time? Do you have fluorescent lights? Fridge compressor running? Is the mains just spiky today?

If you stop at each position and average lots of readings for each, do you still get a smooth curve?

Very annoying as the earlier plots were all so smooth. The good news is they were smooth on the first attempts, so you know it's possible and didn't give up immediately.

Welcome to the harrowing world of analogue signal conditioning. Now I remember why we all went digital :(

EDIT: forgot to add, does the motor have a suppression capacitor fitted? If so, has it become disconnected, or have you changed the arrangements for driving the motor in any way? Motors (or their drivers) generate more noise than anything...
Posts: 1455
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK
by morphy_richards » Wed Jun 27, 2012 2:43 pm
"EDIT: forgot to add, does the motor have a suppression capacitor fitted? If so, has it become disconnected, or have you changed the arrangements for driving the motor in any way? Motors (or their drivers) generate more noise than anything..."


Nothing like that obviously as far as I can remember - where would that go? If I remember rightly it should go between + and - ,directly on the motor terminals.


Right ... here are two close ups of data from different tests done earlier today. Each graph shows readings from two of the six sensors for clarity. The sample rate was set at one sample per 100 ms.

Image

Image
So,the ineterefence seems to be happening at about 300 or 400 kHz. ish. (?)

What if I chucked a capacitor in parallell between ground and as close to the analogue input of the ADC as possible to act as a kind of simple low pass filter?

I suppose there is only one way to find out but it will have to wait until tomorrow now. Would that work in theory?
User avatar
Posts: 858
Joined: Mon Mar 05, 2012 3:26 pm
Location: London
by Ravenous » Wed Jun 27, 2012 3:19 pm
Don't understand, you're sampling ten times per second but think the noise is at 300-400KHz from that? It just looks random to me. But it's only 1/10th of a volt or so, if that's what the left axis means.

I mentioned the capacitor on the motor only to see if there was one. There isn't, so its wiring hasn't failed. Something else has changed since the earlier examples.

The wiring must be a suspect, if you changed to using another cable, especially if a different length or the strands are much thinner perhaps.

Also are you sure your power supply is clean, is there any high frequency noise on it? Can you borrow an oscilloscope and look at the power, the ground, and the hall sensor outputs, with and without output wires attached? Have you got decoupling capacitors on the power supply? (I used an earlier Sharp IR sensor a few years ago, and I suspect it put spikes out onto the 5V supply, for example.)

Are you using a different monitor while collecting this data? Or a different PC? Could be almost anything. All we know is the earlier runs looked really good.
Posts: 1455
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK
by morphy_richards » Wed Jun 27, 2012 6:38 pm
I have a tendency to repeatedly make really careless mistakes, sometimes with wiring up / working out / writing up on here. Generally what happens is I get the odd half hour or hour here or there where I can work on something, and then time runs out and it's literally 2 minutes left to write something up or whatever before I have to leg it and do something else like do a lesson. So I sometimes end up doing gibberish (excuses excuses) anyway, your right 300-400 khz is silly.

I don’t have easy access to an oscilloscope, I could try to borrow one from science but it wouldnt be easy because they need them all pretty constantly themselves. I have been using an arduino as a sort of poor mans 'scope.

I might try connecting the +5v to an analogue input via a resistor and also an output from a hall sensor into another analogue input and try 1 - seeing if the supply voltage is spiky, and 2 - if it is, seeing if it correlates to the interference on a hall sensor in any obvious way.

Could it be the cable itself? It's cat 5 network cable, about 40 cm long. Two wires are +5v and Gnd, which are then shared to the 6 sensors in parallel. The other 6 wires are all data outputs from the sensors. Each wire is part of a twisted pair of wires inside the cable housing.

There's not much else different with the original configuration. Havent been able to test it yet with a proper I2C ADC and the Pi yet because I'm still waiting on some female jumpers and a ribbon cable and connector to use with the GPIO
User avatar
Posts: 858
Joined: Mon Mar 05, 2012 3:26 pm
Location: London
by morphy_richards » Thu Jun 28, 2012 9:50 am
Image
It's the position of the magnet in relation to the hall sensor. I'd used a glue gun to stick the sensors to a velcro strip and added about 5 mm to the height of the sensor in the process, thus the sensor only partly passes though the magnetic field. The interference is always there but is negligible when the reading from the magnet passing close by is overwhelmingly greater. If the magnetic field picked up by the sensor is less powerful then obviously the interference becomes more relevent.

Phew! Just need some repostioning. 8-)
User avatar
Posts: 858
Joined: Mon Mar 05, 2012 3:26 pm
Location: London
by crazyideas » Sat Sep 01, 2012 6:37 pm
I have been reading this post with vigorous interest but it seems to have met an abrupt end. Did it continue anywhere else or can we expect an article in the MagPi which shows us a great solution to a closed loop control for the robotic arm?

A lot of time spent here at hard work, Im impressed! :o
Posts: 12
Joined: Wed Aug 29, 2012 12:42 pm
by morphy_richards » Fri Sep 07, 2012 5:20 pm
Hello I am back. My priorities had to change to accomodate a temporary role as domestic stay at home daddy for my one year old daughter and giving away my younger sister at her wedding. Not to mention a fantastic holiday "techno free".
Before I had left most of the action had shifted to this thread over here
viewtopic.php?f=44&t=6391
Where I was trying some specific methods and chips to enable the pi to obtain sensor readings from the skutter.
More to come in due course.
User avatar
Posts: 858
Joined: Mon Mar 05, 2012 3:26 pm
Location: London
by morphy_richards » Sat Sep 08, 2012 5:46 am
Thanks to rieyden's comment in the aquarium monitor thread I've found this which looks like it may well provide a much more reliable general purpose multi channel adc than the one I was playing with previously.
I can feel another electronics order coming up.
User avatar
Posts: 858
Joined: Mon Mar 05, 2012 3:26 pm
Location: London
by morphy_richards » Mon Nov 12, 2012 4:09 pm
Inspired a bit by the Magpi article on accelerometer soldering I had a bit of a go at making an accelerometer module today.

I'm using some LIS35DE ICs. The plan is to use three in total, one on each arm section. Potential advantages over using potentiometers or encoding as feedback methods is that you don't have to go about butchering the robot arm or anything like that as they can be simply stuck on to any convenient spot on the arm sections. Using 2G mode it should be sensitive enough to feedback the angle it's at in relation to earths gravity - (although trying to take a reading when the skutter is moving might be interesting)

They are tiny... really really tiny!

Here's one.
Image

I spent an hour or so (that I should really have been doing other things with) carefully tinning each contact and then soldering on tiny bits of thin varnished wire stuff that I salvaged from an old knackered case fan motor.

Look, I've made a sort of macro-virus thingy!
Image

I then spent a further half an hour trying to solder the stuff down onto stripboard. (Now my eyes hurt and my head feels a bit funny)

Look, I've made a great big mess!
Image

There's a whole load of things that might go wrong ...

The varnish stuff on the wire might not have properly melted at the joints so I might have some dud connections...
The varnish stuff might have come off at some points near the strip board so I might have some shorts ...
For all I know I might have soldered pin 1 to pin 6 via 8, 9 and 12 and created a small scale model of spaghetti junction. Half of this is thing is stuck together on the principle of blind faith and "ah soddit"

Anyway, it's going to be a case of suck it and see. If this works, great... if not I've got three more of these things to try to refine the process with.

It's an i2c device so next step will be to try to make i2cdetect detect it... Will see how it goes but that's all I can do for the next few days as real life is jumping up and down and shouting like a very angry person who has been left out of something important and isn't very happy about it.
User avatar
Posts: 858
Joined: Mon Mar 05, 2012 3:26 pm
Location: London
by morphy_richards » Tue Nov 13, 2012 2:44 pm
Will probably treat this one as a practice it's not too likely to work.
Soldering wires onto the breadboard has possibly mucked up the tiny thin wires. In the next versions I will solder these bits on first and then solder the little chip down last of all.
So it will need to be like this (I think)

Image

Pin outs
Image
User avatar
Posts: 858
Joined: Mon Mar 05, 2012 3:26 pm
Location: London
by Ravenous » Mon Nov 19, 2012 5:38 pm
Wow you need a magnifier! (I do at my age. I use a 4" magnifying glass on a lab stand.)

Next time I'd start by gluing the chip, on its back, to the piece of stripboard, with its pads facing upwards. Then fit veropins around it and finally solder the wires point to point. It'd end up looking like a chamber of horrors for silicon based life forms though... (Bear in mind I've never tried to solder anything so tiny, I'm just guessing this will work.)

I heard you can use the fine enamelled wire by burning the end then scraping the charred stuff off. Never quite works for me though, maybe I don't get it hot enough. Or you can use the stuff that comes with a "wiring pen" if that's what it's called - a tiny reel of fine wire with a thin plastic insulation. The idea is a soldering iron burns the plastic off where you need it and the solder gets to the joint that way.

EDIT: or get some multistrand wire, pull a few inches of insulation off it and cut the individual strands...
Posts: 1455
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK