PDA

View Full Version : Wire guide & H-bridge control



RFsolution
- 13th August 2013, 20:56
Hi All,

I think this might be a very interesting topic for all robot builders


I have build a prototype robot with 2 DC motors controlled by a dual H-bridge controlled by I2C

http://www.robot-electronics.co.uk/htm/md22tech.htm

I2C control is quite easy, i use the turn mode


The robot needs to follow a buried wire with 100 khz RF, as buried wire detector I build the following circuit

http://www.philohome.com/sensors/filoguide.htm

Has anyone a code example on how to do the PID control and eventually additional filtering and hysteresis ? starting from the deteted
DC voltage on the ADC

I think the control will be quite the same as the line following robots (black line)

Maybe we can start a code discusion with examples here, so everyone can learn and share little pieces of code ?

Cheers

comwarrior
- 16th August 2013, 00:59
Hi RFsolution,
With line following robots, they have inputs from both (or all) sensors so that they know if they are way too far over.

From your description you have 4 distinct zones of control.
1) the wire is way over to the left of the left most sensor.
2) the wire is between the left and right sensor.
3) the wire is way over to the right of the right most sensor.
4) their is no wire

If you use a differential output from a comparator or such then you could loose the ability to sense if the wire goes outside the two sensors (far left and far right).
However, if you ADC scanned both sensors at a rapid pace then your robot is less likely to get lost also, it means that your control loop can be tuned so that the robot can speed up when it the wire is in the centre and slow down if it thinks it's loosing the wire. But also, the adjustments to motor control can be small when the wire is in the centre and progressively coarser the more the wire moves from the centre.

Also, you don't necessarily need to use coils of wire as detectors, the analogue hall effect sensors would be an easier, smaller and cheaper option. Be aware though that Hall effect sensors come in at-least two types, one has a digital output that is on when a certain field strength is reached, these types will not work for your needs. However the analogue ones give you an output that can be fed directly into the ADC to provide a voltage based upon how much of a magnetic field is being picked up.

I hope this helps...

RFsolution
- 16th August 2013, 07:01
Hi Comwarrior

thanks for your information,

I will have a look for analog Hall sensors, never used them

Ofcourse with the LC coil detector like lego mindstorm, i can feed both detetor voltage to 2 ADC's separatly, maybe this is more simple ?

Can you point me to some often used analog hall effect devices ?

will google and Farnell a bit

Thanks

comwarrior
- 16th August 2013, 13:43
well, according to the datasheet the A1302 should work fine for your application.
5V only though, but it's linear 1.3 mV/G so for every 1.3mV on its output you have 1 gauss... if you used a 4V precision Vref (some pics have them onboard) then you could actually make your bot detect and measure the EM field.
Best yet, it cheep £0.99 each...

Here is the farnell link... http://uk.farnell.com/allegro-microsystems/a1302kua-t/sensor-hall-effect-linear-3sip/dp/1791388

Also, ontop of this... you don't have to use an AC circuit to drive the wire... you can run DC through it... thus saving even more time and money...

RFsolution
- 16th August 2013, 15:06
Thanks, I took a look and ordered a few to test, as the wire is buried I need to detect it at a distance of 10-20cm, I'm thinking to install 2 sensors about the same distance and then use 2 ADC's

I get back here if i did some tests