CMPS11 Calibration

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!

Moderator: phalanx

Re: CMPS11 Calibration

Postby Valen » Sun Feb 14, 2016 3:51 am

Tomadevil wrote:Yes I do receive messages on the serial monitor, but that doesn't necessarily mean it is working properly.
Correct. But if someone only says "it doesn't work" without other explanation of what it IS doing, meaning any signs of life, then we have to assume even the worst of conditions are possible. That the microcontroller is dead or damaged, has a power supply failure or short in it's supply circuit, is in a reset-state, or got itself locked in a program state without ever having done any change to it's GPIO pins. A full explanation of it's behaviour is essential in locating the source of an issue. "doesn't work" doesn't help.

I'm sorry, you are right. I should have mentioned that this is running on an Arduino UNO. You can see how I connected it to the arduino here, and yes I have pull up resistors in circuit:
http://www.robot-electronics.co.uk/htm/ ... PS11%20I2C
Good

Yes I do receive messages on the serial monitor...
Which are? Again, we have to know what it is thinking or doing, or where it takes the wrong action.
Valen
Support Volunteer
 
Posts: 1588
Joined: Wed Dec 22, 2010 2:05 am

Re: CMPS11 Calibration

Postby Tomadevil » Sun Feb 14, 2016 6:45 am

First message appers 1-2 sec after that I turned on the Arduino, which is:
"Calibrarion mode"
Two seconds later:
"Start"
Twenty seconds later:
"done"

The flashing LED on the compass module would indicate that the calibration has started, but it is not flashing. It is lit constantly.
Tomadevil
 
Posts: 12
Joined: Wed Feb 10, 2016 4:10 pm

Re: CMPS11 Calibration

Postby Tomadevil » Mon Feb 15, 2016 3:16 am

It properly works now. I'm able to calibrate it :)
Tomadevil
 
Posts: 12
Joined: Wed Feb 10, 2016 4:10 pm

Re: CMPS11 Calibration

Postby jremington » Mon Feb 15, 2016 9:39 am

For the sake of others with a similar problem, what was the problem and the solution?
jremington
Support Volunteer
 
Posts: 2053
Joined: Fri Jun 15, 2007 9:41 pm
Location: Eugene, Or

Re: CMPS11 Calibration

Postby Tomadevil » Tue Feb 16, 2016 10:25 am

The command register and Wire.endTransmission(); were missing of each byte send.
The correct code is the following:
Code: Select all
 #include <Wire.h>

#define ADDRESS 0x60

void setup(){
  Wire.begin();
  Serial.begin(9600);
  calibrate();
}

void loop(){
}

void calibrate(){

  Serial.println("Calibration Mode");
  delay(2000);  //2 second before starting
  Serial.println("Start");

  Wire.beginTransmission(ADDRESS);
  Wire.write(0); //command register
  Wire.write(0xF0);
  Wire.endTransmission();
  delay(25);

  Wire.beginTransmission(ADDRESS);
  Wire.write(0); //command register
  Wire.write(0xF5);
  Wire.endTransmission();
  delay(25);

  Wire.beginTransmission(ADDRESS);
  Wire.write(0); //command register
  Wire.write(0xF6);
  Wire.endTransmission();

  delay(20000);

  Wire.beginTransmission(ADDRESS);
  Wire.write(0); //command register
  Wire.write(0xF8);
  Wire.endTransmission();
  Serial.println("done");


}


Thank you for all the help guys :)
Tomadevil
 
Posts: 12
Joined: Wed Feb 10, 2016 4:10 pm

Re: CMPS11 Calibration

Postby Tomadevil » Wed Mar 30, 2016 6:11 am

I know it's been a long time since my last post, but I've not had time to do anything with this module.
I have built a frame to check the accuracy of the compass, but It doesn't want to work properly. When I'm turning the compass to one directon by 90 degree, the sensor show only 20 degree change, then suddenly jumps up to a very high value. It is very annoying. Has anyone had similar problem with their compass or do you guys have any idea what to do?
Image
Tomadevil
 
Posts: 12
Joined: Wed Feb 10, 2016 4:10 pm

Re: CMPS11 Calibration

Postby elvisß1 » Fri May 20, 2016 12:59 pm

Hi Tomadevil,
the frame is looking really good... but did you make the joints out of metal?
It is a very simple mistake: if there is some metal nearby, the calibration would never work properly.
I have also a CMPS11 it is not very accurate, I will try to calibrate it, but I don't have a test device to measure the accuracy.
In case you solved your problem, plse reply!

Regards, elviß1
elvisß1
 
Posts: 1
Joined: Fri May 20, 2016 12:49 pm

Re: CMPS11 Calibration

Postby mutant » Tue Aug 29, 2017 6:47 am

Old thread, but hopefully I can help.
If you are testing as shown in the picture, you are testing the compass upside down. The tilt compensation on the 11 does not go that far.
Your frame is great, but only has two degrees of freedom. If you add a third it will make an awesome tool for getting good calibration.
Ignore the comments about the joints. They will have negligible effect. You can always replace steel with copper or brass, both of which have ~zero magnetic impact.
The compass should be accurate to 2% - that's 7.2 degrees. Mine only manages 8 degrees, even after calibration.
mutant
 
Posts: 1
Joined: Tue Aug 29, 2017 6:36 am

Previous

Return to Projects

Who is online

Users browsing this forum: No registered users and 3 guests