Compass sensor controlled servo

Status
Not open for further replies.

Larry1

New Member
I am trying to design a steering system that controls a rudder using a servo, The bearing will be obtained from a Devontech CMPS09 tilt compensated compass sensor to keep a model boat steering on this course. I need to be able to point the boat in the desired direction, set the direction as the bearing and if current/wind pushes the boat off course the rudder will compensate. I have had a little bit of experience with assembly language and would prefer to stick with it but am a bit lost with this one. I am using a 16f628a micro and the output from the CMPS09 is serial, i2c or PWM. I have tried smoothing the PWM signal and using the ADC with a 16f684 and outputting a servo signal but this is not the answer as I can only set the bearing by turning the compass sensor.
If any one can help me get started with this it would be appreciated.
 
hi Larry,
Which part of the project do you need help with.?

The program for the PWM or the circuitry.?
 
Hi Eric,

The circuitry is no problem for me, but im trying to decide the best way of reading the compass sensor output for my intended purpose IE i2c or PWM. I am realy lost on how to capture this output of the sensor and convert it to a useful PWM for the servo. so I guess I need someone to decide which method to use for me for a start! Thanks for the reply.
 
I2C will give you a better and more accurate result. However a compass will only keep you going in the right direction. That doesn't stop currents and winds etc pushing the boat way off course. You probably need a GPS along with it to compensate. For shorter journeys, it shouldn't matter too much.
 
Cool, ill focus on I2C. Ultimately id like to incorporate GPS for the reasons you have explained but at the moment I want to keep it simple as to see if the concept is acceptable.
 
I can see its going to take me a bit to get my head around I2C, would you suggest I use a seperate eeprom chip for simplicity?
 
I can see its going to take me a bit to get my head around I2C, would you suggest I use a seperate eeprom chip for simplicity?

hi,
If you use I2C for the for the CMPS09, why would do you need an I2C ext EEPROM, is the PIC's internal eeprom to limited for for the program.?

The 16f628A has 128 bytes of eeprom, have you considered the 16F886 PIC.?
 
Hi, I was considering external eeprom so I could systematically de-bug the circuit easier, possibly an overcautious approach but I'm new to I2C.

While trawling the internet today I came across this circuit that just about does what I want to do using a 16f819 PIC,

https://www.min.at/prinz/oe1rib/I2C-Servo/#Purpose

The source code is in asm so I should be able to study it and hack it around a bit it to suit.

Im sure to have 1000 questions about it but its a good starting point I think.

Thanks
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…