1 / 19

MicroMouse @ The University of Bolton

MicroMouse @ The University of Bolton. Key features of the Buggy. Let’s learn how to make the Buggy Move. We’ll start with some simple instructions to get the buggy to do some simple manoeuvres via flow-code.

anson
Download Presentation

MicroMouse @ The University of Bolton

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MicroMouse @ The University of Bolton

  2. Key features of the Buggy

  3. Let’s learn how to make the Buggy Move • We’ll start with some simple instructions to get the buggy to do some simple manoeuvres via flow-code. • We’ll check the code shown on the PC works, by downloading it to the Buggy, and seeing how it reacts. • We’ll build onto the code to create more meaningful movement patterns. • We’ll modify the code to appreciate the various types of Buggy movement available. • This tutorial will lead to the Buggy developing a “Square Dance” movement pattern • Then you can develop your own series of motions.

  4. Getting up and runningOpen MatrixMultiMedia Flowcode v3 application:-Start All Programs MatrixMultimedia FlowcodeV3 Click “Open an existing FlowCode Flowchart”… More files… OK Find the start-file “BuggyMove1.fcf” from Folder:- C:\ Program Files\ MatrixMultimedia\ ManSciFest\ Walk-thru’s\ Buggy Move 1\ BuggyMove1.fcf and click OPEN

  5. Your screen should look like:-

  6. So what does this code make the Buggy do? • With the power switch on it waits until either switch SW4 or SW5 are pressed. • It then drives forwards for half a second, goes backwards for 1 second, then STOPS! • That is all this simple code does! • So, lets download the code to the Buggy to check.

  7. Save the code as “Square” in folder C:\Temp\. • Connect the USB cable to the Buggy and note the green LED light near the socket. • Switch on the Buggy and if the two red LED’s are flashing, it is ready to program. (If the LED’s are not flashing, switch the Buggy off, then on again.) • Select “Chip” from the top Menu and click on “Compile to Chip” (This converts the flowcode to machine code and sends it to the chip on the Buggy. When the red lights stop flashing, the code download is complete. • Switch off the Buggy at the switch and remove the USB lead. • Switch on the Buggy and it will now run according to the code within the chip.

  8. Let’s modify the Buggy’s motion • Double click the “500ms delay” block to open the properties box for this delay. • Change the delay from “500 ms” to “2 second”s. • Click OK to accept the new settings.

  9. And check the code on the Buggy • Save Code • Connect USB cable to Buggy. • Switch on the Buggy • Select ‘Chip’ from Menu • Click on “Compile to Chip” • When finished, switch off Buggy • Remove the USB lead. • Switch on the Buggy & run.

  10. Now add “Pause” between motions • Right mouse click on the ‘Stop Motors’ block, and select copy. • Left mouse click on the 2second delay block and you will notice a small arrow appear just below the selected icon. • Select ‘Paste’ and a copy of the ‘Stop Motors’ block will be pasted in after the 2 second delay. • Similarlycopy the 1second delay block and paste it in after the “Stop Motors” block so that the code now incorporates a 1 second pause between running forwards and running backwards.

  11. Check the code modifications • Save Code • Connect USB cable to Buggy. • Switch on the Buggy • Select ‘Chip’ from Menu • Click on “Compile to Chip” • When finished, switch off Buggy • Remove the USB lead. • Switch on the Buggy & run

  12. Select a different Macro • Double click on the Formula-Flowcode Reverse (Drive Backwards) block to reveal its properties. • Select the SpinLeft Instruction from the Macro Menu and change the Display Name to read ‘Spin Left Power 200’ • Click OK to accept the new properties.

  13. Make it turn 90° • For the Buggy to rotate left 90°, we need to modify the time delay block, (after the ‘Spinleft’ instruction). • As the motors all behave slightly differently to one another, this is best done by trial and error. • Try reducing the 1 second delay to about 400 milliseconds, (and download the code to the Buggy). • Test and tune to get it to turn exactly 90°

  14. Add a 1 second delay to the end

  15. Repetition of this Motion • To add the “forever loop”, drag & drop the loop icon . • Release it when the mouse is over the ‘BEGIN’block . • This ‘While 1’ defines a forever loop … However there is nothing in it at the moment!

  16. And to complete the loop • At the moment there is nothing in between the limits of the Loop, • We need to move (drag and drop) all the blocks from ‘Drive forwards for 2 seconds’ to ‘Stop Motors for 1 second’ into the forever loop (and keep them in the same order).

  17. Check it out • Download this code to the buggy and see if it follows the “square edged pattern” that you have now programmed into it. • It should keep repeating the go-straight ahead, then turn left commands). • The Buggy will keep looping around this code FOREVER … until it is switched off or the batteries go flat!

  18. So, to perform just 2 circuits • Double click on the Loop block to reveal the forever loop properties. • Tick the Loop Count box • Enter 8 to the box after Loop Count (This changes the code to just make 8 loops to create the two circuits/revolutions (8 x ¼ turns). • Click OK Now download the code to the Buggy and see how it performs.

  19. Creativity Now create your own motion patterns modifying the code you have just created.

More Related