12 PWM output channels on PX4 (and telemetry port moved!)

964 views
Skip to first unread message

Andrew Tridgell

unread,
Apr 25, 2013, 6:48:43 AM4/25/13
to drones-...@googlegroups.com
Hi All,

I've just pushed a change that allows PX4 to use 12 PWM output channels
if you use a PX4IO board. The first 8 channels are on the PX4IO servo
rail, and the next 4 channels are from the FMU board.

You can get at the 4 FMU channels in one of two ways:

- via the 15 pin 'multi' connector (see the manual)

- via 3 of the /dev/ttyS1 (UART2) pins, allowing access to channels
RC_9, RC_11 and RC_12.

These additional channels are enabled in master for ArduCopter and
ArduPlane (rover doesn't yet support beyond 8 channels, but usually only
uses 2 for vehicle control, leaving 6 for aux channels).

In order to implement this change I needed to move the default radio
telemetry port for APM on PX4 from ttyS1 (called UART2 in the manual) to
ttyS2. This means the two 5-pin serial connectors on the end of the
PX4IO board near the USB connector are now:

- the 5 pin connector closest to the USB port is for RC_9, RC_11 and
RC_12, plus 5v and GND.

- the 5 pin connector in the middle of that end of the PX4IO board is
now the radio telemetry port

With these changes it will be possible to support camera gimbals for
ArduCopter for quad, hexa, octa etc. On a quad you could use the 4 spare
servo rail outputs (RC5 to RC8). On a hexa or octa you will need to use
the extra outputs from the FMU (RC9 to RC12).

Note that you should not use the two spare servo output rail channels on
a hexa for a camera gimbal unless you have servos that can handle very
high update rates. Those channels will run at 400Hz, and must run at the
same rate as RC5 and RC6 due to the way the timers are arranged.

Cheers, Tridge

Robert Lefebvre

unread,
Apr 25, 2013, 7:43:36 AM4/25/13
to drones-discuss
This is pretty good Tridge and will be useful I hope but... can any servos handle 400Hz?  I'm not sure. That's really high.



--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Meier Lorenz

unread,
Apr 25, 2013, 7:46:12 AM4/25/13
to drones-...@googlegroups.com
Fully digital ones might well be able to deal with that, if their internal processing obeys the actuator limit.

-Lorenz



-------- Ursprüngliche Nachricht --------
Von: Robert Lefebvre <robert....@gmail.com>
Datum:
An: drones-discuss <drones-...@googlegroups.com>
Betreff: Re: [drones-discuss] 12 PWM output channels on PX4 (and telemetry port moved!)


This is pretty good Tridge and will be useful I hope but... can any servos handle 400Hz? I'm not sure. That's really high.


To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com<mailto:drones-discuss%2Bunsu...@googlegroups.com>.

Marco Robustini

unread,
Apr 25, 2013, 8:00:02 AM4/25/13
to drones-...@googlegroups.com, and...@tridgell.net
Thanks Tridge, fantastic news, but i don't think 400 Hz output is good also for expensive digital servos.
Please contact Roberto, he has enabled 4 auxiliary ports for servos on VR Brain to about 130 Hz, in which case many digital servos work without trouble.

Marco

Meier Lorenz

unread,
Apr 25, 2013, 8:04:06 AM4/25/13
to drones-...@googlegroups.com, and...@tridgell.net
Just to not confuse people: The three outputs Tridge enabled are 50Hz. And on a quad you can have 50 Hz in the back as well.


-------- Ursprüngliche Nachricht --------
Von: Marco Robustini <robusti...@gmail.com>
Datum:
An: drones-...@googlegroups.com
Cc: and...@tridgell.net
Betreff: [drones-discuss] Re: 12 PWM output channels on PX4 (and telemetry port moved!)

Marco Robustini

unread,
Apr 25, 2013, 8:11:51 AM4/25/13
to drones-...@googlegroups.com, and...@tridgell.net, Meier Lorenz
Oops, I misread it, thanks!

Robert Lefebvre

unread,
Apr 25, 2013, 8:49:55 AM4/25/13
to drones-discuss
Ah!  I see I misread as well.  Sorry!

Gary McCray

unread,
Apr 25, 2013, 1:05:08 PM4/25/13
to drones-...@googlegroups.com, and...@tridgell.net
Hi All,

