Show Posts
Pages: 1 ... 104 105 [106] 107 108 ... 114
1576  Using Arduino / Sensors / Re: Calculating wheel RPM with reed switch and interrupts on: February 18, 2012, 10:53:47 am
Hi,
    Your reed switch might be bouncing, look up switch 'debouncing' and the strategies to get around it.

I have successfully used infra red to measure wheel speed, the advantage is that in high rpm applications there is no magnet to unbalance the wheels -



See here -
http://rcarduino.blogspot.com/2011/12/traction-control-part-11-monitoring.html

Duane B

rcarduino.blogspot.com
1577  Using Arduino / Project Guidance / Re: Don't Shoot ! on: February 18, 2012, 08:17:03 am
Hi,
    There is no question that the platform itself is brilliant, there are things that I have had at the back of my mind for years that with Arduino I have been able to get done in a month and also learnt a lot in the process.

    I have put up a few posts on my blog relating to Servos and RC Receivers mostly for my own interest, but I must get over 100 hits a day on these posts. They are not rocket science but they are sufficient that most people can take their own existing code and level of understanding and turn it into something that works/

    I don't know whether servos are uniquely problematic for new programmers or whether there is great gulf between completing the examples and being in a position to complete a useful project, if this is the case a few community contributed programming approaches might be a very useful resource.

   On the hardware side I personally found the 'school' section of Mike Cooks web site very helpful - http://www.thebox.myzen.co.uk/Site/Welcome.html

   Its a bit of a pick and mix that I like to think of as 'Arduino and the Real World', but where is the programming equivalent ?

Duane B.

rcarduino.blogspot.com

   
1578  Using Arduino / Motors, Mechanics, and Power / Re: Servo sweep speed controlling with rc transmitter on: February 18, 2012, 04:04:51 am
Hi,
   What is the end result of what you are trying to do, there may be better approaches,

Duane B

rcarduino.blogspot.com
1579  Using Arduino / Programming Questions / Re: Corrupt data on fifth parameter in a method? on: February 18, 2012, 03:50:28 am
Hi,
   You might be running out of stack, does your program use a lot of memory ?

   Duane.
1580  Using Arduino / Motors, Mechanics, and Power / Re: Arduino Servo Libary, how many usec are 1 degree on: February 18, 2012, 03:03:32 am
Hi Zoomkat,

    Thats interesting and going slightly off topic, another reason why trying to measure an RC input to sub uS accuracy is something of a waste of time.

    The other reason is this -

http://1.bp.blogspot.com/-Zi6qBbVC1WY/Tx2WLRS3jlI/AAAAAAAAAOA/i3sAqVLflvk/s1600/near.PNG

    In my observation, the input signal varies by 40us for a constant input signal, the variation increases with distance and the nature of the built up environment around the transmitter receiver.

http://rcarduino.blogspot.com/2012/01/how-to-read-rc-receiver-with_20.html

Duane B.
 
1581  Using Arduino / Motors, Mechanics, and Power / Re: Arming ESC not working as expected. on: February 18, 2012, 02:55:23 am
Hi,
   Your car is probably generating a power surge when you switch it on, if you have no decoupling this could easily upset your Arduino.

Duane B.

rcarduino.blogspot.com
1582  Using Arduino / Project Guidance / Re: Using ServoTimer2 and ServoDecode with 8MHz Arduino on: February 18, 2012, 02:45:21 am
Hi,
   Have you had a look at the code for reading from an RC Receiver on my blog ? it uses interrupts and the micros function to measure the time between pulses. In my Child Mode project I use this together with the servo library to put the Arduino between my Receiver and electronic speed controller. While you may be aiming for a different outcome, the nature of the project - read RC Receiver, do something with the signal, then output a servo/ESC signal from Arduino - would appear to be the same.


http://rcarduino.blogspot.com/2012/01/how-to-read-rc-receiver-with_20.html

I like this approach because there is only one Timer1 and to my mind its better used to drive servos than to measure an inherently noisy signal. The micros function will give you accuracy in the region of 4ms, but in my test the original signal can vary by as much as 40ms from one pulse to the next, so using the 16 bit timer1 to get increased accuracy in the measurement is to my mind, not the best use of the available resources.

Now some good news -

Reading through the Servo library and some of the other Arduino header files, I have come across F_CPU, my guess is that if you investigate this, it may turn out to be a system wide definition of the CPU frequency. You will hopefully find that all well written libraries use this or functions that reference it in which case you can make a single change to have your Arduino adjust all/most/many of its functions to the new frequency. Without having investigated it fully my guess is that micros will include a reference to F_CPU and so my approach to measuring RC Input and generating the output should be portable between clock speeds.

You can find some code to test at different clock speeds here, but remember to adjust F_CPU first -

http://rcarduino.blogspot.com/2012/01/how-to-read-rc-receiver-with.html

EDIT : F_CPU is defined in the make  file, not an include file.

Duane B

rcarduino.blogspot.com

1583  Using Arduino / Project Guidance / Re: Using ServoTimer2 and ServoDecode with 8MHz Arduino on: February 17, 2012, 01:17:27 pm
Hi,
   Its a slightly irrelevant questions as my thoughts on the ServoTimer2 library were based on my knowledge of the Servo library, but still, why ServoTimer2 not Servo ?

Duane.

