Dubai, UAE
Offline
Edison Member
Karma: 20
Posts: 1626
|
 |
« Reply #30 on: September 30, 2012, 02:49:43 pm » |
Hi, A really good way to learn is to look at the .cpp and .h files of the existing servo library. In particular have a look through the interrupt service routine it does exactly what you want on any pin you choose using only one 16 bit timer. It refreshes at 50hz, you might want something faster, but as a first step I strongly recommend you get familiar with the servo library. For a quick introduction to what it does and how it does it see here - http://rcarduino.blogspot.com/2012/01/can-i-control-more-than-x-servos-with.htmlThen read through the handle_interrupts function in the .cpp file or have a look at the code here which is a lot cleaner as it doesn't include all of the extra work to run on multiple Arduino platforms - http://rcarduino.blogspot.com/2012/08/arduino-serial-servos.htmlIt also uses the same principle as the standard servo library. Lastly, unless I am missing something you are looking to drive ESCs which require a servo style signal not a PWM signal, the code suggested in another response is not suitable for your application if I have understood it correctly. Duane B
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 114
Posts: 2205
|
 |
« Reply #31 on: September 30, 2012, 04:04:07 pm » |
[quote]which require a servo style signal not a PWM signal A servo style signal IS PWM.
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15310
Measurement changes behavior
|
 |
« Reply #32 on: September 30, 2012, 05:38:00 pm » |
[quote]which require a servo style signal not a PWM signal A servo style signal IS PWM. Yes, but a servo control signal is a specifically defined subset of a typical true PWM signal, where the duty cycle (1-2msec) and frame rate (20-25msec) is 'standarized' amoung devices designed to receive 'servo commands'. So a servo signal has a variable duty cycle of 5% to 10%. This was to allow for several (up to 8 typically) channels of servo pulse width information to be encoded into a serial data stream, the so called PPM encoding stream used with radio control servo applications. Where as a true general purpose PWM signal usually allows for a complete 0-100% duty cycle at whatever switching frequency works best for a specific application.
|
|
|
|
« Last Edit: September 30, 2012, 05:45:05 pm by retrolefty »
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 114
Posts: 2205
|
 |
« Reply #33 on: September 30, 2012, 05:51:54 pm » |
Yes, but a servo control signal is a specifically defined subset of a typical true PWM signal, So you confirmed what we have been saying: the servo signal is necessarily PWM and a PWM signal isn't necessarily a servo signal. frame rate (20-25msec) is 'standarized' amoung devices designed to receive 'servo commands'. I think you have plenty counter examples of that in this thread.
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15310
Measurement changes behavior
|
 |
« Reply #34 on: September 30, 2012, 06:17:59 pm » |
Yes, but a servo control signal is a specifically defined subset of a typical true PWM signal, So you confirmed what we have been saying: the servo signal is necessarily PWM and a PWM signal isn't necessarily a servo signal. Agreement is good.  frame rate (20-25msec) is 'standarized' amoung devices designed to receive 'servo commands'. I think you have plenty counter examples of that in this thread. I'm not so sure of that. I've read several opinions and statements here, but I've yet to see a link to a datasheet for a ESC that was designed to handle both standard servo signals and some propritary non standard PWM switching and duty cycle control signal. Not saying one doesn't exist, but it would certainly not be a typical common ESC. I would like to read more details on real products offered, as there are likely to be applications where such higher performance control would be useful or required.
|
|
|
|
« Last Edit: September 30, 2012, 06:24:08 pm by retrolefty »
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 114
Posts: 2205
|
 |
« Reply #35 on: September 30, 2012, 06:32:12 pm » |
I'm not so sure of that. Erni and Duane pointed out a few examples earlier. But servos we use are essentially PPM devices.
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Denmark
Offline
God Member
Karma: 19
Posts: 674
|
 |
« Reply #37 on: October 01, 2012, 06:03:18 am » |
|
|
|
|
« Last Edit: October 01, 2012, 06:42:09 am by Erni »
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15310
Measurement changes behavior
|
 |
« Reply #38 on: October 01, 2012, 08:39:52 am » |
That is interesting, and I can see that lots of users and vendors have done lots of work in trying to identify componets that work well above standard servo framing rates, but I don't see a datasheet from an original manufacture stating it's designed to work at other then 'standard' servo update/pulse width control. I see one venndor/supplier that stated they perform a firmware changed/updated, others just tested at non-standard rates. That's not to say these are not viable to use, but seems to rely on this vary caution: How do I know if my ESCs are compatible? The only way to test it is to apply different input PWM frequency signals, make them change from low to high, and vice-versa. Check the motor response (notice how fast it achieves the desired RPMs after the input data changes, using tachometers). You should also check if it responds reliably, does not lose the sync, etc. That implies that the original manufactures of the ESC don't rate them for other then standard 'servo timing', and that some users and vendors have taken on a task to seek out units that can be made to work at other then standard conditions. So once again is there any datasheets from an original manufacture, rather then a vendor/seller/user, that documents it's design PWM input rates and pulse width outside the standard servo timing rates? Lefty
|
|
|
|
« Last Edit: October 01, 2012, 08:41:51 am by retrolefty »
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 114
Posts: 2205
|
 |
