
jstarne1
Hi , I have been shopping for sensors and reading about 2d mapping using.radar.extra.and I also read on some random sites that a good electronic compass is a good addition to get your robot correct orientation if it deviated from a original path avoiding a object or if the little guy.just.just drive perfectly straight. are these compass modules useful.to.tell your.robot which.direction to.go.or slightly correct.itself? I apologize for all the random periods because I just bought a new Samsung galaxy note and IM still getting use to it. The auto correct is changing words to what it thinks I should have said I guess lol
This one is under 20 dollars and has self calibration, user defined zero.position. Can.some.one look at this and tell.me if ezb can read the signal in a useful way?
http://www.ebay.com/itm/Arduino-Electric-Digital-Compass-Sensor-transducer-Module-Compatible-Robot-New-/221089503297?pt=BI_Electrical_Equipment_Tools&hash=item3379f61841
Bob is basically a metal cage full of wires which to me seems a compass nightmare. Short wires ? have it situated away from metal ? Seriously - can they help or are they more a hindrance ?
transmit is need on most compass to calibrate it and other setups,received is to get the compass reading,a nd EZB only has a one wire rs232 serial ,i think transmit
so the olny one that will work are ones with true 12C connection
i wish DJ wound add a received command ,good for getting info on roomba sensors and serial communication to other sensors
HAZBOT wires are not the problem as metal too,problem is magnetic fields,compass picks up magnetic fields,so anything thats a magnet ,motors,servo's fans and hard drives will give a wrong reading
most data sheets on compass will tell you how much to set them apart of them,mostly 6 inches,compass are fairly accurate ,depend on the company who makes them and calibrates them
here is info from a company that makes the best one
Q. Is the Compass affected by Motors, Magnets, Ferrous objects etc?
A. Yes. Anything that affects the local magnetic field will affect the Compass module. Motors in particular contain strong magnets. The only solution is to mount the compass as far away from magnetic/ferrous objects as is practicable
here is info on compass on another post i reply too
should not need shielded cables on the compass on a robot ,i have it 6 inches away using a pic processor and normal wires,I2C buss you can run long wires thats whats good about it
can post the photo of it
should be able to run long wires on I2C buss,so 2 problems it may have one is the pull up resistors on the 2 lines or a cheap compass having a week signal
It seems to be working, but after 5 seconds I lose connection and ARC sort of
stops working...
Any ideas on whats happening?
in a few weeks mmaybe more looking to do some testing on why the wires need to be short on only SURE compass its very strange,you get long run wire from I2C buss,can post my seeker robot design that i have a I2C compass about 2 feet away from the control board and working fine
but i am using CMPS-03,also DAVES SHINSEL SEEKER robot has it too and there where i made mine from with some changes
SO thinking the signal is very week form a china made compass or the pull up resistors and some how noises are causing a reset on EZB
also BRUDEL0 do you have a O-SCOPE,best tool for checking noise in the system
It may not solve the problem of course and I can't try it as my compass module hasn't arrived yet. But its a known solution to intergrating I2C devices with an MCU controller
but it will also divide the voltage down,since there is a pull up of 10 k and in series adding 100 ohm
thats a voltage divider
the EZB uses near the same processor thats on my SEEKER robot that uses a CMPS03 that does have that problem at all and using it at 24 inches away from the board
i think on BUDEL0 case is different,seem a noise problem ,not a compass problem ,since others have it working
BUDEL0 he is a try ,remove compass and see if you are having same problem ,if you still do ,then not the compass, ,can be noise on the lins (hard to find without a scope)
or drawaing to much current from other stuff or on the digital or I2C lines
what do you have hook up and where
1. No I don't have a scope.
2. My robot works fine when I don't have the compass connected.
When I connect the compass while its connected to my pc it stops working again...
3. I have connected to my EZ-B:
- 2x 20A ESC
- 7x servo
- Synapse RF100 module
- 2x 7.2V 20C 4000mah lipo battery (soon to be 3x)
- 1x Ping sensor
- 1x ADC voltage sensor
I think I covered it all.
@winstn60
I will try it. I hope it works, because I'm working on something special for navigation ^^.
second adding that 100ohms might help like winstn60 said
Sounds interesting keep us posted hope you get the compass working ))
No succes with the 100 ohm resistors...
Any other ideas?
sorry another edit
here is info on the resistors needed
The value of the resistors is not critical. I have seen anything from 1k8 (1800 ohms) to 47k (47000 ohms) used. 1k8, 4k7 and 10k are common values, but anything in this range should work OK. I recommend 1k8 as this gives you the best performance. If the resistors are missing, the SCL and SDA lines will always be low - nearly 0 volts - and the I2C bus will not work
WINSTN60 you sad this
The device I like is SparkFun Compass Module - HMC6352 Product Code: SEN-07915 which has I2C and all the documentation perhaps someone on here has already added it to EZB or has another opinion
a lot better choice thats used in robotics a lot is CMPS10 HIGHER ACCURACY .1 DEGREE compare to SPARKFUN compass at .5 degree
and at the same cost $34.95 from dfrobots both have I2C interface and replaced the very popular CMPS03 compass used in robotics alot ,whats added is tilt compensated
CMPS10 COMPASS
i have CMPS03 compass and one from china ,HOPE SOON to do some testing and make a I2C code for it,should work with the CMPS10 witch i am going to have on order too
JOSH that compass from SHURE electronics that DJ is using has very bad accuracy
Accuracy1 2 to 5 deg compare to .5 deg on sparkfun and .1 deg on CMPS10
ITS LITTLE MORE PRICE FOR THEM but worth the extra cost for better navigation
here is some great info on using the I2C buss i found awhile back
I2C BUSS tutorial
Thats frustrating hopefully I will have the same compass module as you delivered in a few days and I do have a scope. Also worth trying pull up resistors as robotmaker states
Read this from DJ in I2C help on this site
" i2c Wire Length and Pull Up Resistors
If you modify or extend the wire on the i2c device, keep the individual wires (GND, +5, SDA, SCL) from being twisted together. You will notice i2c cables are flat, much like an older IDE Hard Drive Cable. Building your own i2c extension cable is not easy with regular wire. You can try different pull-up resistors, which decreases the sensitivity of your communication, but also removes noise. Ideally you should be using a special i2c cable.
Pull-Up resistors are connected between +5 to SDA and +5 to SCL. They are required for i2c device communication. The EZ-B has 2 pull-up resistors on board for the i2c. If a long thick wire is used (specifically if twisted), you may need to add 2 more resistors. The pull-ups range from 1k ohm to 10k ohm. You may need to expirement with a variety of resistors to find your ideal value"
i would read the IC2 page i put a link too it tell you all info on using I2C buss ,from clock pluses to how to write a code for it
,since i am in the design and test lab at work where i build high precision test equipment for the tester we make
so will be able to do tests on the magnetic compasses fairly soon,as soon as i get the CMPS10 from china,can test all 3 of them,accuracy i cant check but specs tell you the accuracy
mostly only checking how far from magnetic fields it needs to be away and I2C distance problem
I enjoy your well thought out posts.
Have you received your compass yet? When you do please post your i2c code here on your procedure for reading from it. I'm trying to read the I2C port of an IMU 6050 but I'm not understanding the EZ script code for that yet. The specs say it's address is 0x69 or 0x68 but with some sample code from someone reading another device would enable me to change it to this device.
I am using 4.7K pull up resisters and under 3 inch untwisted wires with the EZ-B 3.3 volts.
Here's one thing I've tried but not sure how far off I am:
I2CStart()
I2CRestart()
I2CPoll()
I2CWrite( 0x68, 0, 1)
I2CRead( auto,11)
I2CStop()
The output of my script is:
Start
I2C Poll Response: False
I2C Response: 255 255 255 255 255 255 255 255 255 255 255
Done
Thanks,
Bill
It actually changes, its giving of the actual direction its facing, but it only works for a very short time. After that it sort of crashes ARC... It stays stuck in "connected" while the LED on the EZ-b is pulsating, like it's not connected.
So I think it's browning out my EZ-b... I'll try powering it from an alternative powersource.
I'm using 2k resistors. And made a board for it.
@Robotmaker did you have any luck with your test on the other 3 compass modules?
Compass modules will be susceptible to interference so relocating it may be an idea.
@RobotMaker no longer frequents the forum. @MovieMaker and a few others are in contact with him still I believe, perhaps they could ask?