Deacon (Code name A1B1)
| Attachment | Size |
|---|---|
| Base_tanque_Model_1.pdf | 5.69 KB |
| Motor_Tamiya_Twin_Gearbox_fa_130ra_Datasheet.pdf | 56.52 KB |
| Picaxe18_Dual_L293D_LCD_-_Line_Follower_v1.1.txt | 2.04 KB |
INTRO
This project -christened Deacon- is the next step in evolution from Nigel, who was abandoned last year.
June 9th, 2011
As it was recently settled on a forum post, the H-Bridge design I´ll implement (after I make it) is one borrowed from Pyro Electro Tutorials. http://www.pyroelectro.com/tutorials/h_bridge_4_transistor/index.html. I do have one L293D IC in stock, but I believe building the one in the link will be a nice learning experience.
(NOTE: I have desisted from building Pyro Electro´s H-Bridge design due to a flaw that Dan M brought to my attention. For more info on this and for a better design, see the comments below)
The goal in this first stage is to remotely control it, having it move forward, backward and turn at different speeds via PWM. Once that is done, I´ll get more ambitious. For now, I am taking a "one step at a time" approach so that this project doesn´t engulf me and spit me out (as it had in the past).
June 17th, 2011
For lack of a couple of components (amateur mistake) and trapped in a long weekend, I had to postpone the build of Pyro´s H-Bridge, but decided to move forward with the L293D I had purchased. That IC in a protoboard, stars in the film located towards the top of this page, with a brilliant supporting performance by a hacked Kodak Ektagraphic projector remote control.

June 21st, 2011 (First day of Winter):
Happy to report that STAGE 1 is now complete. The platform is functioning. I decided against using PWM at this stage. So basically what I have is a functioning remote control tank.
I have decided that the next Stage is to add line-following capabilities to the platform, and since what is finally driving the motors is a L293D, I´ve decided to go with this tutorial: http://www.societyofrobots.com/member_tutorials/node/62. Even though I have a bunch of Picaxes lying around that are anxious to see some action, I thought I´d keep it simple.
June 25th, 2011 (Fourth day of Winter):

Happy to report that STAGE 2 is well under way. I have devised and built a standalone module that just needs a power input (>6 VDC) and has a connector that outputs voltages for 3 different LDRs. Each reads light from it own LED. I have slept on it, and instead of going with the tutorial from Society of Robots, I´ll control everything with a Picaxe 18X.

This module will sit in the guts of the robot, while the Picaxe 18 Protoboard (that I still need to improvise) while sit on top of the permanent standoffs that I have placed on top of it.
June 30th, 2011 (Tenth Day of Winter)
One of the mistakes I never get tired of making is jumping to making my own boards before I fully test a circuit in a breadboard. And I´ve done it again. On the 25th, I commited my design to a PCB and ever since then I have been reviewing and modifying it ad nauseam. There are 3 particular resistors whose values I have changed a number of times, trying to get the voltage divider with the CdS cells to work the way I want it to. Rookie mistake. It is just that my OCD will not let me enjoy a temporary circuit... they are just sooooo messy! It is very frustrating when wires come loose... (Note to self: maybe it´s time to invest in those fancy cables for the breadboard, instead of using these bits of wire cut to length...)
Anyway, back to the point. Little progress was made these past 5 days, other than tinkering with the line follower module, getting it to work just right.
July 2nd, 2011 (Twelth Day of Winter)
The line follower board is finally ready. It is also properly mounted to the chassis. Take a look:


