Show Posts
Pages: 1 ... 85 86 [87] 88 89 ... 114
1291  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

1292  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
1293  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
1294  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

1295  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

1296  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

1297  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
1298  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
1299  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
1300  Using Arduino / Programming Questions / Re: How to create a 38 Khz pulse with arduino using timer or PWM? on: April 24, 2012, 10:42:10 pm
Hi,
   If all you are trying to do is generate a 38khz carrier, switched at 1khz, why not do it in hardware with a single 556 Timer, that what this does -

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

It costs about 2 dollars to build.

Duane B

rcarduino.blogspot.com
1301  Using Arduino / Project Guidance / Re: Tach and speed attachinterrupt on: April 24, 2012, 10:35:04 pm
Hi,
   I can't comment on your choice of sensors, but what your are trying to do in principle is well within the capabilities of an UNO. If you wanted more interrupts to monitor all four wheels, you could use the pcintchange library -

http://rcarduino.blogspot.com/2012/03/need-more-interrupts-to-read-more.html

Duane B

rcarduino.blogspot.com
1302  Using Arduino / Programming Questions / Re: Book on: April 24, 2012, 10:08:33 am
Hi,
   Thats true, but its still interesting to look at the assembler, I assumed that some functions would be inlined but they are not, its also interesting to see how many cycles anything involving a volatile long takes - read four bytes from memory to register, do something to four bytes, write four bytes back to memory.

  I am interested because the RC Channel signals I am dealing with are 500us from neutral to full throttle, I will often have a situation with several pending interrupts, the lowest priority interrupt can be forced to wait 8us or more which shows up as a 2% error in the desired output signal.

I have half a dozen strategies to reduce this and will be working on them over the coming few days.

Duane B

rcarduino.blogspot.com

1303  Using Arduino / Programming Questions / Re: WinAVR, AVRStudio or AVR-GCC on: April 24, 2012, 08:57:05 am
Hi,
   Thanks, I have just been looking at AVR Studio 5.1 and notice that it says 'no longer need to download a separate tool chain'. I am downloading it now to have a look.

Duane B

rcarduino.blogspot.com
1304  Using Arduino / General Electronics / Re: op amp audio amplifier circuit help/suggestion on: April 24, 2012, 07:34:12 am
Hi,

I want to extend my vu meter to be frequency based, I was thinking of having three or four bands with each band having it's own vu meter based on the resistor ladder/comparator circuit.

I am not sure whether I should take the signal through three opams with unity gain which will feed three copies of the input signal to three separate filters or whether I can skip this buffer stage and go straight into a branch to three filters without the opamps splitting out/bufferong three copies of the signal first to three separate filters.

I have added an additional line out from my Audino synth so either way I can figure out what works using the Audino as a frequency generator.

If anyone has some previous experience, please share otherwise I will get back withnhow I get on in a few days time.

Duane

1305  Using Arduino / Motors, Mechanics, and Power / Re: servo Clock on: April 24, 2012, 07:23:24 am
Hi,
If you are referring to my post I am concerned that you read some part of it as recommending 18volts into a servo. Please don't do this, it's three times more voltage than you should be applying, can you also point me to the part of my post that lead you to this thought, I will change it so that others do not read it the same way in future.

Thanks

Duane B

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