CONTENTS I. Mechanics 1. Necessary tools Mechanical preparations 2.1. Motorpinion 2.2. Table-tennis ball 2.3. Axles 2.4. Wheelsenors II. Electronics Soldering instructions 3.1. Tip, solder and temperature 3.2. Preparing parts 3.3. Soldering parts 3.4 De-soldering Electronic assemly 4.1. Assembly RS232-Infrared-Transceiver 4.2. Optional USB-Infrared-Transceivers 4.3.
Page 4
6. Trouble shooting 6.1. Failure of RS232-IR-Transceiver ! 6.1.1. Activated key and displayed symbol do not match 6.1.2. The Terminal-Programm does not display any symbol 6.1.3. Still not working 6.2. USB-Infrared-Tranceiver does not work 6.3. Back-LEDs (D15,D16) glimmen nach dem Einschalten nicht! 6.3.1.
Page 5
III. Software Software installation and initial steps 8.1. WINDOWS 8.1.1 Installation Flash - the ASURO-Programmer-Tool 8.1.2 Installation of the editor and compiler 8.1.3. Example programs 8.2. LINUX 8.2.1. Installation Flash - the ASURO-Programmer-Tool 8.2.2. Compiler 8.3. Working with Flash 8.4. Flash failures 8.5.
Part I. Mechanics 1. Necessary tools In order to build the ASURO we need – apart from the kit – the following tools: • A „third hand“ • Stanley-Knife • Small hammer • Sandpaper (for fi ne work, Nr. 240) •...
Mechanics 2. Mechanical Preparations Completeness of the kit must be checked fi rst. A parts list in appendix A has been provided as a checklist. Before doing any electronic artwork, we must however do some mechanical preparations. So let’s start working. 2.1.
Mechanics 2.3. Axles Axles are manufactured from a brass rod. Two pairs of axles are needed, each with a length of 24.5 mm and 42.0 mm respectively. These axes are suplied in correct length with this kit. 2.4. Wheel sensors The odometer, consisting of a light emitting diode and a phototransistor, looks forward to the black and white markers on the 50/10 cogwheel.
Part II. Electronics 3. Soldering instructions ASURO has been designed with wired parts (in contrast to the much smaller surface mounted devices). Fig. demonstrates the smallest available package for the ASURO processor IC and the wired device we have incorporated. The chip inside these devices however is the same! Although soldering wired devices is much more comfortable and easier, especially untrained persons have to consider some precautions.
Electronics DANGEROUS END ! Fig. 3.2.: Basics for soldering While soldering, some smoke will be generated which may cause damage to your health. Avoid breathing gases or work under a cooker hood. Using solder for non-electronic use and using resins may destroy components. 3.2.
Electronics Fig. 3.3 : Parts with bended legs A. Part B. Leg, solder pad, and bending area have to be heated simultaneously C. Solder must fl ow into the drilling hole D. Solder E. Round bending area without edges F. Soldering tip G.
Electronics Bad soldering contacts may be recognized by ball-shaped slugs of solder around a pad or a mat surface (for lead-less solder the surface will even be extremely mat) and must be re-soldered. To insert sockets and other parts for horizontal mounting on the PCB you may use the following trick: First of all you just solder one leg of the part.
Electronics 4. Electronic assembly Did you read the soldering instructions? Really? Well OK, let’s go! 4.1. Assembling the RS232 infrared-transceiver • IC1: Initially insert the 8-pole socket. The polarity mark of the (slightly asymmetrical) socket must correspond to the mark in the accompanying symbol on the PCB. •...
Page 14
Electronics fi g. 4.1.: Assembled IR-Transceiver When the RS-232-IR-transceiver is ready assembled with the parts it will look like the above picture.
Electronics 4.2. Assembled USB IR-transceiver Fig. 4.2.: USB Infrared-Transceiver Fig. 4.3.: Component side USB Infrared-Transceiver Fig. 4.4.: Bottom side USB Infrared-Transceiver...
Electronics 4.3. Inserting parts in the ASURO-PCB The two longer axles, which will be needed for the second gear section are to be soldered or glued at the bottom-side of the PCB. Soldering is the best option, it hardens much faster than gluing and you always can easily correct it afterwards when necessary.
Page 17
Electronics Electronics Fig. 4.2: Inserting parts view of upper-side to the main ASURO-PCB The following inserting sequence may be used as a guideline: • IC1: at fi rst insert only the socket (either one Dual in line 28 pole-socket or two Dual in line 14 pole-sockets).
Page 19
Electronics Three more parts will be needed (which will be used to follow a line), but they will be placed at the bottom side of the PCB and have to soldered from the upper side (see fi g. 4.5): • T9, T10: SFH300, Phototransistor 5 mm;...
Electronics 4.4. Attachment of the motors After completing the insertion of the parts on the ASURO-PCB, we must supply the motors with cabling and attach these parts temporarely for some tests. To supply electrical energy to the motor, we need 70 mm red and black wire for each terminal. These four wires for two motors have to be stripped at both ends for around 4 mm.
Electronics 5. Preparation for operation After completing the assembly we will start moving the robot. But fi rst we will have to fi nd and eliminate the errors we could have made in the previous phase, without destroying any parts. 5.1.
USB extension cable. Now a message will apear “NEW HARWARE WAS FOUND”; AREXX ASURO USB-IR-TRANSCEIVER Now you can install the USB driver from the ASURO CD. When the driver is not detected automatically you can select it from the CD manualy from CD\windows\USB Driver, (Administrator rigths are necesary for this operation).
Electronics 5.2.2 Linux The following operational check is limited to the USB Infrared-Tranceiver and LINUX software. First of all the IR-Transceiver must be checked, as it will be needed for the next step: the selftest of the system. For this test connect the IR-Transceiver to a free USB port of your PC by a USB extension cable.
Electronics 5.3. ASURO operation Caution: The processor (IC1) is not to be inserted yet! Now be careful and turn the main switch ON. Both back-LEDs (D15, D16) should be glowing dimly. If they do not glow dimly, pleasy switch off the system immediately and continue reading in chapter 6.3.
Electronics Now insert the Jumper (J1) for recheargable devices. The polarity marks of the ICs must align with the marks of the sockets and the marks on the PCB. The processor has been designed to do a selftest and it will check all components on power up. Just to avoid any diffi culties in this phase, you are advised to read the next chapter completely before switching power ON and then return to this chapter.
Electronics 5.3.3. Switches ASURO is immobile and all displays are dark. That is a good omen! Now we are ready to check the switches for about 15 seconds. Just hit the switches, to see if something happens. The result should be: Status-LED (D12) is switched on green →...
Electronics If an optical connection between ASURO and the Infrared-Transceiver has been arranged (which requires a maximal distance of ca. 50 cm), the terminal program will show up a symbol ‘T’ regularly or alternatively the button you may have activated at the PC’s keyboard (as it has been transmitted by the transceiver), followed by the symbol next in the alphabet, eg.: Key “e”...
Electronics 6. Error tracing 6.1. Failure of the RS232-IR-transceiver 6.1.1. Activated key and displayed symbol do not match Calibrate Trimmer TR1 until activated key and displayed symbol do match. 6.1.2. The terminal program does not display any symbol Has the timer-IC (IC1) been inserted and has it been inserted correctly polarized (the mark must point to the three diodes) ? Take any infrared remote control of a HIFI- or video-equipment (videorecorder, TV, etc) and point it to the IR-transceiver, pressing a few keys.
Electronics 6.3.2. Only one of both back-LEDs is glowing Did you insert the diodes (rose- or red-colored), D13 (left) ,D14 (right), and the phototransistors (transparent or black case) T11 (left), T12 (right) at the correct position and with the correct polarisation? Check the value for resistors R18, R19 (left) and R20, R21 (right)? 4,7KΩ...
Electronics 6.4.3. Left back-LED D15 does not work Check polarisation of LED D15. Check resistors R19, R18. 1KΩ (brown, black, red, gold) 4,7KΩ (yellow, violet, red, gold) A simple check may be done the following way: remove the processor (IC1) and connect by wire Pin7 (VCC) and Pin24 (left back-LED will be activated red).
Electronics 6.6.2. The display reacts as if switches have been interchanged Resistors to the switches have been interchanged Check R24, R25, R26, R27, R28, R29, R30, R32 as well! 1KΩ (brown, black, black, brown, brown) 2KΩ (red, black, black, brown, brown) 8,2KΩ...
Electronics 6.8. One motor does not move 6.8.1. Both motors do not move Check polarity and position of IC3. 6.8.2. The left motor does not move or only in one direction In this case the complete motor bridge, consisting of transistors T1, T2, T3, T4 (did you insert the correct transistors at the correct positions?), the diodes D1, D2, D3, D4 (polarity!) and resistors R1, R2, R3, R4.
Electronics 6.9.3. Things still do not work well Check polarity of C8. 220µF/ at least 10V If transfer of data between PC and ASURO is malfunctioning again and again, re-adjust trimmer TR1 in the transceiver. Instant and bicomponent glues are suspected to cause irritant and allergic reactions at skin exposure.
7. Final adjustments Grease the axles slightly. Place the cogwheels with its fi ne black and white markings onto the short axles. The tires combined with the cogwheels are now placed onto the long axles and secured by a locking ring. Move the motor, which has been fi xed temporarely, carefully until it has been adjusted properly, the cogwheels fi t together properly and the transmission system runs smoothly.
PART III. Software 8. Software installation and initial steps Insert the ASURO CD. When all is OK it will start automaticaly otherwise open it with windows explorer. After the language selection you will fi nd all the programs you need for the ASURO under the software menu.
Page 36
Software Now this screen will show up: Click [I Agree] This screen appears: Click [Next] ASURO - 36 -...
Page 37
Software The next screen appears: Click [Install] and the next screen appears: Wait… ASURO - 37 -...
Page 38
Software …till the programmers Notepad 2 (PN2) editor with the README.txt screen appears. Close the screen ‘programmers notepad 2’. On the DESKTOP the ‘programmers notepad 2’ Symbol appears: The program editor and the compiler are installed now. ASURO - 38 -...
Software 8.1.3. Copying the example programs from CD to the harddisk. Copy the folder ‘ASURO_src’ from the ASURO CD to the hard disk (put it in a folder something like this: ‘C:\ASURO_src’). When the data source is secured, click with the right mouse button on the fi le, go to properties and deactivate the security.
Page 40
Software Select on the rigth side ‘C/C++’. ‘C/C++’ is selected. Click [Add] (…to insert a new tool) ASURO - 40 -...
Page 41
Software The window ‘New Tool’ appears. Type the following or select it with the Browse-button Name: make Command: C:\ASURO_src\FirstTry\Test-all.bat Folder: C:\ASURO_src\FirstTry Click [OK] A new PN2-tool with the name “make” is now available in the tools main menu. (When we activate this tool, it will run a batch fi le with the name Test-all.bat, now the compiled data will be placed in the folder C:\ASURO_src\FirstTry).
Page 42
Software Setup a clean fi le In the program editor menu. In the main menu “Tools” again “Options” and then select the “C/C++” again: Click [Add] to add a new tool: ASURO - 42 -...
Page 43
Software The window ‘New Tool’ appears; Type the folowing or select it with the Browse-button Name: clean Command: C:\ASURO_src\FirstTry\Test-clean.bat Folder: C:\ASURO_src\FirstTry Click [OK] A new PN2-tool with the name “clean” is now available in the tools main menu. (When we activate this tool, it will run a batch fi le with the name Test-clean.bat, now the compiled data which was placed in the folder C:\ASURO_src\FirstTry) will be removed.
Page 44
Software In the options-screen, under tools, you will now fi nd the make and clean fi les which we have made in the previous steps. Click [OK] ASURO - 44 -...
Page 45
Software Just for try we will open the fi le ’C:\ASURO_src\FirstTry\test.c’ : Click [Open]. ASURO - 45 -...
Page 46
Software File test.c will be opened. When you choose tools… …you will fi nd the new tools make and clean in the menu bar. Click on make. ASURO - 46 -...
Page 47
Software The fi le test.c (together with asuro.c) will be compiled now… …and when the program does not contains any mistakes (what could be expected, because we just loaded an example program), on the bottom this message will appear: Errors: none. What happened? From the fi le test.c (and asuro.c) a new fi le test.hex was generated.
Page 48
Software The make fi le in our example program is written in a way that a fi le with the name test.c will be compiled together with asuro.c (which contains some pre defi ned functions) and create a new .hex-fi le. This fi le can be loaded (fl ashed) into the ASURO memory. Attention! This means that - as long you do not change the make fi le and you only copy it - you should always name your own program test.c .
Page 49
Software When you open it.… …you will see all the generated data fi les… (Click [Cancel]) …and after you run the “clean“ command..… ASURO - 49 -...
Page 50
Software …you will see… …that a lot of the generated data fi les are removed. What did happen? The menu input “clean” calls for the batch fi le Test-clean.bat. Make started this with the parameter “clean”. Now the input in the make fi le is executed in the name of clean and all data fi les which are not necessarry anymore will be removed.
Software 8.2. LINUX For the software installation you need root rights. If you do not have this log out and log in again as root or open a shell and demand the root with ‘su’. 8.2.1 Flash - The ASURO-programming-tool Start the program from the CD software menu and copy the two fl ash tools “asurofl ash”...
Software 8.2.2 Compiler To instal the Gnu-Compilers for AVR-Processors insert the ASURO-CDROM choose from the folder “/Linux/Compiler/” the folowing: 1. avr-binutils-..rpm 2. avr-gcc-..rpm 3. avr-libc-..rpm The Installation is quite simple! Just give the command: rpm -i <paket>.rpm in your root directory.
Software 8.3. Flash - The ASURO-programming-tool In this step we will need the Flash-Program (see fi g. 8.3). Fig. 8.3.: Flash-Tools for Windows and LINUX) Start the program and select the interface in which you have plugged the IR-Transceiver. Select Test.hex from directory C:\Own fi les\ASURO_src\FirstTry.
Software 8.4. Flash failures The following errors may occor while fl ashing: “c” Checksum Error. ASURO has received some irregular signals. Signals may have been disturbed by other optical sources, such as fl uorescent lights, or have been interrupted shortly by movements. “t”...
Page 55
Software If the compiler displays another message, you will have to trace the error by analysing the source code. It is a good idea to look at the fi rst line in the source, in which errors have been reported. The editor displays the line number in the source in the left bottom corner of the display window.
9. C for ASURO This chapter is devoted to the programming language C, but explanation will be limited to the elements which are needed to control the ASURO system. Obviously the explanation is not a complete C-manual, for which other literature may be found on the market C has been chosen for its widespread standard and because a C-Compiler is available for almost every processor.
C for ASURO If we want to place a comment between programming lines, the set of comment words or lines starts with “/*” and ends with “*/ ”. A single line may also be defi ned to be a comment by starting the line with “//“...
Page 58
C for ASURO Declaration of variables may be provided as global variable outside the main()-function or as a local variable inside the main()-function. Global variables will be valid in the complete program area. Local variables will be valid inside the main()-function or any other function only. They will be valid for the programming code inside the function and they will be invalid outside the function.
C for ASURO 9.1.3. Compiler directives You may have wondered about the fi rst program line #include “asuro.h”. This #include-directive defi nes an inclusion of an external source code into your program and orders the compiler to include the textfi le in the compiler sequence. Our include-fi le contains some functions, which will be needed for robot operations.
Page 60
C for ASURO If the program should be able to choose one option out of several alternatives, you may use several “else if”-constructs. if (Condition1) Command_block_1 else if (Condition2) Command_block_2 else if (Condition3) Command_block_3 else if (Condition4) Command_block_4 else Command_block_5 The following conditional structures may be used: Explanation Operator...
C for ASURO 9.1.5. Loops Loops are to be used to repeat command execution. In a “while”-loop a condition is checked every time the loop is passed. If the condition is true the command block will be executed. The condition is checked again until it turns to false. At a false condition the program is continued at the fi rst command following the condition block.
9. C für ASURO “while(1)” is equivalent to “for(;;)”, and both are eternal loops as the abort condition (in this case a value 0) will never be reached. Another loop sequence is a “do”-loop command block while( condition); In contrast to a “while”-loop the condition will be checked after the command block. This programming sequence forces the command block to be executed at least one time.
Page 63
C for ASURO Now after some theory on data types and functions we would like to build a simple function, multiplicating two 8-bit numbers and returning the result. int Mult (char a, char b) /* Function returns an int-value, is called Mult, and uses two char values for input */ // Begin function int c;...
C for ASURO 9.1.7. Pointers and vectors Pointers and vectors will be described to an extent, needed for the ASURO-operations. If we need to track data from the line tracing sensors or odometric sensors we will need vectors. Their declaration is rather simple: int lineData[2];...
C for ASURO To receive characters, ASURO uses a function SerRead (). The fi rst parameter contains a variable in which the received characters are to be stored. The second parameter defi nes how many characters will be received and the third parameter defi nes a timeout: if within a certain time period (a number of processor clock cycles) no data has been received the SerRead () -function will be aborted.
C for ASURO 9.2.1. void Init(void) This function will reset the microprocessor to its initial state and must always be executed at the beginning of a program. If the function is missing, the processor does not even know, what to do with its terminals.
C for ASURO 9.2.3. void FrontLED (unsigned char status) The Front-LED (D11) will be switched ON or OFF. Valid parameters are ON respectively OFF Example: The front-LED will be switched on by: FrontLED(ON); 9.2.4. void BackLED (unsigned char left, unsigned char right) The Back-LEDs (D15 and D16) will be switched ON or OFF.
C for ASURO 9.2.7. void MotorSpeed (unsigned char left_speed, unsigned char right_speed) This function controls the motor speed for both engines. Maximum speed is 255 (unsigned char). The motor will start rotating at a value of around 60, depending on mechanical conditions. The parameter value in fact controls motor power and the rotational speed also depends on other factors like friction or inclination in slopes.
C for ASURO Example: The string „Go Ahead“ should be received and we want to be sure all characters do have arrived at the ASURO before we continue operation. #include “asuro.h” int main(void) { char data[8]; // allocate storage Init(); SerRead (data,8,0);...
C for ASURO Of course you would like an example as a complete program: #include “asuro.h” // Line tracing the easiest way int main(void) { unsigned int data[2]; // Allocate storage Init(); FrontLED(ON); // Switch ON line trace illumination MotorDir(FWD,FWD); // Both engines go ahead while(1){ // Eternal loop, ASURO should follow...
C for ASURO 9.2.12. unsigned char PollSwitch (void) This function scans the position of switches (K1-K6) and returns one byte, containing information, which switches have been activated. Switch 1 will set the fi rst bit number 5, switch 2 will set the second bit, ...
Part IV. Appendices A. Partslist Besides a table-tennis ball the following parts are needed to build an ASURO: 1x Printed circuit board ASURO 2x Motors Type Igarashi 2025-02 1x Diode 1N4001 8x Diodes 1N4148 4x Transistors BC 327/40 or BC 328/40 4x Transistors BC 337/40 or BC 338/40 1x Integrated circuit CD 4081BE 1x Processor ATmega 8L-8PC (preprogrammed)
Appendices A. Partlist 4x Cable binder 1x Cable binder releaseable 2x Rubber tires 38mm 2x Messing shaft 42mm long 3mm diameter, 2x Messing shaft 24,5mm lang, 3mm diameter ca. 15 cm wire red 0,14mm_ ca. 15 cm wire black 0,14mm_ 2x Encoder sticker (see 2.4) The additional RS-232-IR-transceiver will be equipped with the following parts: 1x Printed circuit board IR-RS232-transceiver...
Need help?
Do you have a question about the DLR ASURO and is the answer not in the manual?
Questions and answers