rcarduino.blogspot.com
1584  Using Arduino / Project Guidance / Re: Using ServoTimer2 and ServoDecode with 8MHz Arduino on: February 17, 2012, 12:43:28 pm
Hi,
   My guess is that yes, you will have to change the code. The Servo library (not ServoTimer2) uses clock ticks to determine when to pulse the servo pin high or low so changing the clock frequency changes the mapping between the number of clock ticks and the time that the pin should be pulsed.

  Extending my guess, its a very simple change to make, this is till a guess, but there is probably a single macro or function which is used to do the conversion from milliseconds to CPU ticks, you just need to adjust this to reflect the slower clock. There is probably another function which makes the opposite conversion - ticks to milliseconds, you should also adjust this.

Are you using a Mega, if not, which board ?

Duane B.

rcarduino.blogspot.com
1585  Using Arduino / Project Guidance / Re: Using buttons to toggle 'pages' on an LCD on: February 17, 2012, 10:02:15 am
Hi,
 hcanning, with reference to another post I have just made, I am assuming that you are in the 'would like to know more and willing to try' camp. If this is the case, please have a read through my latest blog post here and comment on whether it is helpful/interesting to you as a self described noob.

If you think it might be helpful but there are some areas that are not sufficiently clear again, let me know. Even if its a bit above your current level, its still good feedback to indicate whether you think with more generic background reading you could get there.

http://rcarduino.blogspot.com/2012/02/rc-lap-timer-go-kart-lap-timer-part-2.html

ghoti,
 Can you also have a look, for no more reason than that you are from Newport, Gwent and so am I.

Duane B.
1586  Using Arduino / Project Guidance / Don't Shoot ! on: February 17, 2012, 09:57:05 am
Hi,
   I might be wrong, but it seems to me that there is a challenging learning curve between the common Arduino examples and some of the techniques that are second nature to those of us with a programming background. At the beginning of my programming career it took time and effort to close this gap however many of the folks looking for help on these forums are not programmers by trade and while some of them appear not too concerned with making the effort, others are and will no doubt get there.

   I have put the following post together for those that want to make the effort, I am not convinced that I have the level or tone right but if your in the 'would like to know more and willing to make the effort camp' please have a look and please comment on the suitability of the terminology, examples given etc.

If your not in the 'would like to know more and willing to make the effort camp' please, Don't Shoot !

http://rcarduino.blogspot.com/2012/02/rc-lap-timer-go-kart-lap-timer-part-2.html

Duane B

http://rcarduino.blogspot.com/


   
1587  Using Arduino / Project Guidance / Re: Using buttons to toggle 'pages' on an LCD on: February 17, 2012, 05:02:22 am
Hi,
   I am most of the way through a project that does almost exactly what you want. In may case its a radio controlled car and go kart lap timer. The project has an LCD Display and buttons which are used to cycle the display through 'record','session summary','session detail' modes. Within each mode the button purposes can change so it could have become quite cumbersome to code. As it is I have come up with a very simple approach. If you can hold on until this evening I hope to be in a position to post my approach and enough sample code to get you going.

Here is a quick outline of the project which I posted last night -

http://rcarduino.blogspot.com/2012/02/rc-lap-timer-go-kart-lap-timer-part-1.html





Duane B

rcarduino.blogspot.com
1588  Using Arduino / Motors, Mechanics, and Power / Re: Arduino Servo Libary, how many usec are 1 degree on: February 17, 2012, 04:54:57 am
Hi,
   You can learn a great deal very quickly by opening the library files and having a look around, in my case the libraries files are here -

C:\arduino-1.0-windows\arduino-1.0\libraries\Servo

Inside the directory you will generally find a .h file and a .cpp file, these are the source code files used to build the library.

Inside servo.h you will find the following limits have been set -

#define MIN_PULSE_WIDTH       544     // the shortest pulse sent to a servo 
#define MAX_PULSE_WIDTH      2400     // the longest pulse sent to a servo

You could adjust these to give a wider range, but I would assume these are provided by the library creators to prevent damage to the vast majority of servos.

Inside the write function in servo.cpp you will find

 value = map(value, 0, 180, SERVO_MIN(),  SERVO_MAX());     

So the range 0,180 is mapped to 544 to 2400 microseconds (unless you specifically set some other limits) which gives 10.31 uS per degree. I may have missed something so feel free to check and correct.

Duane B.

rcarduino.blogspot.com
1589  Using Arduino / Project Guidance / Re: Crossing a metal line on: February 16, 2012, 02:23:57 pm
Hi,
   Might not be what your looking for, but you have to admit its cool to have your lap time on the steering wheel and also be able to turn the same system to timing radio controlled cars if you wanted -

My work in progress RC/Go Kart lap timer - rcarduino.blogspot.com

Duane B

rcarduino.blogspot.com
1590  Using Arduino / Motors, Mechanics, and Power / Re: modding an RC car on: February 16, 2012, 04:04:00 am
Hi,
   For the servo movement, thats one advantage of thinking in milliseconds, you can use my monitoring code to read the servo input, output the same value and record how far you can take the servo in each direction using milliseconds. You can then use the same milliseconds values to set software limits in your own code.

As for the battery and charger, I assume that for the money you paid you will have a 7.2 volt nimh battery and the charger is most likely a trickle charger similar to the wall wart power supplies that some use for their Arduino projects.

If this is the case the battery output is not high enough for the Arduino regulator to reliably generate 5V - I am far from expert here and will no doubt soon be corrected if wrong.

You should also be aware that your nimh batteries should never be fully discharged (something tells me this might not be in your instruction manual ?), if this happens the battery chemistry can change so that one or more cells will no longer accept a charge - through negligence I have had this happen to all of my nimh packs. I now use more powerful LIPO Batteries, they can also fail after a full discharge however I have only had this happen once. The down side to LIPOs is that you will need to invest in a different, more expensive charger to use them.

Duane B.
Pages: 1 ... 104 105 [106] 107 108 ... 114