Show Posts
Pages: 1 ... 85 86 [87] 88 89 ... 114
1291  Using Arduino / Programming Questions / Re: Polling for an external pulse - logic question on: April 29, 2012, 12:21:48 am
Hi,
    Thanks for the interrupt timing comparison, I was going to have to do this myself sooner or later but without access to a scope.

    Thanks for sharing

Duane B

rcarduino.blogspot.com

   

1292  Using Arduino / Project Guidance / Re: RC Airplane Air to Air IR Combat on: April 28, 2012, 06:54:30 am
Hi,
   From current personal experience I can tell you that outdoor IR and daylight can be a frustrating experience.

   Today I have been testing an outdoor IR Lap Timer which uses a transmitter mounted on a the rc car/kart/car to send out a 1Khz pulse of 38Khz modulated IR. To get this to work in daylight I have to house the receiver in a matt black cardboard housing to shield the receiver from ambient IR.

   I assume your planes will be flying in daylight and that they will as often as not have a detector facing the sun or something able to reflect the sun, if this is the case I will go out on a limb and say that your idea will not work - delighted if someone can tell me I am wrong, but my experience with the lap timer suggests that you have to be able to shield your detector from sunlight and reflected sun light. With the IR Lap Timer I can do this because I choose where to place the detector, in a plane which is constantly moving around I do not believe IR will work.

Happy to hear about it if there is a robust outdoor IR system, anyone ?

Details of my project are scattered around my blog, but here is a little about the IR Transmitter and Receiver

http://rcarduino.blogspot.com/2012/03/punk-consoles-and-ir-transmitters-555.html

Duane B

rcarduino.blogspot.com
1293  Using Arduino / Motors, Mechanics, and Power / Re: DC Motor & L293 on: April 28, 2012, 12:28:59 am
Hi,
   Your problem is probably the Arduino resetting itself due to insufficient or noisey power.

What are you using for power ?

Is there any decoupling on the power between the motors and the Arduino ?

Are you putting the same voltage into the 293 through VSS and VS ?

Duane B
1294  Using Arduino / Programming Questions / Re: Problem with Servo and IMU on: April 28, 2012, 12:25:17 am
Hi,
   It is possibly down to power, check the two links in my signature for why you need separate servo power and a demonstration of what happens if you don't have it.

Duane B

rcarduino.blogspot.com
1295  Topics / Robotics / Re: Arduino UNO plus Adafruit motor shield to run modified servo or DC on: April 27, 2012, 02:45:39 pm
Hi,
    While it is completely correct to say that you do not need a shield to drive servos, you will almost certainly need separate power, see the links in my signature for the reasons why, a demonstration why and a very simple solution using an additional 4 AA batteries.

Duane B

rcarduino.blogspot.com
1296  Using Arduino / Programming Questions / Re: Simultaneous Servo issue on: April 27, 2012, 02:36:04 pm
Hi,

    Here is a sample program for controlling upto 12 servos using an Arduino

http://rcarduino.blogspot.com/2012/01/can-i-control-more-than-x-servos-with.html

However, you will need to consider power as well for the reasons discussed and demonstrated here and here -

http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html

http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html

You will need to modify the code quite a bit to get each servo to move at a different speed, but getting the number you want to move reliably first is a good step so have a good look at the three posts, particularly the power posts.

Duane B

rcarduino.blogspot.com
1297  Using Arduino / Programming Questions / Re: Precision of PWM input reading on: April 27, 2012, 01:16:45 pm
Hi,
   Thanks for the thanks :-)

   I didn't progress the development of that algorithm as my new radio improved the quality of the input data to the point that I no longer needed to smooth it.

The other reason I didn't progress it is that the car motor and steering respond much more slowly that the Arduino is able to measure the signals. In effect the car has built in signal smoothing just because the mechanical components have momentum and are unable to react at digital speeds, so the signal noise cancels itself before the car is able to respond.

There are quite a lot of smoothing algorithms around that average across multiple samples, these provide better results than my algorithm, but require more memory to hold multiple samples for each channel and will respond less quickly to large moves in the control input. If you keep the number of samples low memory and response speed should not be a problem, I would suggest you try this rather than my algorithm.

Duane B

rcarduino.blogspot.com

1298  Using Arduino / Programming Questions / Re: Precision of PWM input reading on: April 27, 2012, 08:02:03 am
Hi,
   Thinking about it, your data is a lot less stable than mine, I tend to get a steady 1504 which will occasional read 1500 or 1508. This is since I changed radios to a Spectrum 2.4 Ghz radio, with my previous 27Mhs AM Radio, my readings were like yours and deteriorated very badly over distance - my application runs in my RC Race cars at 200 meters distance moving at 40Km/h.

