Show Posts
Pages: 1 ... 104 105 [106] 107 108 ... 114
1576  Using Arduino / Programming Questions / Re: servo's presence on startup hangs sketch on: February 19, 2012, 12:21:57 pm
Hi,
    You definitely don't want one on the 5V, but it might be worth trying a 1K resistor on the signal wire.

Duane.
1577  Using Arduino / Programming Questions / Re: servo's presence on startup hangs sketch on: February 19, 2012, 11:17:37 am
Hi,
    This is worth a quick shot, connect the servo signal wire to Arduino through a resistor, try 330 Omhs, it may well not be the problem, but its one more thing you can easily eliminate.

    Sorry for asking this, but you have got a shared earth between the Arduino and Servo ?

Duane B.

rcarduino.blogspot.com
1578  Using Arduino / Motors, Mechanics, and Power / Re: New to Arduino question about motor control on: February 19, 2012, 10:21:06 am
Hi,
    This is the post I thought you might find relevant - basically using set zones within the throttle signal to trigger a mode change or initiate a preset sequence of actions, such as panning some turrets to a set point -

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

Duane B

rcarduino.blogspot.com
1579  Using Arduino / Motors, Mechanics, and Power / Re: New to Arduino question about motor control on: February 19, 2012, 09:04:11 am
Hi,
   You can control many servos from a single Arduino, you can also modify servos for constant rotation in case you wanted to be able to rotate your turrets through more than a complete rotation. To do this all you will need is an external power source for the servos, I am assuming that you boat uses nimh, nicad or Lipo batteries like my cars do, in which case they will provide all of the power you need.

Have a look at my blog for lots of posts regarding reading from rc receivers, controlling servos and on that might be of particular interest to you regarding a cheat for adding extra channels.

Duane B

rcarduino.blogspot.com

1580  Using Arduino / Programming Questions / Re: servo's presence on startup hangs sketch on: February 19, 2012, 04:20:30 am
Hi,
   Have you tried using the servo with external power ? it might be that with all of your other hardware connected there is too much current draw during start up. The current demands of the hardware may be less after an initial draw at start up which is why your servo then works.

   Just an idea, but it should be easy for you to test with a 9v battery, just make sure that the servo has a common ground connection with you Arduino.

Duane B.

rcarduino.blogspot.com
1581  Using Arduino / Project Guidance / Re: Using ServoTimer2 and ServoDecode with 8MHz Arduino on: February 18, 2012, 01:34:27 pm
Hi,
    Are you reading the signal directly from the transmitter or from a port on the receiver ?
   
    As for the cars, you can have a lot of fun with a Tamiya M03, small, fast enough, tough to break, and simple enough that a child can help with some of the building.

See here for a few of my own M03's and some advice you won't ever get a hobby shop -
http://rcarduino.blogspot.com/2012/02/newbie-advice-and-new-take-on-everyday.html

Duane B.

rcarduino.blogspot.com
1582  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
1583  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

   
1584  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
1585  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.
1586  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.
 
1587  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
1588  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

1589  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
1590  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
Pages: 1 ... 104 105 [106] 107 108 ... 114