|
按照http://tiltedtwister.com/ 的图纸搭建了一个魔方机器人,试着运行了一下,运行基本正常,就是解出来的结果不对,我用的是光电传感器,回到网站仔细一看,原来还有这么多的注意事项,贴出来供大家一起参考。对于你的魔方是不是符合条件,里面有测试程序,我测了一下我的cube,是解决不了的,只能自己粘贴色彩了。据说色彩传感器就没有这么多的麻烦!
顺便把程序包也传上来了!
http://tiltedtwister.com/download/tiltedtwister.pdf
Tilted Twister - Instructions
http://tiltedtwister.com
Getting started
Read all of this page.
Run the calibration program.
Run the tiltedtwister program. Youshould use an unscrambled cube the first time you run the program. Theprogram should calculate a solution of zero moves. If not, abort theprogram and adjust what needs to be adjusted.
Scramble the cube and let Tilted Twister solve it.
Building instructions
Cut out a piece of thin cardboard 70 x 70 mm and cut out the corners 8 x 15 mm.
Placeit on the turntable so that the cube rests on a flat surface. It'simportant that the cube slides easily on the surface when tilted.
Connect the wiring as follows:
1 - Touch sensor
2 - Light sensor or HiTechnic color sensor
3 - Ultrasonic sensor
A - Turntable motor
B - Tilter arm motor
C - Light/color sensor motor
Rubik's cube
Unfortunately the yellow and the white colors of a standard Rubik's cube gives the same readings from the light sensor.
Ifyou don't have a color sensor you have to replace some of the colors ofthe cube. Cubesmith.com has replacement stickers in all sorts of colors.
Onmy cube, I have replaced yellow with flourescent yellow, blue withlight blue and orange with gold mylar, I have also replaced the whiterubik's cube logo sticker with a plain white sticker.
You could try using other colors as long as the light sensor readings differentiates.
Use the colortest program to try out different colors. Use the cube tester program to verify a cube.
If you do have a HiTechnic color sensor you don't have to replace any stickers at all.
Important
The position of the light/colorsensor is crucial. If it's too close to the cube's surface the readingsmay be inaccurate. It is possible to adjust the height position of thesensor by gently bending up the sensor arm. It should be approx 3mmabove the top of the cube.
The gap of the grabber must not be too tight around the cube. Otherwise it will drag the cube back with it.
If your cube is stiff, you could lubricate it with silicone spray. After lubrication you must work the cube for a few minutes.
Make sure the turntable is aligned before starting the program.
Make sure the tilter arm is fully retracted before starting the program.
Avoid having a strong light source right above the robot.
Calibration
Before you let the robot solve ascrambled cube you should calibrate it. The calibrate programcalibrates the position of the scanner arm. If you are using theHiTechnic color sensor, it also calibrates the values of the colors ofyour cube (and so the cube must be unscrambled when running thecalibrate program).
Run the calibrate program and read theinstructions on the NXT-display. When the program asks you to positionthe sensor above center of cube, you should turn it so that theemitting light hits the center piece of the top of the cube. Tip: Dimthe lights of the room to better see where the light from the sensorhits the cube.
Cube tester (only for use with light sensor)
Run this program to check if the colors of a cube can be sorted out using the light sensor.
Placean unscrambled cube on the turntable. The robot scans the faces of thecube. It then displays the minimum and maximum light sensor values ofthe colors for each cube face and tells whether the cube is qualifiedor not.
If the color ranges overlaps the program says the cube isnot OK. But if the overlap is small it might work anyway because of thecolor resolve algorithm of the tiltedtwister program.
Color tester (only for use with light sensor)
This program shows the current light sensor value. Use it to try out your own set of colors.
HiTechnic Color sensor
Requires LEGO MINDSTORMS NXT Firmware v1.05 or later.
See separate buildings instructions for the sensor arm with color sensor.
Downloading programs to the brick
Unzip the download-zip to a new directory.
The files with extension .rxe are executables which should be downloadable to the brick using the lego mindstorms software:
- Create a new project (File/New)
- Press the button "NXT window"
- Select the Memory tab
- Press the download button
The files with extension .rso are sound files and should be downloadable the same way as rxe-files.
The size of the tiltedtwister program is quite big. If you are having problems when downloading tiltedtwister.rxe try the following:
- Delete other program files and sound files etc to make room.
-Update the NXT Firmware. I'm using NXT Firmware 1.05 on my brick. Youcan download and install firmware from the LEGO Mindstorms NXT software.
- Defragment the NXT filesystem. (Bricx Command Center/NXT Explorer/Defragment)
Source code
The files with extension .nxc can be edited and compiled using BricxCC (http://bricxcc.sourceforge.net).
Troubleshooting
Watch the NXT-display as it scansthe faces. When using the light sensor it displays the light value of.If you are using the color sensor it displays three values for eachscan. It's the rgb-values of the color reading.
When it has scanned all the faces it resolves the colors. The screen says "Resolving colors".
Then it calculates three solutions.
For each solution it makes a ticking sound with increasing pitch. This should take some ten seconds.
After that it starts executing the solution showing the number of remaining twists on the display.
If it fails reading the colors, one of the following things will happen:
- When calculating a solution it never stops. It keeps ticking with higher and higher pitch.
- It stops ticking and nothing happens.
- It manages to calculate a solution. But it's not the correct solution because it has resolved the colors incorrectly.
Have fun!
|
|