Difference between revisions of "HANcoder/Training Material/Highwaysurfer"
(→Software) |
|||
(24 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<!--T:1--> | <!--T:1--> | ||
+ | [[file:Components_diagram.jpg|right|300px|Click to enlarge image]] | ||
'''General overview'''<br> | '''General overview'''<br> | ||
A car runs on a conveyor belt and can run on three different lanes. <br> | A car runs on a conveyor belt and can run on three different lanes. <br> | ||
Line 15: | Line 16: | ||
the housing components, the lane change mechanism and the conveyer belt. <br> | the housing components, the lane change mechanism and the conveyer belt. <br> | ||
− | + | [[file:Electric_diagram.jpg|right|300px|Click to enlarge image]] | |
'''''Electrical:'''''<br> | '''''Electrical:'''''<br> | ||
The electrical components are connected by soldering and screw terminals.<br> | The electrical components are connected by soldering and screw terminals.<br> | ||
Line 23: | Line 24: | ||
stepper-motor and the ultrasonic sensors.<br> | stepper-motor and the ultrasonic sensors.<br> | ||
− | + | [[file:Software_diagram.jpg|right|300px|Click to enlarge image]] | |
'''''Software:'''''<br> | '''''Software:'''''<br> | ||
The software is also divided into 3 separate systems: the input, algorithm and output.<br> | The software is also divided into 3 separate systems: the input, algorithm and output.<br> | ||
Line 29: | Line 30: | ||
The algorithm decides what happens with the belt. When there is an obstacle the car will switch lanes,<br> | The algorithm decides what happens with the belt. When there is an obstacle the car will switch lanes,<br> | ||
if all 3 lanes are blocked the belt will stop. | if all 3 lanes are blocked the belt will stop. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
{| | {| | ||
Line 36: | Line 51: | ||
==Introduction== | ==Introduction== | ||
− | The HAN-AR have two model based development tools, HANcoder and HANtune, that they would like to promote. In order to do this a new demonstration model was required. This is what the project team '''Highway Surfer''' has created. The model will showcase the abilities of the tools and will act as an eye catcher at tech fairs and conferences that the HAN-AR attends. With the help of this document people who are interested in recreating this project or start their own projects will be able to see what the steps involved are, the materials required and the capabilities of the tools, [[HANcoder]] and [[HANtune]]. | + | The HAN-AR have two model based development tools, HANcoder and HANtune, that they would like to promote. In order to do this a new demonstration model was required.<br> |
+ | This is what the project team '''Highway Surfer''' has created. <br> | ||
+ | The model will showcase the abilities of the tools and will act as an eye catcher at tech fairs and conferences that the HAN-AR attends.<br> | ||
+ | With the help of this document people who are interested in recreating this project or start their own projects will be able to see what the steps involved are,<br> | ||
+ | the materials required and the capabilities of the tools, [[HANcoder]] and [[HANtune]]. | ||
This project was started with the help a template. This template can be downloaded from the following link: | This project was started with the help a template. This template can be downloaded from the following link: | ||
Line 43: | Line 62: | ||
− | On this wikipage, you can find the building process for the mechanical parts, the wiring and other processes for the electronics | + | On this wikipage, you can find the building process for the mechanical parts, the wiring and other processes for the electronics and the logic for building the software algorithm.<br> To make it easy for the consumer, we have an easy to understand order list with relevant links. |
==Materials Required== | ==Materials Required== | ||
− | |||
===Hardware parts=== | ===Hardware parts=== | ||
Line 80: | Line 98: | ||
:* [https://www.conrad.nl/nl/bourns-mf-rht200-0-ptc-zekering-drempelstroom-ih-2-a-16-v-l-x-b-x-h-216-x-94-x-3-mm-1-stuks-1055672.html Mini fuse 2 [A]] | :* [https://www.conrad.nl/nl/bourns-mf-rht200-0-ptc-zekering-drempelstroom-ih-2-a-16-v-l-x-b-x-h-216-x-94-x-3-mm-1-stuks-1055672.html Mini fuse 2 [A]] | ||
:* [https://www.conrad.nl/nl/eska-lp30-500f-ptc-zekering-drempelstroom-ih-5-a-30-v-l-x-b-x-h-144-x-30-x-356-mm-1-stuks-525059.html Mini fuse 5 [A]] | :* [https://www.conrad.nl/nl/eska-lp30-500f-ptc-zekering-drempelstroom-ih-5-a-30-v-l-x-b-x-h-144-x-30-x-356-mm-1-stuks-525059.html Mini fuse 5 [A]] | ||
− | :* [https://www.conrad.nl/nl/royalohm-mf0w4ff1002a50-metaalfilmweerstand-10-k-axiaal-bedraad-0207-025-w-1-stuks-1089968.html Resistor 10 [ | + | :* [https://www.conrad.nl/nl/royalohm-mf0w4ff1002a50-metaalfilmweerstand-10-k-axiaal-bedraad-0207-025-w-1-stuks-1089968.html Resistor 10 [KΩ]] |
− | :* [https://www.conrad.nl/nl/royalohm-mf0w4ff1001a50-metaalfilmweerstand-1-k-axiaal-bedraad-0207-025-w-1-stuks-1089862.html Resistor 1 [ | + | :* [https://www.conrad.nl/nl/royalohm-mf0w4ff1001a50-metaalfilmweerstand-1-k-axiaal-bedraad-0207-025-w-1-stuks-1089862.html Resistor 1 [KΩ]] |
− | :* | + | :* Capacitor 0.33 [nF] |
− | :* | + | :* Capacitor 4,7 [nF] |
− | :* | + | :* Capacitor 22 [nF] |
:* [https://www.conrad.nl/nl/panjit-1n4746a-g-zenerdiode-behuizingssoort-halfgeleider-do-41g-zenerspanning-18-v-1305028.html Zener diode 18 [V]] | :* [https://www.conrad.nl/nl/panjit-1n4746a-g-zenerdiode-behuizingssoort-halfgeleider-do-41g-zenerspanning-18-v-1305028.html Zener diode 18 [V]] | ||
− | |||
===Sensors=== | ===Sensors=== | ||
:* [https://www.antratek.com/ultrasonic-sensor-hc-sr04 3x ultrasonic sensor] | :* [https://www.antratek.com/ultrasonic-sensor-hc-sr04 3x ultrasonic sensor] | ||
− | :* [https://www.conrad.nl/nl/vishay-precisiepotmeter-10-slagen-mono-2-w-10-k-1-stuks-429309.html | + | :* [https://www.conrad.nl/nl/vishay-precisiepotmeter-10-slagen-mono-2-w-10-k-1-stuks-429309.html Potentiometer] |
:* [http://www.jfetech.nl/epages/080402.sf/nl_NL/?ObjectPath=/Shops/080402/Products/1x VRsensor] | :* [http://www.jfetech.nl/epages/080402.sf/nl_NL/?ObjectPath=/Shops/080402/Products/1x VRsensor] | ||
Line 100: | Line 117: | ||
===Software=== | ===Software=== | ||
− | :* [https://nl.mathworks.com/products/simulink.html MatLab | + | :* [https://nl.mathworks.com/products/simulink.html MatLab Simulink®] |
:* HANcoder | :* HANcoder | ||
:* HANtune | :* HANtune | ||
Line 123: | Line 140: | ||
====Cutting==== | ====Cutting==== | ||
− | To get the right dimensions for this DEMO a LaserPro X500 was used | + | To get the right dimensions for the wooden this DEMO a LaserPro X500 was used.<br> |
− | The Solid Works drawings of all the wooden parts are send to a device that runs 'Corel Draw X8' | + | The Solid Works drawings of all the wooden parts are send to a device that runs 'Corel Draw X8'.<br> |
− | The process can be seen in | + | The process can be seen in the pictures below. We chose this option to get a cleaner finish. Of course, there are other ways to get the panels to the right dimensions. |
+ | <table border="1"> | ||
+ | <table align="right"> | ||
+ | <tr> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>[[file:LaserPro_X500.jpg|200px|Click to enlarge image]]</td> | ||
+ | <td>[[file:Corel_Draw_X8.jpg|200px|Click to enlarge image]]</td> | ||
+ | <td>[[file:Laser_cutting.jpg|200px|Click to enlarge image]]</td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
− | |||
====L-profile’s and drilling==== | ====L-profile’s and drilling==== | ||
− | The following L-profiles need to be cut [[file:L_profile.jpg|250px|right| | + | The following L-profiles need to be cut [[file:L_profile.jpg|250px|right|Click to enlarge image]] |
:* 2x540mm 5 holes per plane | :* 2x540mm 5 holes per plane | ||
:* 4x100mm 2 holes per plane | :* 4x100mm 2 holes per plane | ||
:* 2x460mm 3 holes per plane | :* 2x460mm 3 holes per plane | ||
:* 10x50mm 2 holes per plane | :* 10x50mm 2 holes per plane | ||
− | Some holes need to be drilled in the L-profiles to match the bolts, for this DEMO 5mm. Be aware that the holes in the two planes are not on top of each other | + | Some holes need to be drilled in the L-profiles to match the bolts, for this DEMO 5mm. Be aware that the holes in the two planes are not on top of each other. |
====Assembling==== | ====Assembling==== | ||
− | [[file:Assembly_L-profile.jpg|250px|right| | + | [[file:Assembly_L-profile.jpg|250px|right|Click to enlarge image]] |
Place the plates with the L-profile against each other and mark the holes.<br> | Place the plates with the L-profile against each other and mark the holes.<br> | ||
− | Do not forget | + | Do not forget which L-profile you use, every profile is slightly different even with the best measurements. <br> |
Continue by drilling the marked holes in the wood and assemble the parts with bolts and nuts. Start from the bottom and work all the way up. | Continue by drilling the marked holes in the wood and assemble the parts with bolts and nuts. Start from the bottom and work all the way up. | ||
Line 154: | Line 186: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td>[[file:Exploded view roller tensioning side.jpg|300px| | + | <td>[[file:Exploded view roller tensioning side.jpg|300px|Click to enlarge image]]</td> |
− | <td>[[file:Exploded view roller powerd side.jpg|300px| | + | <td>[[file:Exploded view roller powerd side.jpg|300px|Click to enlarge image]]</td> |
</tr> | </tr> | ||
</table> | </table> | ||
Line 177: | Line 209: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td>[[file:Roller-end_for_powered_side.jpg|300x200px| | + | <td>[[file:Roller-end_for_powered_side.jpg|300x200px|Click to enlarge image]]</td> |
− | <td>[[file:PVC_EPDM.jpg|300x200px| | + | <td>[[file:PVC_EPDM.jpg|300x200px|Click to enlarge image]]</td> |
</tr> | </tr> | ||
</table> | </table> | ||
Line 190: | Line 222: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td>[[file:Drill for roller-blocks.jpg|300x200px| | + | <td>[[file:Drill for roller-blocks.jpg|300x200px|Click to enlarge image]]</td> |
− | <td>[[file:Bearingblock unmachined.jpg|300x200px| | + | <td>[[file:Bearingblock unmachined.jpg|300x200px|Click to enlarge image]]</td> |
− | <td>[[file:Bearingblock_machining.jpg|300x200px| | + | <td>[[file:Bearingblock_machining.jpg|300x200px|Click to enlarge image]]</td> |
</tr> | </tr> | ||
</table> | </table> | ||
Line 209: | Line 241: | ||
===Conveyor belt=== | ===Conveyor belt=== | ||
− | [[file:Conveyerbelt.jpg|250px|right| | + | [[file:Conveyerbelt.jpg|250px|right|Click to enlarge image]] |
Items needed: | Items needed: | ||
:* 1500*450 [mm] strong and bendable fiber (this demo: 80%PVC and 20% polyester) | :* 1500*450 [mm] strong and bendable fiber (this demo: 80%PVC and 20% polyester) | ||
Line 228: | Line 260: | ||
=====''Ultrasonic sensor setup''===== | =====''Ultrasonic sensor setup''===== | ||
A piece of sheet metal (500x50 [mm]) is needed to create the bracket for the ultrasonic sensors. This bracket will be clammed on between the bottom panel and the 20x20 [mm] profile.<br> | A piece of sheet metal (500x50 [mm]) is needed to create the bracket for the ultrasonic sensors. This bracket will be clammed on between the bottom panel and the 20x20 [mm] profile.<br> | ||
− | The ultrasonic sensors are screwed on the bracket and the wiring goes thru the slot that is created by the piano hinges up top. | + | The ultrasonic sensors are screwed on the bracket and the wiring goes thru the slot that is created by the piano hinges up top. |
<table border="1"> | <table border="1"> | ||
<table align="right"> | <table align="right"> | ||
Line 236: | Line 268: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td>[[file:Ultrasonic_sensor_bracket.jpg|250x200px| | + | <td>[[file:Ultrasonic_sensor_bracket.jpg|250x200px|Click to enlarge image]]</td> |
− | <td>[[file:Ultrasonic sensor bracket complete.jpg|750px| | + | <td>[[file:Ultrasonic sensor bracket complete.jpg|750px|Click to enlarge image]]</td> |
</tr> | </tr> | ||
</table> | </table> | ||
Line 275: | Line 307: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td>[[file:20x20 profile.jpg|250x200px| | + | <td>[[file:20x20 profile.jpg|250x200px|Click to enlarge image]]</td> |
− | <td>[[file:Bridge_cover_assembly.png|250x140px| | + | <td>[[file:Bridge_cover_assembly.png|250x140px|Click to enlarge image]]</td> |
</tr> | </tr> | ||
</table> | </table> | ||
Use the same aluminum profiles as the conveyor belt box to attach all the panels to each other. <br> | Use the same aluminum profiles as the conveyor belt box to attach all the panels to each other. <br> | ||
− | On top of the front panel the piano hinges are mounted to create the cover. | + | On top of the front panel the piano hinges are mounted to create the cover. |
To mount the lane change mechanism a bracket is needed. The dimensions of the bracket are located on the drawings.<br> | To mount the lane change mechanism a bracket is needed. The dimensions of the bracket are located on the drawings.<br> | ||
The bracket is laser cut. The slots are used to tension the belt.<br> | The bracket is laser cut. The slots are used to tension the belt.<br> | ||
On the other side, there is a hole for the potentiometer. | On the other side, there is a hole for the potentiometer. | ||
− | For the lane change mechanism, the 2 tooth wheels are fitted, one on the potentiometer that reads the position of the car and the other one on the | + | For the lane change mechanism, the 2 tooth wheels are fitted, one on the potentiometer that reads the position of the car and the other one on the stepper motor that creates the linear movement.<br> |
− | The custom bushings are needed to get the tooth wheels fitted on the | + | The custom bushings are needed to get the tooth wheels fitted on the stepper motor and potentiometer. <br> |
On the bottom of the bridge a switch is mounted to turn on the demo. | On the bottom of the bridge a switch is mounted to turn on the demo. | ||
<table border="1"> | <table border="1"> | ||
Line 296: | Line 328: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td>[[file:Lane_change_mechanism_bracket.jpg|250x200px| | + | <td>[[file:Lane_change_mechanism_bracket.jpg|250x200px|Click to enlarge image]]</td> |
− | <td>[[file:Top_view_potentiometer.jpg|250x120px| | + | <td>[[file:Top_view_potentiometer.jpg|250x120px|Click to enlarge image]]</td> |
</tr> | </tr> | ||
</table> | </table> | ||
− | The custom bushings are needed to get the tooth wheels fitted on the | + | The custom bushings are needed to get the tooth wheels fitted on the stepper motor and potentiometer. <br> |
On the bottom of the bridge a switch is mounted to turn on the demo. | On the bottom of the bridge a switch is mounted to turn on the demo. | ||
Line 319: | Line 351: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td>[[file:Exploded_view_lane_change_mechanism.jpg|600x150px| | + | <td>[[file:Exploded_view_lane_change_mechanism.jpg|600x150px|Click to enlarge image]]</td> |
− | <td>[[file:Treaded bushing.jpg|600x150px| | + | <td>[[file:Treaded bushing.jpg|600x150px|Click to enlarge image]]</td> |
− | <td>[[file:Chain_link_clamps.jpg|600x150px| | + | <td>[[file:Chain_link_clamps.jpg|600x150px|Click to enlarge image]]</td> |
− | <td>[[file:Assembelt_belt-clamp.jpg|600x150px| | + | <td>[[file:Assembelt_belt-clamp.jpg|600x150px|Click to enlarge image]]</td> |
− | <td>[[file:Car construction.jpg|600x150px| | + | <td>[[file:Car construction.jpg|600x150px|Click to enlarge]]</td> |
</tr> | </tr> | ||
</table> | </table> | ||
<br> | <br> | ||
+ | |||
Line 338: | Line 371: | ||
==Electronical== | ==Electronical== | ||
− | In this chapter, the electronical building process is explained. In the first subchapter connecting all the sensors and actuators to the Olimexino micro controller. The second subchapter contains the installation of the electronics in the demo. | + | In this chapter, the electronical building process is explained. In the first subchapter connecting all the sensors and actuators to the Olimexino micro controller.<br> |
+ | The second subchapter contains the installation of the electronics in the demo. | ||
===The electronic circuit=== | ===The electronic circuit=== | ||
− | This is the final version of our electric scheme. Each individual component will be ran down separately validating the choices and verifying the values of resistances and capacitors. Each of the components is are linked in series with the power output of the transformer or 7805. | + | This is the final version of our electric scheme. Each individual component will be ran down separately validating the choices and verifying the values of resistances and capacitors. <br> Each of the components is are linked in series with the power output of the transformer or 7805. |
+ | ====Power supply==== | ||
+ | Most of the components work on 12V. To get the 12V a 60 Hz transformer is used. Reasons for this were the low costs compared to a battery.<br> | ||
+ | To power the ultrasonic sensor and the DNF10 sensor we used a 7805 voltage regulator because it’s the cheapest option available. | ||
+ | |||
+ | ====The switch==== | ||
+ | [[file:Switch.jpg|200x150px|right|Click to enlarge image]] | ||
+ | An on/off button is integrated on the ground side of our circuit. The electric scheme shows a button plus coil parallel and a relay powered by the coil in series. A regular button with relay can’t handle the electricity so it had to be powered by a coil. Most switches have this built in so the component only needs to be put in series. | ||
+ | |||
+ | |||
− | |||
− | |||
− | |||
− | |||
====The stepper motor==== | ====The stepper motor==== | ||
− | The PM engine will be controlled by a | + | [[file:steppermotor.jpg|200x150px|right|Click to enlarge image]] |
− | + | The PM engine will be controlled by a motor driver, in our case the “Easy driver stepper motor driver”. The reason an H-bridge is used, is because the PM needs to be controlled in two directions. An H-bridge can change the direction by switching the poles. Another advantage of an H-bridge is that the protection for peek tensions is already built in. The H-bridge is connected twice with the microcontroller. Once for the direction, and once for the duration and speed. | |
+ | |||
====The conveyor belt motor==== | ====The conveyor belt motor==== | ||
− | The PM motor is being controlled by the | + | [[file:Conveyerbelt motor.jpg|200x150px|right|Click to enlarge image]] |
+ | The PM motor is being controlled by a H-bridge, the “Sparkfun Ardumoto - Motor Driver Shield”. <br> A H-bridge was used to protect the motor against peak tensions and make linking it more convenient. The H-bridge is connected twice with the microcontroller. <br> Once for the direction, and once for the duration and speed. | ||
+ | |||
+ | |||
====Ultrasonic sensors (SR04)==== | ====Ultrasonic sensors (SR04)==== | ||
− | The | + | [[file:Ultrasonic sensors.jpg|200x150px|right|Click to enlarge image]] |
− | To protect the circuit from voltage peaks from electromagnetic waves caused by the transformer filtering techniques are used. The filters contain one capacitor and resistance. For each resistance | + | The ultrasonic sensors are connected to the micro controller twice, once for the micro controller to trigger the sensors and for the sensor output.<br> |
− | To get the filter frequency (F<sub>c</sub>) from the ultrasonic sensor to following recommended measurement cycle(t) of 60 [ms] is used. These values are found in the specifications of the ultrasonic sensors.<br> | + | To protect the circuit from voltage peaks from electromagnetic waves caused by the transformer filtering techniques are used. <br> |
+ | The filters contain one capacitor and resistance. For each resistance 10kΩ is common. In the circuit R4=R5=R6=10kΩ.<br> | ||
+ | Also, C3=C4=C5. To determine the C values, the filter frequency need to be calculated first.<br> | ||
+ | To get the filter frequency (F<sub>c</sub>) from the ultrasonic sensor to following recommended measurement cycle(t) of 60 [ms] is used.<br> | ||
+ | These values are found in the specifications of the ultrasonic sensors.<br> | ||
− | '''F''' = ''frequency'' <br> '''F''' = 1 / t <br> '''F''' = 1 / 0,06 <br> '''F''' = 16,667 [Hz] | + | '''F''' = ''frequency'' <br> '''F''' = 1 / t <br> '''F''' = 1 / 0,06 <br> '''F''' = 16,667 [Hz] <br> |
− | ''' | + | '''x''' = ''Filterfactor'' = 50<br> |
− | '''F<sub>c</sub>''' = 1 / ( | + | '''F<sub>c</sub>''' = F * x <br> '''F<sub>c</sub>''' = 16,667 * 50 <br> '''F<sub>c</sub>''' = 833 [Hz] |
+ | |||
+ | '''F<sub>c</sub>''' = 1 / (2π * R * C) <br> '''C''' = 1 / (2π * R * F<sub>c</sub>) <br> '''C''' = 1 / (2π * 10000 * 833) = 19,1 [nF] | ||
====VR sensor and DNF10 chip==== | ====VR sensor and DNF10 chip==== | ||
− | The configuration of the chip has been given, and the values of R8, R9 and C7 are in the specifications. The configuration converts a sinus wave into a block wave. It only has one output towards the micro controller. | + | [[file:VR sensor.jpg|200x150px|right|Click to enlarge image]] |
− | The VR sensor also has a capacitor and resistance to filter. | + | The configuration of the chip has been given, and the values of R8, R9 and C7 are in the specifications.<br> |
− | To measure the frequentation coming from the VR sensor we need to know the amount of tooth on the gear it measures and its RPM. | + | The configuration converts a sinus wave into a block wave. It only has one output towards the micro controller. |
− | The RPM is identical to the RPM max of the model craft electronic motor. | + | The VR sensor also has a capacitor and resistance to filter.<br> |
+ | To measure the frequentation coming from the VR sensor we need to know the amount of tooth on the gear it measures and its RPM.<br> | ||
+ | The RPM is identical to the RPM max of the model craft electronic motor. | ||
Line 379: | Line 430: | ||
'''N''' = 70 [min-1] = 70/60 = 1,16667 [sec-1] <br> | '''N''' = 70 [min-1] = 70/60 = 1,16667 [sec-1] <br> | ||
− | '''Z''' = 44 <br> '''F''' = N * Z = 1,166667 * 44 = 51,333 [Hz] <br> '''F<sub>max</sub>''' = F * A= 51,333 * 1,5 = 76,9999 [Hz] <br> | + | '''Z''' = 44 <br> |
+ | '''F''' = N * Z = 1,166667 * 44 = 51,333 [Hz] <br> '''F<sub>max</sub>''' = F * A= 51,333 * 1,5 = 76,9999 [Hz] <br> | ||
'''F<sub>c <sub>filter</sub> </sub>''' = F<sub>max</sub> * x = 76,9999 * 50 = 2,85 [KHz] | '''F<sub>c <sub>filter</sub> </sub>''' = F<sub>max</sub> * x = 76,9999 * 50 = 2,85 [KHz] | ||
====Fuses==== | ====Fuses==== | ||
− | A 2 [A] fuse and a | + | A 2 [A] fuse and a 5 [A] fuse is needed in the system for the peak current.<br> |
+ | The 2 [A] fuse that is located under the micro controller will burn when there is more than 2 Amperes <br> | ||
+ | in the system because of the risk that the micro controller can’t handle the current. <br> | ||
+ | The 5 [A] is needed for the rest of the system that the components won’t burn through. | ||
+ | |||
+ | ====Potentiometer==== | ||
+ | [[file:Potentiometer.png|200x200px|right|Click to enlarge image]] | ||
+ | The potentiometer is connected to the microcontroller and is powered by the 5V chip. It is also filtered. <br> | ||
+ | Like all the other filters the resistance is 10 kΩ. To get the filter frequency F<sub>c</sub> from the potentiometer a frequency of 30 Hz is used. <br> | ||
+ | The actual frequency will never be close to 30 Hz because the system will need to swap lane 60 times each second. | ||
+ | |||
+ | '''F<sub>c</sub>''' = F * x = 76,9999 * 50 = 1500 [Hz]<br> | ||
+ | '''F<sub>c</sub>''' = 1 / 2π * R * C <br> | ||
+ | '''C''' = 1 / 2π * R * F<sub>c</sub> = 1 / (2π * 10000 * 1500) = 10,6 [nF] <br> | ||
+ | |||
===Installation=== | ===Installation=== | ||
− | ( | + | [[file:Electric scheme.jpg|400x300px|right|Click to enlarge image]] |
+ | Different electric schemes for each of the components are being used in this chapter. The main scheme can be found above.<br> | ||
+ | For clarification, some pictures are mirrored to make them correspond with the pictures from the back side.<br> | ||
+ | If a part is marked with red it’s not involved in the electric scheme. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====The ground and source==== | ||
+ | <table border="1"> | ||
+ | <table align="right"> | ||
+ | <tr> | ||
+ | <th>Connection diagram</th> | ||
+ | <th>Ground and source</th> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>[[file:Connection diagram.jpg|600x250px|Click to enlarge image]]</td> | ||
+ | <td>[[file:Ground and source star.jpg|600x250px|Click to enlarge image]]</td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | Every electric circuit starts with a ground and a source. So, it would only be logical to start connecting this circuit first.<br> | ||
+ | To connect all the ground and source wires we are using a star point. <br> | ||
+ | A start point is used to prevent ground loops in the system. <br> | ||
+ | Only a few ground wires from the filters are being connected before the ground star. <br> | ||
+ | This is because the electricity through these wires is so small that the chances of ground loops here are slim.<br> | ||
+ | |||
+ | The ground star has been made using a screw and bold that compresses multiple wires with spacers in between.<br> | ||
+ | This way all the wires make contact if the screw is tightened enough. | ||
+ | |||
+ | As seen in the electric scheme in between the transformer and the ground stars there are a few extra components.<br> | ||
+ | The fuse, the Zener diodes and the switch. <br> | ||
+ | Before we go in depth with each of the components there is a simple version of how everything is connected according to the main electric scheme. | ||
+ | |||
+ | |||
+ | |||
+ | ====The transformer==== | ||
+ | [[file:Transformer.png|200x250px|right|Click to enlarge image]] | ||
+ | To connect the transformer there are 5 wires that need to be connected. The first three wires are from the powerplug.<br> | ||
+ | Connect them according to the symbols on the transformer or according to the picture on the right. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====The Zener-diode==== | ||
+ | [[file:Zenerdiode.jpg|600x150px|right|Click to enlarge image]] | ||
+ | Following the source wire from the transformer, the next component is the Zener diode. This diode is there to protect the system from voltage peaks.<br> | ||
+ | It’s switched parallel directly with the transformer. Because a PCB is being used, all the connections are made with screw blocks.<br> | ||
+ | Because there was no Zener diode of 18 V available 3 Zener diodes of 6.5V are linked in series. <br> | ||
+ | The resistances of 32Ω are parallel connected because of the power which needs to be eliminated. SI (source input) and GI (ground input) are directly from the transformer,<br> | ||
+ | while SO (source output) and GO (ground output) are connected to the rest of the circuit. | ||
+ | |||
+ | ====The fuse==== | ||
+ | The fuse is just a fuse switched in series. For our design, it’s connected to the ground.<br> | ||
+ | It’s placed on a PCB. Since it’s a two-way fuse it doesn’t matter which way it is connected. | ||
+ | |||
+ | ====The switch==== | ||
+ | [[file:The_switch.jpg|600x150px|right|Click to enlarge image]] | ||
+ | The switch in the electric scheme is shown as a parallel on/off button with a coil and a relay in series.<br> | ||
+ | The on/off button and its electric coil are built into the component what is being used.<br> | ||
+ | That means the component can be switched in series like the relay.<br> | ||
+ | Just like the fuse it doesn’t matter which way it is connected. Make sure to note when the switch is on or off. | ||
+ | |||
+ | ====The PCB==== | ||
+ | PCB’s (Printed Circuit Board) are used as screw blocks to connect the wires. Screw blocks are to connect or disconnect.<br> | ||
+ | Besides that, they are very cheap and easy to apply. To connect these blocks iron wire is used and soldered with tin.<br> | ||
+ | The screw blocks are white blocks in the electric system. | ||
+ | |||
+ | ====The high frequency filters==== | ||
+ | [[file:High frequency filter.jpg|600x150px|right|Click to enlarge image]] | ||
+ | All the long wires in our system function as antenna’s that are exposed to the EMI (Electromagnetic interferance)from the transformer.<br> | ||
+ | To filter these frequencies a combination of resistances and capacitors is used. Using a PCB for these resistors and capacitors is convenient. <br> | ||
+ | The values can be found in the main electric scheme. [IO] are the inputs from the ultrasonic sensors, <br> | ||
+ | [OU] is the output of the filters from the ultrasonic sensor, <br> | ||
+ | [-] is ground and [OC] with [IC] are the respective input and output from the chip that is connected to the micro-controller. | ||
+ | |||
+ | |||
+ | |||
+ | ====The low voltage circuit==== | ||
+ | [[file:Low voltage circuit.jpg|600x150px|right|Click to enlarge image]] | ||
+ | The second PCB is mostly used to supply the components that run under 4 V instead of 12 V. These are the ultrasonic sensors and the DNF10 chip.<br> | ||
+ | The DNF chip is connected due the max 9240 specifications. The [-] screw block is connected to the ground while the [12V PS] is connected to the power source.<br> | ||
+ | The combination of the 7805 and the capacitors will create a 5 V power source on the third pin. The capacitors are connected due the specification of the manufacturer.<br> | ||
+ | The [OC] screw block is the output of the chip and is connected to the micro-controller.<br> | ||
+ | The [USPS] is the ultrasonic sensor power source and is connected to the ultrasonic sensors’ VCC.<br> | ||
+ | And at last the [IVR] is the input of the VR sensor. Be aware that the + side of this output needs to be connected to the proper side of the chip. | ||
+ | |||
+ | ====The micro-controller==== | ||
+ | [[file:Microcontroler.jpg|600x150px|right|Click to enlarge image]] | ||
+ | The microcontroller is directly connected with the ground and source stars with an extra fuse in series for protection. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
==Software== | ==Software== | ||
− | The software is split up | + | [[file:Complete_software.jpg|700x200px|right|Click to enlarge image]] |
+ | The software is split up into 3 main parts. The input, the algorithm and the output.<br> | ||
+ | Each of these can be edited in the HANcoder software by double clicking the blocks.<br> | ||
+ | In the input block the inputs of the sensors are defined.<br> | ||
+ | In combination with the Simulink blocks it is possible to translate the sensor output to an input for the algorithm.<br> | ||
+ | The algorithm is the main logic of the code. The output would then provide the actuator with information on what needs to be done. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
===Input=== | ===Input=== | ||
− | For this system, | + | The input gets data from the sensors. For this system, 3 types of sensors are needed to translate the output.<br> |
+ | 3 ultrasonic sensors, 1 potentiometer and 1 rotation speed sensor. The picture below shows how this is done using HANcoder. | ||
+ | |||
+ | ====Position Sensor==== | ||
+ | [[file:Position_sensor.jpg|500x200px|right|Click to enlarge image]] | ||
+ | From the potentiometer, we get a certain voltage. If we multiply the voltage by 1/4096 and 1.065.<br> | ||
+ | In combination with the constant we can get the position of the car. | ||
+ | |||
+ | |||
+ | ====Speed Sensor==== | ||
+ | [[file:Speed_sensor.jpg|700x200px|right|Click to enlarge image]] | ||
+ | The output of the rotation sensor is a sinus signal, but in combination with the interface chip it will be a block signal.<br> | ||
+ | With the 'timer input get' block out of the HANcoder library it is possible to get the frequency out of the block signal.<br> | ||
+ | If you multiply the frequency by: 2*Pi*0.04*(1/44) it will give the speed of the roll as an input for the algorithm. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====Ultrasonic Sensor==== | ||
+ | [[file:Ultrasonic_sensor_software.jpg|460x200px|right|Click to enlarge image]] | ||
+ | Ultrasonic sensors emit short, high-frequency sound pulses at regular intervals. <br> | ||
+ | If they strike an object, then they are reflected as echo signals to the sensor. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===Algorithm=== | ||
+ | |||
+ | In Figure 7, we can see the algorithm that deals with the car position, the lane change and the lane selection system.<br> | ||
+ | The three blocks are the most important part of the algorithm. | ||
+ | |||
+ | For detecting the position of the car, a potentiometer is used. In the input, the value from the potentiometer is transformed to meters.<br> | ||
+ | In this state flow the car position is detected by the logic. The output is a value 1, 2 or 3.<br> | ||
+ | The algorithm uses the value to determine which part of the next state flows is used. | ||
+ | <table border="1"> | ||
+ | <table align="center"> | ||
+ | <tr> | ||
+ | <th>Figure 7</th> | ||
+ | <th>Figure 8</th> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>[[file:Main algorithm.jpg|600x200px|right|Click to enlarge image]]</td> | ||
+ | <td>[[file:Car position.jpg|right|600x200px|Click to enlarge image]]</td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | |||
+ | <table border="1"> | ||
+ | <table align="right"> | ||
+ | <tr> | ||
+ | <th>Figure 9</th> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>[[file:Lane selection system.jpg|600x200px|right|Click to enlarge image]]</td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | In Figure 9, the lane selection system is shown. With the values from the car position detection one of the three state flows is selected.<br> | ||
+ | The multiport switch gives a lane (1,2,3) that is desired to go to. If all the lanes are blocked, the StopBelt output will be 1(Boolean). | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | <table border="1"> | ||
+ | <table align="right"> | ||
+ | <tr> | ||
+ | <th>Figure 10</th> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>[[file:Lane selection system 1.jpg|600x200px|right|Click to enlarge image]]</td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | This is the state flow when the current lane is lane 1, as shown in Figure 10. The three lanes have a logic connected in a triangle. <br> | ||
+ | This means if the car is in lane 1, it’s possible to go to either lane 2 or lane 3. For the other state flows, please look at the software. | ||
− | |||
− | |||
− | |||
− | ==== | + | |
− | + | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | The logic for the rotation direction of the stepper engine is shown in Figure 11. The value of the desired lane and the current lane are compared by a plus minus block.<br> | ||
+ | The block takes the value of the current value minus the value of the desired lane. With the other blocks the on/off for the stepper engine is 1 or 0. The direction is 0 or 1. | ||
+ | (Figure 12) | ||
+ | |||
+ | <table border="1"> | ||
+ | <table align="center"> | ||
+ | <tr> | ||
+ | <th>Figure 11</th> | ||
+ | <th>Figure 12</th> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>[[file:Stop belt.jpg|600x200px|right|Click to enlarge image]]</td> | ||
+ | <td>[[file:Output_block.jpg|750px|right|Click to enlarge image]]</td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===Output=== | ||
+ | |||
+ | ====LED==== | ||
+ | |||
+ | [[file:Output.jpg|600x700px|right|Click to enlarge image]] | ||
+ | |||
+ | This output is for the test led on the Olimexino.<br> | ||
+ | By changing the frequency, it is possible to see if<br> | ||
+ | the new software is flashed correctly. <br> | ||
+ | ====Direction roll==== | ||
+ | This is a digital output for the driver board. <br> | ||
+ | When changing this output from low to high and<br> | ||
+ | high to low the direction of turning from the <br> | ||
+ | electric motor will change. With this demo the <br> | ||
+ | direction won’t change, so this output is constant.<br> | ||
+ | ====Speed step==== | ||
+ | This digital output controls the speed of the <br> | ||
+ | stepper motor. | ||
+ | ====Resolution 1 & resolution 2==== | ||
+ | These two outputs are used to determine the resolution of the<br> | ||
+ | stepper motor. In total there are 4 combinations (2 ports, high and low).<br> | ||
+ | The resolutions changes from a full step to a half, a quarter and an eight step. <br> | ||
+ | ====Belt Speed desired==== | ||
+ | This output is used to control the speed of the conveyor belt.<br> | ||
+ | By HANtune it is possible to control the speed. <br> | ||
+ | Since the motor driver needs a PWM signal, <br> | ||
+ | this is converted in the subsystem.<br> | ||
+ | ====On/Off step==== | ||
+ | This digital output is used to control the stepper motor. <br> | ||
+ | ====Direction Step==== | ||
+ | This digital output is controls the direction of the stepper engine. <br> | ||
+ | The direction will change is when the output is changed from low to high and high to low. <br> | ||
+ | ====Trigger frequency==== | ||
+ | The trigger frequency is used to control the ultrasonic sensors.<br> | ||
+ | By triggering the sensors, they will measure the distance to an object. |
Latest revision as of 14:18, 31 May 2018
General overview
A car runs on a conveyor belt and can run on three different lanes.
When an obstacle is detected in the path of the car,
the car will switch a lane to avoid a collision.
It is possible to block all three lanes, but then the car will stop.
This demo is built up from different subsystems.
The mechanical, the electrical and the software.
All these systems are also divided into the sub-components.
Mechanical:
The construction of the total demo assembly is divided in 3 separate sub-assembly’s:
the housing components, the lane change mechanism and the conveyer belt.
Electrical:
The electrical components are connected by soldering and screw terminals.
The power supply from the wall socket goes directly into the transformer
that generates the correct power supply for the components such as the H-bridge
that controls the conveyer belt motor, the microcontroller,
stepper-motor and the ultrasonic sensors.
Software:
The software is also divided into 3 separate systems: the input, algorithm and output.
The input gives the values that the algorithm need to create the output.
The algorithm decides what happens with the belt. When there is an obstacle the car will switch lanes,
if all 3 lanes are blocked the belt will stop.
Introduction
The HAN-AR have two model based development tools, HANcoder and HANtune, that they would like to promote. In order to do this a new demonstration model was required.
This is what the project team Highway Surfer has created.
The model will showcase the abilities of the tools and will act as an eye catcher at tech fairs and conferences that the HAN-AR attends.
With the help of this document people who are interested in recreating this project or start their own projects will be able to see what the steps involved are,
the materials required and the capabilities of the tools, HANcoder and HANtune.
This project was started with the help a template. This template can be downloaded from the following link:
On this wikipage, you can find the building process for the mechanical parts, the wiring and other processes for the electronics and the logic for building the software algorithm.
To make it easy for the consumer, we have an easy to understand order list with relevant links.
Materials Required
Hardware parts
Local hardware store:
- 5.5 [mm] multiplex
- Aluminum L-profile 20X20 [mm]
- Bolts, nuts
- PVC tube (80mm diameter x 1m length)
- Grip material for the PVC tubes
- Conveyor belt
- Axes
- End pieces’ roll (wood)
Online webshop:
- Bearings
- Gears/pullies and belts, for the drivetrain and lane change mechanism:
Electrical
Online webshop:
- Olimexino STM-32 board
- Stepper motor-driver
- Ardumoto - Motor Driver Shield
- Transformer
- Transistor 7805
- Female power connector for Olimexino
- 6x Screw terminal block 1.50 [mm²]
- Mini fuse 2 [A]
- Mini fuse 5 [A]
- Resistor 10 [KΩ]
- Resistor 1 [KΩ]
- Capacitor 0.33 [nF]
- Capacitor 4,7 [nF]
- Capacitor 22 [nF]
- Zener diode 18 [V]
Sensors
Actuators
Software
- MatLab Simulink®
- HANcoder
- HANtune
HANcoder and HANtune are available at OpenMBD. (On the website is a download manual for all the software.)
Mechanical
For the mechanical design the dimensions can be found in the CAD 2D drawings, which can be downloaded from the website [link here]. When all the parts are cut, they can be assembled. In the exploded views in this document the exact order of assembly is explained.
Conveyor belt base
Housing
To build the housing of the conveyor belt you need following items:
- 3x multiplex plates of 1220x610mm with a thickness of 5,5 [mm].
- Blueprints of the individual panels for the dimensions.
- Saw or something to cut the wood.
- Bolts(m5)
- L-profile(3000x20x20 [mm])
- Measuring tape
- Wood drill
Cutting
To get the right dimensions for the wooden this DEMO a LaserPro X500 was used.
The Solid Works drawings of all the wooden parts are send to a device that runs 'Corel Draw X8'.
The process can be seen in the pictures below. We chose this option to get a cleaner finish. Of course, there are other ways to get the panels to the right dimensions.