The problem with the 400hz servos is not the update rate of the servos, but the update frequency of the update loop.
If you are actually running the update loop at 400hz and you have built in software smoothing it would work fine.

I don't think we have anything like that.

If this uses the same 50hz update loop as the APM and you use 400hz servos the servo is way faster than the update loop, which means the servos start and stop all the time.
EG: really jerky servo movement.

A 400hz servo at a 50hz software loop update rate has us chasing our tail.

Our band aid has been to use slow servos on the slow channel to compensate for the slow update loop and lack of built in smoothing.

Brushless, low resolution low cog gimbal motors do the same thing.

The right solution is 400hz servos, 400hz update rate and firmware smoothing.
All other solutions end up jerky or mushy.

I could be wrong here, but it is what my experiences seem to indicate.

This is probably not soluble for the APM but my guess is that the PX4 could probably handle it.

Just a thought,

Gary

john...@gmail.com

unread,
Apr 25, 2013, 1:52:20 PM4/25/13
to drones-...@googlegroups.com, and...@tridgell.net
On digital servos, the PWM input frequency is decoupled from the actuall motor update frequency since the servo has a internal mcu controlled motor driver. Meaning the digital servo will refresh at the same internal frequency regardless of input. So in general higher PWM refresh means you get closer to the ideal update possible with the digital servo in question. Analog servos is a whole nother ballgame where each any every servo brand has to be carefully tested, and anything above 100hz usually end up releasing the magic smoke stored in the servo..

Another issue is the servo movement being jerky on APM. This I suspect has more to do with uneven timing on the update of servo positions because of workload issues, then the actual frequency of the update.

- JAB

Robert Lefebvre

unread,
Apr 25, 2013, 2:01:26 PM4/25/13
to drones-discuss, Andrew Tridgell
A year ago, maybe more than a year ago, I found the servo motion on my heli to be "coarse", but it is not now.  I think something changed. I know there was work on the RC_Speed stuff at some point and that seems to have fixed it all up.


--

Gary McCray

unread,
Apr 25, 2013, 2:03:45 PM4/25/13
to drones-...@googlegroups.com, and...@tridgell.net
Hi Andrew,

I have updated the ArduCopter Wiki to explain the new connector position for the telemetry radio.

And I will update it to cover the new 3 new servo control lines that are on the port connector on the PX4IO board.

I know there is discussion related to I2C sonar on the PX4, but if we are going to use analog, the SPI connector exposes 2 of the PX4's analog inputs.

I would really like to know if the 2 (analog) Miso and Mosi pins (3 & 4) on the PX4IO SPI connector are what ArduRover should be using for its 2 sonars.

And if you could map them so that we can use them with the SONAR1_PIN and SONAR2_PIN advanced parameter assignments.

And let me know what those numbers would be I would really appreciate it.

Thank You,

Gary

On Thursday, April 25, 2013 3:48:43 AM UTC-7, Andrew Tridgell wrote:

Craig Elder

unread,
Apr 25, 2013, 3:43:05 PM4/25/13
to drones-discuss, Andrew Tridgell
Thanks for the code change Tridge and the documentation change Gary.

Documentation people are the unsung heros of our project so it is fabulous to see the docs being updated as fast as the code is.

cheers,

Craig


--

Gary McCray

unread,
Apr 25, 2013, 5:49:47 PM4/25/13
to drones-...@googlegroups.com, and...@tridgell.net
Hi Tridge,

I just updated the New ArduCopter Wiki Camera Mount page with the information on the PX4 Gimbal servo assignments here. http://copter.ardupilot.com/wiki/arducopter/optional-additions/camera-mount/

And I would very much your checking it for accuracy, I interpreted the pins based on what you said, but I could easily be wrong.

That connector is shown as having 3.3 volt power and I suggested using externally supplied power and ground. 
Also the PX4's power supply doesn't really seem to reliably have enough poop for this.

I already updated the wiring section to reflect that the 3DR radio moved over to the adjacent connector.

BTW can (or should) I use the SPI connector Mosi and Miso (analog pins) for the SONAR1 and SONAR2 in ArduRover and if so will you map them in the Advanced Param list so we can access them and let me know what numbers to use?

Thank You,

Gary  



On Thursday, April 25, 2013 3:48:43 AM UTC-7, Andrew Tridgell wrote:

Craig Elder