Next step is to start playing around with code. Little experience in this department, so I don´t expect progress to be mindbogglingly fast. For the time being, I have placed my DIY Picaxe 08M Protoboard on top of the chassis so as to start experimenting with intercommunication between both boards. Once I get a feel for the average values produced by the follower board on the ADC pins of the 08M, I´ll remove the protoboard and start working on the DIY 18X protoboard.
July 6th, 2011 (Sixteenth Day of Winter)
Very frustrated here!
All my Picaxe 08M protoboard+L293D on a breadboard+my line follower board experiments were a disaster. So far, I didn´t get a single thing to work right. For troubleshooting sake, I have broken everything up into 3 boards trying to locate specific problems. Everything is a mess. I am concentrating on the L293D. But I am using the Tamiya Twin Gearbox and those Mabuchi motors only use 3VDC, and for some reason; I can´t get them to work. I don´t know if the 4,5 VDC minimum voltage specified in the datasheet also applies to pin 8, which is the motor VCC. If that is not the case, then I don´t know why (the hell) this thing is not working!
Very frustrated here!
July 13th, 2011 (23rd Day of Winter)
Just as I was ready to set the entire project ablaze, both my mail orders arrived. The FRM010 Serial Firmware IC from Picaxe (to control a LCD Display with just one output pin) and both Sharp IR Sensors. That peaked my interest, so I decided to take a break from troubleshooting the line follower portion of the project. Trying to get the FRM010 and my Winstar LCD to talk to each other recquired an abrupt learning curve, that has been properly documented here: http://www.picaxeforum.co.uk/showthread.php?t=15150.
I took a page out of my own book and experimented with the circuit as much as I needed on the breadboard stage. Once that was fully tested, I moved on to a more permanent solution.


I thought it would be cool to have the following welcome message every time I switch it on: "Greetings, earthlings!" or, if you prefer, "¡Saludos, terrícolas!" in my native Spanish. On the right hand side of the display, on the bottom board, what you see are the pot for the contrast of the characters and I included a small switch for the backlight, to cut down on current consumption when powered by batteries and not needed.
I haven´t even touched the Sharp sensors because of the stubborn JST connector that they come with. It has probed to be almost impossible to get locally. Had I known about these, I would have ordered them together with the sensors. I am not about to place another order just for those. Worst comes to worst, I´ll desoder them and put something else in its place.
July 15th, 2011 (25th day of Winter)
Some more progress!
The line follower board is finally working at 100% capacity. Not only that, but it is even talking to the LCD. I have jolted down an easy routine to monitor in real time the 3 ADC values generated by the 3 sets of LED+LDRs. Then I even added a line to state below which LDR the black line is located.

First line: "Linea debajo cen" means Line below center (LDR). Second line: real time monitoring of the 3 LDRs: I=Left, C=Center and D=Right, -also in Spanish-.
Next in store is: using the same routine to control an L293D. Shouldn´t be that hard.
July 22nd, 2011 (31st day of Winter)

I hve added the drawing of the chassis of my base to the download list. In case anyone cares to look at it closer.
July 25th, 2011 (34th day of Winter)

That´s more like it!
August 1st, 2011 (41st day of winter)
Well, after a rather frustrating experimentation period with PIC-AIM, my break from Deacon is over. I am still trying to figure out stupid little details like the interaction of the L293D and the Tamiya Twin Gearbox Motor. The MIN voltage accepted by the IC is 4.5VDC and that seems to be too much for the motors. I am feeding it 5VDC and the IC is dropping very little tension so I will add some passive components to get it closer to the 3.0VDC that it likes. I have added the motor datasheet to the download list for reference.

BTW, If anyone was wondering, let me tell you why there are so many pictures of Deacon with the treads off. It is a comfortable way of testing code. Since the drive wheel is up in the air, if I remove the treads I can try out different speeds and directions without the thing actually moving. Very handy.
August 5th, 2011 (44th day of Winter)
I have added a third video. This is the first showing autonomous movement. (Yay). This first example is a very crude piece of code that has the thing move forward for 5 seconds. Stop for 5 seconds. Move backwards for 5 seconds and stop again for another 5 seconds. Then it cycles again... ad eternum (which is latin for "as long as the batteries last"). This weekend I´ll commit the circuit in the bigger protoboard (v 2.0 not v 1.5 in the picture above) to a permanent board so that I can experiments with new aspects, such as PWM the enable pin of the L293D, or first attempts at line following.
August 6th, 2011 (45th day of Winter)
The circuit mentioned above has already found a permanent residence in a homebrew board.