See here for some more information -

Data from my 27Mhz and a strategy to clean it up
http://rcarduino.blogspot.com/2012/01/how-to-read-rc-receiver-with_20.html

Data comparison with new radio
http://rcarduino.blogspot.com/2012/03/reading-from-rc-reveiver-do-you-need.html

In your case, depending on your application and if you do not want to invest in a new radio, a simple smoothing algorithm might be your best option.

Duane B.

rcarduino.blogspot.com
1299  Using Arduino / Programming Questions / Re: Precision of PWM input reading on: April 27, 2012, 07:50:25 am
Hi,
    Yes I do get a 4 or 8us error, its is unavoidable and due to interrupts queuing up. For example if a timer fires, then an input pin goes high and then another input pin goes low, one of the ISRs will have to wait for the other complete one after the other before it can be serviced, this takes around 8us.

It works out at about a 1% error across the 1000us to 2000us range of an input signal.

Duane B

rcarduino.blogspot.com
1300  Using Arduino / Programming Questions / Re: Precision of PWM input reading on: April 27, 2012, 07:08:55 am
Hi,
   Try my code from this blog post, many others are using it successfully -

http://rcarduino.blogspot.com/2012/04/how-to-read-multiple-rc-channels-draft.html

Your code has at least one major problem which is that there is no protection on shared variable access, in which case you data will generally contain nonsense as you are experiencing. Read the post above to see why, then try the sample code provided and let me know if you see an improved result.

Duane B

rcarduino.blogspot.com

1301  Using Arduino / Programming Questions / Re: Timing and speed issues with pin change interrupt based routines - Arduino slow? on: April 26, 2012, 11:11:25 am
Hi,
   Post your code, its possibly an error in the way you are managing variable access.

   500*12 is 6000, so 18,000,000 divided by 6000 = 2,666 clock cycles available to process each interrupt. A pin change interrupt takes around 68 clock cycles to process depending on the ISR content.

One potential problem is that if all of your pins change at the same time it will take around 700 clock cycles to get through all the ISRs, thats about a 40 microsecond log jam of interrupts.

To eliminate variable access check out this post, its using pin change ints at a much lower frequency but outlines a variable access/protection strategy.

http://rcarduino.blogspot.com/2012/04/how-to-read-multiple-rc-channels-draft.html

Duane B

rcarduino.blogspot.com

1302  Using Arduino / Motors, Mechanics, and Power / Re: Control an ESC from Velineon on: April 25, 2012, 11:30:21 am
Hi,
  It was once common opinion that you should never run a brushless motor like yours at high speed with no load attached. I have no idea if this is still true, if it was ever true or why it might be so, but please do your own research on this before you possibly kill an expensive motor.

  Also brushless motors have a KV rating which is the number of thousands of RPM the motor will do per available volt, this should be easy to look up.

Duane B

1303  Topics / Robotics / Re: Ping))) and Servo on: April 24, 2012, 10:55:45 pm
Hi,
   As others have said most likley power, check the links in my signature for an idea of whats happening, a demonstration video and how to fix it.

Duane B

rcarduino.blogspot.com
1304  Using Arduino / Motors, Mechanics, and Power / Re: Control an ESC from Velineon on: April 24, 2012, 10:52:45 pm
Hi,
   See here http://rcarduino.blogspot.com/2012/04/how-to-read-multiple-rc-channels-draft.html

The code in setup should do it.

You will also need to make sure that you have external power such as a lipo powering the ESC and motor and also that you have the ground wire connected between the Arduino and the ESC.

Duane B

rcarduino.blogspot.com
1305  Using Arduino / Programming Questions / Re: AVR STUDIO vs ARDUINO on: April 24, 2012, 10:47:42 pm
Hi,
   I would suggest go with Arduino first, I installed AVR Studio last night having used Arduino for three months. I haven't got any code onto a chip yet with AVR Studio but can already see there are many more configurations I will need to work through before I do. With Arduino it was pretty much plug and play.

The Arduino libraries also give a nice introduction to the underlying hardware, for example if you read through the source code of the Servo library you will learn a lot about the interrupts and timers. This is all knowledge that you can carry over to AVRStudio as and when you decide to.

Duane.

rcarduino.blogspot.com
Pages: 1 ... 85 86 [87] 88 89 ... 114