unread,
Apr 25, 2013, 7:15:59 PM4/25/13
to drones-discuss, Andrew Tridgell
Gary that connector for the serial port was shown incorrectly at one time with 3.3V.  It should show 5V now.


--

Gary McCray

unread,
Apr 25, 2013, 9:37:52 PM4/25/13
to drones-...@googlegroups.com, Andrew Tridgell
Thank You Craig, 

I went to the PixHawk site and sure enough, now they are 5 volts.
I will fix that in the New ArduCopter and ArduRover Wikis.

I still don't think we should drive the camera servos from the PX4IO's power supply though, 2 amps is pretty light and it could cause a brown out just trying to stabilize the camera.

I have just finished updating the New ArduCopter Wiki's Configuration page for the PX4 here: http://copter.ardupilot.com/wiki/arducopter/configuration/
I verified it works by following my own procedures with my own PX4 system.
I think that is the final absolute necessity for setting up and flying a PX4 multicopter.
But if anybody can think of anything else, please let me know.

We do need to start making the New Wiki more publicly accessible, the PX4 stuff is mostly in there and I'm not keen on moving it all to the old one too.

PS: Use my table of contents to get around in the ArduCopter Wiki for now.
They are messing around with the whole menu structure for tablet compatibility. 
You can get to the table of contents at the bottom of the Arducopter (Quick Start) page.

Thank You,
Gary

Meier Lorenz

unread,
Apr 26, 2013, 1:47:59 AM4/26/13
to <drones-discuss@googlegroups.com>, Andrew Tridgell
Gary,

This is great work, keep it up!

There is no risk browning out PX4 on those pins, it will shut down the power supply to the USART plugs if your servo draws too much power. That's the "hard to kill" part of our design 8).

It would brown out the other peripherals (radio, GPS has a different supply and won't brown out) though, so its indeed important to let people know that they should only connect the signal pins.

-Lorenz

------------------------------------------------------
Lorenz Meier
Institute for Visual Computing
ETH Zurich
http://www.inf.ethz.ch/personal/lomeier/

Am 26.04.2013 um 03:37 schrieb Gary McCray <garyr...@gmail.com<mailto:garyr...@gmail.com>>:

Thank You Craig,

I went to the PixHawk site and sure enough, now they are 5 volts.
I will fix that in the New ArduCopter and ArduRover Wikis.

I still don't think we should drive the camera servos from the PX4IO's power supply though, 2 amps is pretty light and it could cause a brown out just trying to stabilize the camera.

I have just finished updating the New ArduCopter Wiki's Configuration page for the PX4 here: http://copter.ardupilot.com/wiki/arducopter/configuration/
I verified it works by following my own procedures with my own PX4 system.
I think that is the final absolute necessity for setting up and flying a PX4 multicopter.
But if anybody can think of anything else, please let me know.

We do need to start making the New Wiki more publicly accessible, the PX4 stuff is mostly in there and I'm not keen on moving it all to the old one too.

PS: Use my table of contents to get around in the ArduCopter Wiki for now.
They are messing around with the whole menu structure for tablet compatibility.
You can get to the table of contents at the bottom of the Arducopter (Quick Start) page.

Thank You,
Gary

On Thursday, April 25, 2013 4:15:59 PM UTC-7, Craig@3DR wrote:
Gary that connector for the serial port was shown incorrectly at one time with 3.3V. It should show 5V now.


To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com<javascript:>.
--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com<mailto:drones-discus...@googlegroups.com>.

Robert Lefebvre

unread,
Apr 26, 2013, 7:35:04 AM4/26/13
to drones-discuss
Gary, the last mandatory thing that I can think of for flying is external LED control.  Still need to get that done (don't think it has been yet?)


Gary McCray

unread,
Apr 26, 2013, 12:29:19 PM4/26/13
to drones-...@googlegroups.com, Andrew Tridgell
Great Lorenz,
I knew the PX4IO provided an additional level of circuit protection, just wasn't clear on exactly how, I will make it clear on the Wiki.
Gary
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com<mailto:drones-discuss+unsubscribe@googlegroups.com>.

Gary McCray

unread,
Apr 26, 2013, 12:32:52 PM4/26/13
to drones-...@googlegroups.com
Hi Robert,
I agree and would really like to see the BlinkM interfaced, could use one of the serial ports for that on the PX4.
Shaking loose spare bits on the PX4 for direct LED control seems a bit more complicated.
Gary
Reply all
Reply to author
Forward
0 new messages