I am happy to report that it worked fine from the first try (which is a first). Trying out different pieces of code is now comfortable (as opposed to messy) and that makes me happy. I have toyed around with it and had the best afternoon.
Last step is to connect the output of the line follower board to the inputs of the Picaxe 18X that still finds shelter in a protoboard. That, and fiddling with the line follower code. This project is nearing completion!
August 10th, 2011 (49th day of Winter)
Last night I started experimenting line following with a very crude code. You can find it in the attachments list. Criticism and pointers welcome.
August 17th, 2011 (56th day of Winter)

The wife skis. I never tried. We will stay here until Sunday. I took snowboarding lessons the other day. The teacher was an absolute dick. I am in much pain since then. I will have to take it up. Until then, this is my view.
August 23rd, 2011 (62nd Day of Winter)
First of all, I´m back. Missed me? :(
Now, I´ve been experimenting with some different approaches to the line following code. It is working, but not accurately enough. I´ve been thinking about the core principles of the system, and I´ve come to doubt the philosophy behind it. As it stands right now (see code snippet below), I am storing ADC values into variables and then comparing them.
readadc 0,ADC_CEN ;Read pin voltage of 3 LDRs into ADC
readadc 1,ADC_LEF
readadc 2,ADC_RIGlet CMPNS8_CEN=255-ADC_CEN ;variables CMPNS8_CEN, LEF and RIG hold the difference between full 255 value and
let CMPNS8_LEF=255-ADC_LEF ;maximum LDR value taken over white
let CMPNS8_RIG=255-ADC_RIG
let CEN_LDR=ADC_CEN+CMPNS8_CEN max 255 ; variables CEN, LEF and RIG_LDR hold compensated value of light readings
let LEF_LDR=ADC_LEF+CMPNS8_LEF max 255
let RIG_LDR=ADC_RIG+CMPNS8_RIG max 255
...but, wouldn´t I be better off interpreting the output of the LDR as 1-bit digital? 0 for "over-line" and 1 for "over-white"? Do I really need 255 shades of gray? Does the code really need to be this complicated? 3 sets of 3 variables each to read the output of 3 LDRs? Overkill?
What got me thinking about this, is the book I read over the holidays: "The Robot Builder´s Cookbook" by Owen Bishop. It is nothing too fancy or complicated, but highly recomended for those of us who don´t have an enginnering degree. In said book, Mr. Bishop gives a recipe por turning the output of an analogue sensor (like an LDR) into a digital one using a comparator IC (a CA3140E to be precise).
So, borrowing a page from his book, why don´t I just build a no-nonsense truth table for the 3 LDRs? The only complication there would be the fine tuning of the reference voltage...
Does anyone have an opinion?
September 20th, 2011 (LAST day of Winter)
I didn´t want to miss out on posting something today, the very last day of winter in the bottom half of the earth. I guess a little recap is in order:
After Ignoblegnome´s response to my last post, I decided to follow the path he suggested: Keeping the line follower board as it was and incorporating a crude type of ADC in my code. And so I did. Now, if the value of certain LDR is above (let´s say) 185, the code interprets that as a logic high. If not, it´s a logic low.
This worked fine. It probed the point that 256 shades of gray are overkill for line following. 1 digital bit is all you need.
The last development was redoing the line follower board, but instead of the LDRs I was using, incorporating some sort of reflective optocoupler that are so fashionable now-a-days. I couldn´t find the QRD1114 or CNY70 locally, so I modified the concept for the only sensor I could find: the TLP907. I have already etched the board and I´ll try to put it together tonight.
October 16th, 2011 (26th day of Spring)
I haven´t updated this blog in a while, so I´ll bring you up to speed. After 5 or 6 versions of the the new line follower board (the one that incorporates the TLP907 sensor) I gave up on it. Two major problems: 1) the legs of the IC are too damned fragile. I kept breaking them and buying new ones. 2) The sensing distance is too narrow: less than 1.5mm off the face of it. I couldn´t align all 5 sensors so that all of them were less than 1.5mm off the ground.
I decided to orden QRD1114s from abroad and move on. (They haven´t arrived yet)
Next on my TO-DO list was come up with a protoboard for the PICAXE 18X. Happy to report that that is done and I´m currenlty testing it. You can take a look at it below.