« Reply #39 on: October 01, 2012, 04:56:40 pm » |
I don't see a datasheet from an original manufacture stating it's designed to work at other then 'standard' servo update/pulse width control. Many of the servos are analog: it takes the pwm pulse train through a low-pass filter to derive at a voltage signal (to be compared with a position sensor's output). Because of such, a higher pwm frequency will always work - but a lower frequency may not.
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15310
Measurement changes behavior
|
 |
« Reply #40 on: October 01, 2012, 09:12:40 pm » |
I don't see a datasheet from an original manufacture stating it's designed to work at other then 'standard' servo update/pulse width control. Many of the servos are analog: it takes the pwm pulse train through a low-pass filter to derive at a voltage signal (to be compared with a position sensor's output). Because of such, a higher pwm frequency will always work - but a lower frequency may not. I take such statements as not understanding the question. The site said one must first test a servo for higher framing rates, why would they state such if higher pwm frequecies 'always work'? Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Denmark
Offline
God Member
Karma: 19
Posts: 674
|
 |
« Reply #41 on: October 03, 2012, 05:46:01 am » |
I don't see a datasheet from an original manufacture stating it's designed to work at other then 'standard' servo update/pulse width control. I was suprised when I started looking for datasheets for ESC's that I couldn't find any specification of the update/pulse width. The only thing I could find was Castle Creation (one of the top brands of ESC's) has announced an upgrade to their firmware that should make their ESC suitable for multirotors. So I could ask the same question to retrolefty: How do you know that the standard servo update/pulse is within the specifikations when there is none. ?  <- smiley I think (I presume) that this standard servo specification goes back to the good old happy days of ppm TX/RX. AFter we have got all the pcm/spcm/spread spectrum technic it seems like vendors are more relaxed about the specifications. for example if you look at the Spektrum DX8: http://www.spektrumrc.com/Products/Default.aspx?ProdID=SPMAR7610it states: High-speed 11ms frame rate. And although there has been numerous complaints with this system, if have not heard of any having trouble with their standard ESC.
|
|
|
|
« Last Edit: October 03, 2012, 05:47:54 am by Erni »
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15310
Measurement changes behavior
|
 |
« Reply #42 on: October 03, 2012, 11:09:28 am » |
I don't see a datasheet from an original manufacture stating it's designed to work at other then 'standard' servo update/pulse width control. I was suprised when I started looking for datasheets for ESC's that I couldn't find any specification of the update/pulse width. The only thing I could find was Castle Creation (one of the top brands of ESC's) has announced an upgrade to their firmware that should make their ESC suitable for multirotors. So I could ask the same question to retrolefty: How do you know that the standard servo update/pulse is within the specifikations when there is none. ?  <- smiley Because a ESC sold with a standard servo control connector strongly implies that it is suitable for the 'standard' variable pulse width and frame rate specifications that the R/C hobby has been using for many decades now, unless they stated otherwise in their datasheet. As such I would not assume any operation far from that 'standard' timings unless also documented in their datasheet. I think (I presume) that this standard servo specification goes back to the good old happy days of ppm TX/RX. Of course, that's my point. This thread is about using R/C type ESCs at frame rates well above that 'R/C standard' which seems to be possible via hand testing of some units from some manufactures. I question was really about OEMs documenting/verifying operation at other faster framing rates.AFter we have got all the pcm/spcm/spread spectrum technic it seems like vendors are more relaxed about the specifications. for example if you look at the Spektrum DX8: http://www.spektrumrc.com/Products/Default.aspx?ProdID=SPMAR7610it states: High-speed 11ms frame rate. That's a start, that would mean they are rating their device able to support up to twice the framing rate, maybe other OEMs will also start documenting such specifications. And although there has been numerous complaints with this system, if have not heard of any having trouble with their standard ESC.
|
|
|
|
« Last Edit: October 03, 2012, 11:11:27 am by retrolefty »
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 114
Posts: 2205
|
 |
« Reply #43 on: October 03, 2012, 12:50:02 pm » |
maybe other OEMs will also start documenting such specifications. Or maybe this is one of those cases that you are presumed to have known that. Turning on a computer is vital to you programming your arduino yet you see no mentioning of turning on your computer in any arduino book.
|
|
|
|
|
Logged
|
|
|
|
|
Denmark
Offline
God Member
Karma: 19
Posts: 674
|
 |
« Reply #44 on: October 03, 2012, 03:11:22 pm » |
That's a start, that would mean they are rating their device able to support up to twice the framing rate, maybe other OEMs will also start documenting such specifications.
No that is the output framerate from the receiver. My point is that you connect this to a standard ESC !
|
|
|
|
|
Logged
|
|
|
|
|
|