I took advantage of this break from the line follower board to incorporate into Deacon the design I came up with here, in the last video uploaded. It´s your average pan/tilt arrangement but used differently. The idea is: when the bot is moving, the sensor will be pointing down to detect sudden drops. At regular intervals, the bot will stop and look up. It´ll pan 100° and determine the path with least obstacles. It will correct it´s course, look down and start moving again. This is what I´ve been up to. I leave you with some new pictures of Deacon.




@ Sun, 2011-09-25 20:53
Why?
whats up with this robot name calling. You name your robot "Deacon". The other guy with the same project with similar function name it something else. I can understand if you love your robot but name calling your robot just to make it feel unique is funny for me thats just my opinion . No offense to everyone here in LMR.
@ Mon, 2011-09-26 04:41
Oh darn, I missed out on
Oh darn, I missed out on taking the name gluestickrocks... Oh well, I guess I'm stuck with Dan. Ha Ha.
No, but I see your point. I did not name mine for a long time and then finally decided that since every robot should have a unique name (Like C3P0, R2D2 from Star Wars, Gort from The Day the Earth Stood Still, Wall-E from the movie of the same name, and so on...) I finally decided to name mine.
You might wonder what Shrodinger has to do with a robot, but it is just a name that I picked in honor of one of the early fathers of Quantum Mechanics -(One of my fields of study.)
Anyway, the naming of robots with different individual names is done because it has traditionally been done that way, as I mentioned above. Hope that sounds reasonable.
@ Tue, 2011-08-23 23:27
Regarding using a comparator
Regarding using a comparator IC for your line follower. That would work.
However, you can just read in the analog value and set a variable to indicate a digital value based on whatever threshold you set. In other words, your Arduino performs the comparator function for you.
@ Thu, 2011-08-25 15:48
Thanks, Ignoblegnome. I had
Thanks, Ignoblegnome. I had not thought of that. Painfully obvious as it is right now. I will do JUST that. Great idea. You the man!
@ Thu, 2011-09-22 05:02
Glad my comment helped you.
Glad my comment helped you. Let us know how the reflective sensor works out.
@ Thu, 2011-08-11 19:39
nope
6V motors with a 6V power supply.
@ Mon, 2011-09-26 05:56
I see. My comment was that
I see. My comment was that the circuit would not work as drawn.
Your new drawing is different. The 74LS86 has disappeared in favour of a simple switch. With that switch closed as shown the base of the 2N2222A is positive and the transistor should be ON, but the values shown at probe2 and probe4 show the transistor more OFF than ON: (voltage across the collector emitter is more than half the supply voltage).
I presume R5 is supposed to take the place of a motor? First off, not to nit-pick, but just to point out for any interested, motors are inductive loads, not just resistive, so to simulate a motor, you should show a coil with a dc resistance of that much and inductive reactance equal to that of your motor. That is not really that important, though. The transistors are current devices that don't care if the load is resistive or inductive.
[I'm sorry for being so negative, but this is a field where I know I am right. I've worked with transistors since the late 50's-early 60's way before the so-called "transistor radio boom" and in fact, before transistors were ever released to the public.]
I note that basically none of the readings and values agree with the specification sheets for these parts. Not sure what these are supposed to represent, but it looks similar to an analog amplifier circuit, not a switching circuit. With the drawing showing 961 mA through collector-emitter but only driven by 40.8 milliamps this is obviously employing small signal forward gain (hfe) which does not apply in switching circuits. Many people get this confused. To use a transistor as a switch, you must use the saturation values, not the hfe value. I see the same error in the 2N2222A circuit. It has a CE current of 40.8 mA but only driven by 343 μA. This would be a forward gain of 119. That is quite attainable in, say, an audio circuit, but in a switching application the gain of a 2N2222A is only 10, (not over 100).
Find the Fairchild 2N2222A spec sheet at: http://www.fairchildsemi.com/ds/PN/PN2222A.pdf
Note on page two the values for collector-emitter saturation voltage which shows what the base current must be. If Ic is 150 mA, then base current, Ib, must be 15 mA. (One tenth the collector current). The TIP transistors also have a sat. gain of ten throughout their range, except at the upper end of their curves, (2 to 3 amps current) where the gain drops to only 8 times (--in other words, the base current must equal one eighth the collector current).
I take it that this drawing is from one of those "simulation" programs, and frankly, I've almost never yet seen a simulation program that shows what happens in the real world. Take the values from the Fairchild spec sheets and plug them into your sim. program and if it works correctly, you will see the results I am talking about. Better yet, try it with real parts, and take readings. I think you will find that actual readings agree pretty well with the spec sheets.
Example: The TIP31C shows a junction voltage of only .267 volts above, and you may know that common silicon transistors do not have junction voltages less than about 0.7 volts. In the case of the TIP 31C the CE junction voltage is 1.2 volts on the Fairchild spec sheets. Voltage attained through pulse test: PW=<300ms with a duty cycle of =< 2%. Considering that they make them and tested how they act, I tend to follow what they say. Germanium transistors can have that low a junction voltage, but the TIP31C is not germanium; it is an expitaxial silicon transistor.
For the TIP31C, take a look at this Fairchild .pdf file: (http://www.fairchildsemi.com/ds/TI%2FTIP31C.pdf ) and for the TIP32C:
(http://www.fairchildsemi.com/ds/TI%2FTIP32C.pdf ) and you will see that your simulation program has the wrong values plugged in. If I read the spec sheets incorrectly, then I am wrong, but it looks pretty straight-forward to me.
Excerpt from TIP31C data sheet
IEBO
Emitter Cut-off Current
VEB = 5V, IC = 0
1
mA
hFE
* DC Current Gain
VCE = 4V, IC = 1A
VCE = 4V, IC = 3A
25
10
50
VCE(sat)
* Collector-Emitter Saturation Voltage
IC = 3A,
IB = 375mA
1.2
V
VBE(sat)
* Base-Emitter Saturation Voltage
VCE = 4V, IC = 3A
1.8
V
fT
Current Gain Bandwidth Product
VCE = 10V, IC = 500mA, f = 1MHz
3.0
MHz
@ Thu, 2011-08-11 07:31
H Bridge
You should simulate the H Bridge with a 0.9A load and you will see that this circuit is suitable for this application, maybe not for a 3A load, i've test it with a motor which stall current is aprox. 2A and it works great.
@ Thu, 2011-08-11 16:55
Looking at the "absolute
For a 0.9 amp load, the TIP transistors will need ~90 mA from the 2N2222s, and those in turn need to pull 9 mA from the 74LS86 chip. Looking at the "absolute maximum" ratings on the spec sheet for a 74LS86, I see 10 mA max, so it does look possible to drive .9 amps load, but I still find the 2 A stall current hard to believe, unless you substituted something like a 74HC86 in place of the LS chip. (HC = high capacity; LS = low power schottkey). You drove your motors from a 5 volt supply?
@ Sun, 2011-08-07 05:22
an interlock circuit will
an interlock circuit will prevent a short in your H bridge.