BMMCC PWM Specs

The place for questions about shooting with Blackmagic Cameras.
  • Author
  • Message
Offline

Marc Koecher

  • Posts: 61
  • Joined: Thu Sep 20, 2012 6:58 pm

BMMCC PWM Specs

PostFri Mar 25, 2016 7:53 pm

Hi,

I'm trying to gain control via PWM on the servo inputs of the expansion port. Not much documentation that I can find. From the image on the site, I gather:
- logic operation range of 0-5V
- Frequency of 50Hz (20ms)
- Duty cycle range: 1ms - 2ms (not sure why it doesn't use up to 50% though).

I've gone back to basics with an Arduino manually generating a Pulse. Unfortunately nothing seems to be working. I can trigger increments when I manually plug/unplug the signal cable but can't seem to get further.

A bit about the Arduino code, in case I'm doing something wrong there.
Here's the basic version I'm using to, for instance create a manual 1ms pulse at 50z:
Code: Select all
void setup()
{
  pinMode(13, OUTPUT);
}

void loop()
{
  digitalWrite(13, HIGH);
  delayMicroseconds(1000);
  digitalWrite(13, LOW);
  delayMicroseconds(19000);
}


Here's another one that I started from with variable potentiometer input:
http://www.arduino.cc/en/Tutorial/Knob

Any help is much appreciated in order to generate the appropriate control signal.

Marc
Offline

Marc Koecher

  • Posts: 61
  • Joined: Thu Sep 20, 2012 6:58 pm

Re: BMMCC PWM Specs

PostFri Mar 25, 2016 8:08 pm

Hi Kim,

Yes. Unfortunately that's what the last link pointed to. I've also gone into the servo.h library to change some default parameters to more closely match the stuff I found on the Blackmagic product page. Still nothing seems to work :(
Offline

Marc Koecher

  • Posts: 61
  • Joined: Thu Sep 20, 2012 6:58 pm

Re: BMMCC PWM Specs

PostFri Mar 25, 2016 9:50 pm

It definitely could be my fault Kim ;) I'm always happy to find out when I'm wrong. I don't actually have any regular RC stuff. In fact, my current use really wouldn't require it. My very underdeveloped flying camera implementations are on an RTF basis only at the moment. One day though...

Though it's strange. A PWM signal should be a very simple signal to generate. Hence my excitement to put that to use right away. That and I was looking forward to having control sources come from different places without having to use SBUS. I also don't have any parts to make an inverter in my current moving state. The very basic static PWM signal Arduino code should work as far as I understand it...but it doesn't. Seemed to be fine on scopes when I checked. Hopefully someone from BM can chime in.
Offline

Kristian Lam

Blackmagic Design

  • Posts: 957
  • Joined: Tue Aug 21, 2012 1:11 pm

Re: BMMCC PWM Specs

PostFri Mar 25, 2016 10:53 pm

Try this sketch using the servo library to get a simple servo going. The same principle applies to the PWM input of the Micro Cinema Camera.

Code: Select all
#include <Servo.h>

Servo myservo; // create servo object

int pos = 0;

void setup() {
  // put your setup code here, to run once:

myservo.attach(9);

}

void loop() {

  for(pos = 0; pos < 180; pos += 1)
  {
    myservo.write(pos);

   delay(12);
  }

  for(pos = 180; pos>=1; pos-=1)
  {
    myservo.write(pos);
    delay(12);

  }
}
Offline

Marc Koecher

  • Posts: 61
  • Joined: Thu Sep 20, 2012 6:58 pm

Re: BMMCC PWM Specs

PostFri Mar 25, 2016 11:22 pm

Hi Kristian. Thanks so much for responding here. Unfortunately that sketch doesn't work. I actually set that one up earlier to let it loop and try things out.

Strangely I still get a value change when I connect the signal lead. Essentially a quick physical burst of voltage still causes a value increase. However, nothing beyond that. So it seems the camera is still seeing things, just not the right things. Really feels like there's some kind of sync issue here...but my practical knowledge stops there unfortunately. Oh, I also just tried a different Arduino board just in case that was the problem.
Offline

Kristian Lam

Blackmagic Design

  • Posts: 957
  • Joined: Tue Aug 21, 2012 1:11 pm

Re: BMMCC PWM Specs

PostSat Mar 26, 2016 12:52 am

And you have the correct cntrols mapped to the relevant PWM channel?
Offline

Marc Koecher

  • Posts: 61
  • Joined: Thu Sep 20, 2012 6:58 pm

Re: BMMCC PWM Specs

PostSat Mar 26, 2016 1:51 am

Yes. I've tried various combinations too. And the noted strange incrementing behaviour I noted above applies to these assignments.
Offline

George Leon

  • Posts: 178
  • Joined: Sat Mar 26, 2016 1:13 pm

Re: BMMCC PWM Specs

PostSat Mar 26, 2016 1:17 pm

Check on your scope that the signal really is 50Hz, the Arduino might be running a bit faster or slower, plus there may be some code overhead.

|Also I wonder how many steps the camera is scanning for, maybe 1ms is too little to register. Try a 25% duty cycle or similar.
Offline

Marc Koecher

  • Posts: 61
  • Joined: Thu Sep 20, 2012 6:58 pm

Re: BMMCC PWM Specs

PostSat Mar 26, 2016 11:43 pm

Hi Kim. No, they are not. The following are all the commands that are available. Pretty great to be able to have this much control away from the body. If only I could get it to work.

rec start/stop
iris
focus
zoom
iso
shutter
white balance
audio levls
Offline

Marc Koecher

  • Posts: 61
  • Joined: Thu Sep 20, 2012 6:58 pm

Re: BMMCC PWM Specs

PostSun Mar 27, 2016 2:36 pm

I've tried both a Duemilanove and a Nano to make sure one wasn't malfunctioning. Also, making sure to use various PMW-capable pins. As well as manually simulating a PWM signal on Analog pins (running out of options so I'm trying every last thing). What it really feels like is that the frequency is off somehow. Either the documentation of 50Hz is wrong...or the Arduino isn't putting that out for some reason. Though I've tried a few different methods of generating signals at that frequency (for instance: manually generating and making sure the servo.h library is set to that).

I'm using the cable that came with the camera. Trying different channels too. Figured I'd start with that before making my own cables to eliminated variables. Good to know about the notes on pin documentation though. Thanks.

Never thought about the menu buttons thing. Sounds like it could be useful for various scenarios. Mine generally involved more traditional things that are covered by the current list of controls. Always good to have more options though.
Offline

George Leon

  • Posts: 178
  • Joined: Sat Mar 26, 2016 1:13 pm

Re: BMMCC PWM Specs

PostSun Mar 27, 2016 5:29 pm

(my messages are still in moderation, so they'll probably arrive all at once).

It's possible that the BM tech details are wrong (typos etc). Try Googling for the PWN specs of remote controllers, that should confirm the correct specs.
Offline

George Leon

  • Posts: 178
  • Joined: Sat Mar 26, 2016 1:13 pm

Re: BMMCC PWM Specs

PostSun Mar 27, 2016 5:40 pm

.. here we are: https://en.wikipedia.org/wiki/Servo_control

If I read this right (and it's what BM's info also says), the full PWN range is usually between 1ms and 2ms. Which means your 1ms test is probably setting the lowest possible value. If the parameter is already on that value, it might explain why nothing seems to be happening.

BTW I agree that the arrow buttons (and I assume there is an Enter/OK button? I'm still waiting on my Micro) could be useful as remote control targets. I can't see a downside to adding them.
Offline

Marc Koecher

  • Posts: 61
  • Joined: Thu Sep 20, 2012 6:58 pm

Re: BMMCC PWM Specs

PostTue Mar 29, 2016 3:02 pm

Also, dug out a servo tester as another method of testing. Confirmed from the manufacturer that it runs at a PWM frequency of 50Hz too. Doesn't work either. Please help me Blackmagic.
Offline

Marc Koecher

  • Posts: 61
  • Joined: Thu Sep 20, 2012 6:58 pm

Re: BMMCC PWM Specs

PostThu Mar 31, 2016 12:02 am

Hi George. Sorry I didn't reply. I guess since the messages were in moderation they appeared before my last post. Yes, I think your interpretation of the way it works and specifications is correct. Unfortunately that bit of code was just one example of the most simplified signal I could be generating. I tried it at various timing values between the stated range, as well as an automatic "sweeping" program, as well as one that changes based on potentiometer input, etc. Not to mention the Servo Tester above. Unfortunately nothing seems to be working. Big head scratches here. Sent an email to BM about it the other day. No response yet though.
Offline

George Leon

  • Posts: 178
  • Joined: Sat Mar 26, 2016 1:13 pm

Re: BMMCC PWM Specs

PostThu Mar 31, 2016 12:15 am

Marc Koecher wrote:Hi George. Sorry I didn't reply. I guess since the messages were in moderation they appeared before my last post. Yes, I think your interpretation of the way it works and specifications is correct. Unfortunately that bit of code was just one example of the most simplified signal I could be generating. I tried it at various timing values between the stated range, as well as an automatic "sweeping" program, as well as one that changes based on potentiometer input, etc. Not to mention the Servo Tester above. Unfortunately nothing seems to be working. Big head scratches here. Sent an email to BM about it the other day. No response yet though.


OK just one more idea - I haven't done any servo-specific stuff (but lots of microntroller PWM), but is there voltage coming _out_ of the camera? If so, maybe you're supposed to PWM that voltage (eg. with a MOSFET switch, or maybe just sinking it in your pin set as input), rather than outputting your own voltage from a micro pin? Just a thought.
Offline

George Leon

  • Posts: 178
  • Joined: Sat Mar 26, 2016 1:13 pm

Re: BMMCC PWM Specs

PostThu Mar 31, 2016 12:18 am

... have you tried inverting the signal (eg. 2ms off, 18ms on)?
Offline

Marc Koecher

  • Posts: 61
  • Joined: Thu Sep 20, 2012 6:58 pm

Re: BMMCC PWM Specs

PostThu Mar 31, 2016 12:25 am

Good thinking George. Interestingly there is ~1.7V coming down Pin3 (which BM labels as Ground). If what your saying is the case, it's definitely not what is implied by the specs on the product page and by the image of the PMW setup here: https://www.blackmagicdesign.com/produc ... /expansion

They show a standard Servo setup, make note of 0-5V range, the 1-2ms, and 50Hz frequency there.

Also, haven't tried inverse. Will try that one right now.
Offline

Marc Koecher

  • Posts: 61
  • Joined: Thu Sep 20, 2012 6:58 pm

Re: BMMCC PWM Specs

PostThu Mar 31, 2016 12:40 am

Nope. Inverse doesn't help either. Really appreciate the thoughts and input though :)
Offline

Kristian Lam

Blackmagic Design

  • Posts: 957
  • Joined: Tue Aug 21, 2012 1:11 pm

Re: BMMCC PWM Specs

PostThu Mar 31, 2016 12:59 am

Marc Koecher wrote:Hi Kristian. Thanks so much for responding here. Unfortunately that sketch doesn't work. I actually set that one up earlier to let it loop and try things out.

Strangely I still get a value change when I connect the signal lead. Essentially a quick physical burst of voltage still causes a value increase. However, nothing beyond that. So it seems the camera is still seeing things, just not the right things. Really feels like there's some kind of sync issue here...but my practical knowledge stops there unfortunately. Oh, I also just tried a different Arduino board just in case that was the problem.


I'm running off an Arduino UNO R3 and a pretty simple setup. The Micro Cinema Camera is with a Lumix 14-42 PZ lens.

Based on the sketch I'd attached, I have PWM Pin 9 from the Arduino going into Servo CH 1 (White) and GND into Servo CH 1 (Red) of the expansion cable. In my Remote settings, Zoom is set to "PWM 1". Running the same sketch I'd attached previously, I can get the Zoom lens zooming in and out on a loop.
Offline

Marc Koecher

  • Posts: 61
  • Joined: Thu Sep 20, 2012 6:58 pm

Re: BMMCC PWM Specs

PostThu Mar 31, 2016 1:06 am

I will try it again shortly. Thanks Kristian. Oddly enough the Product page lists Red as the signal PIN and white as ground.
Offline

Marc Koecher

  • Posts: 61
  • Joined: Thu Sep 20, 2012 6:58 pm

Re: BMMCC PWM Specs

PostThu Mar 31, 2016 1:39 am

I confirmed the pins are the way you noted: white is signal, not red. Thank you for noting that. Awesome! Unfortunately the parameter I was trying to control don't seem to work. After your comment I switched to Focus and Iris, and they work fine. Unfortunately, ISO, Colour Temp and Shutter Angle do not. I'm very relieved to see the other parameters work as I expected...but I'm still stuck on these as I was before. Do they need to sit on specific values?
Offline

George Leon

  • Posts: 178
  • Joined: Sat Mar 26, 2016 1:13 pm

Re: BMMCC PWM Specs

PostThu Mar 31, 2016 1:45 am

Sounds promising. About why only 2ms range is used, I suspect the idea is that 50Hz is responsive enough. By using only 10% of it for the signal range (2ms out of 20ms), the controller and target devices are free to spend 90% of the time doing other things, eg. handling other inputs like button, handle the GUI, or general processing.

Accordingv to the Wikipedia page, a lot of devices can be refreshed faster than 50Hz, but it varies. I'd be interested to know what refresh rate the Micro can take.
Offline

Marc Koecher

  • Posts: 61
  • Joined: Thu Sep 20, 2012 6:58 pm

Re: BMMCC PWM Specs

PostThu Mar 31, 2016 2:09 am

For anyone following. I may have figured out the other values too. Which explains the weird response I was getting earlier. They seem to be "increment" switch signals. So a 1.5ms (halfway between 1 and 2) causes an increment to cycle through the associated value list. More testing in the morning.
Offline

Kristian Lam

Blackmagic Design

  • Posts: 957
  • Joined: Tue Aug 21, 2012 1:11 pm

Re: BMMCC PWM Specs

PostThu Mar 31, 2016 2:27 am

Marc Koecher wrote:For anyone following. I may have figured out the other values too. Which explains the weird response I was getting earlier. They seem to be "increment" switch signals. So a 1.5ms (halfway between 1 and 2) causes an increment to cycle through the associated value list. More testing in the morning.


Hi Marc,

That's correct. So if you take away a part of the loop where and value decreases (or increase), you will see corresponding controls change. If not, it will just toggle between 2 values.
Offline
User avatar

Dmytro Shijan

  • Posts: 1760
  • Joined: Wed Sep 17, 2014 7:15 pm
  • Location: UA

Re: BMMCC PWM Specs

PostThu Mar 31, 2016 10:37 am

maybe it helps Futaba SBUS reverse engineered to work with Arduino http://forum.arduino.cc/index.php/topic,99708.0.html
BMMCC/BMMSC Rigs Collection https://bmmccrigs.tumblr.com
My custom made accessories for BMMCC/BMMSC https://lavky.com/radioproektor/
Offline
User avatar

Dmytro Shijan

  • Posts: 1760
  • Joined: Wed Sep 17, 2014 7:15 pm
  • Location: UA

Re: BMMCC PWM Specs

PostThu Mar 31, 2016 10:41 am

Sbus converter using Arduino http://www.ernstc.dk/arduino/sbus.html
BMMCC/BMMSC Rigs Collection https://bmmccrigs.tumblr.com
My custom made accessories for BMMCC/BMMSC https://lavky.com/radioproektor/
Offline

Marc Koecher

  • Posts: 61
  • Joined: Thu Sep 20, 2012 6:58 pm

Re: BMMCC PWM Specs

PostSat Apr 02, 2016 12:45 am

So I've now hit another wall. It seems there is a lot of jitter caused by the timer() used by servo.h. It's ISR takes time, as does writing the servo position. I have no idea how to get around it. I don't know if there's another mechanism available to time pulse, but if not, Arduino won't work. Perhaps someone smarter than me can figure this out. Unfortunately, even a little jitter on the coarse focus steps results in a very visible issue. Endlessly frustrating.

Another options is to use SBUS via Arduino since I assume that would bypass the timing critical limitation of Arduino? So, potentiometer-Arduino-SBUS controller-Camera. Really not familiar with that and was really hoping to use a simple PWM option.
Offline

Marc Koecher

  • Posts: 61
  • Joined: Thu Sep 20, 2012 6:58 pm

Re: BMMCC PWM Specs

PostSat Apr 02, 2016 3:15 pm

Hi Kim. Yes, it should be simpler :) I though nothing could be simpler than mapping voltage to PWM ranges really, but it hasn't worked flawlessly so far. In any case, I think I've solved it by using an encoder as input instead of a potentiometer. Much more predictability, immune to external induced jitter (at least from the end), and a lot more flexibility in how the control responds. I'll report back.

Kristian or anyone that has tested: do the incremented values increase/decrease based on HIGH - LOW vs LOW - HIGH transitions? Where HIGH is above 1.5ms and LOW is below 1.5ms? I assume that's the behaviour. Or does it simply register an increasing increment regardless of the direction of the PWM move? I can test this later, but though some input could save me some time.

Thanks.
Offline

Marc Koecher

  • Posts: 61
  • Joined: Thu Sep 20, 2012 6:58 pm

Re: BMMCC PWM Specs

PostSun Apr 03, 2016 2:49 pm

Finally built my little black box and it seems to be working now. Using an encoder for the focus parameter seems to have been key. There was just too much compounded jitter otherwise (even with both hardware and software filtering). Which was made even worse by the interference from the larger gimbal motors in this particular rig. Interestingly, the Servo.h library works fine here without any modification. I now have a little focus dial with push button start/stop by my hand. As well as control over aperture and one other parameter from the box itself without have to reach for the camera.

Aside: gotta say I love the form factor of this camera combined with all this control. I know reviews are starting to come out saying the form factor isn't ideal, but for me it is. Even with the pocket handheld, I always had it rigged up to some degree. At the very least with an EVF (for monitoring, ease of focusing, scopes, etc.). Not to mention, everything can share the same power source, etc. So this makes so much more sense in any rigged situation. Which for me is always, even if minimal.
Offline

Brian Tolle

  • Posts: 4
  • Joined: Wed Apr 06, 2016 5:03 am

Re: BMMCC PWM Specs

PostSun Apr 10, 2016 4:57 am

Marc,

I am building a arduino-based control box for my new BMMCC. The first prototype is using a Wii bluetooth controller to control the camera with PWM commands.

The Focus and f-stop can be controlled using the Servo.h library code like what was posted by Kristian, but I am not having any luck controlling the ISO or REC start/stop. I can trigger the REC once, or switch the ISO once; but the Servo.h code won’t cycle through ISO values, or stop recording.

Could you share any of the sketch you are using to control the start/stop button on your little black box?

Any insights would be appreciated.

Thank you,

- Brian Tolle
Offline

Stu Aitken

  • Posts: 139
  • Joined: Wed May 04, 2016 6:30 pm

Re: BMMCC PWM Specs

PostWed May 04, 2016 6:43 pm

That's correct. So if you take away a part of the loop where and value decreases (or increase), you will see corresponding controls change. If not, it will just toggle between 2 values.


Hi everyone, and especially Kim/Marc if you are around at all

would it be possible to elaborate a little on this specific topic? (I'm about to launch in to a similar exercise)

from this thread I can glean that the standard servo library works fine for zoom and focus control (jitter issues aside) in that setting the width of the pulse between 1000ms and 2000ms will set the or focus or zoom of the lens to near/far or wide/tele as expected

what I'm still confused about is the expected behavior of the other so called 'increment' controls

not quite sure how to interpret Kim's post here and Marc never posted an answer to his own question (ie can you inc down as well as up)

from the cheesy-cam video on modding the camera it appears that just a simple voltage OFF/ON/OFF change will seem to increment up but I was not sure at all what Kim's post above really meant?

is there any clearer reference for how PWM channels are supposed to affect WB/ISO/Shutter angle etc?

thanks in advance for any help!
Offline

Stu Aitken

  • Posts: 139
  • Joined: Wed May 04, 2016 6:30 pm

Re: BMMCC PWM Specs

PostThu May 05, 2016 3:41 pm

Brian Tolle wrote:Marc,

Could you share any of the sketch you are using to control the start/stop button on your little black box?

Any insights would be appreciated.

Thank you,

- Brian Tolle


can I second this?

couldn't quite work out from either Kim or Marc's posts what the actual solution was to the 'incremental' camera operations and PWM (ISO/WB/Shutter angle) and whether they could be incremented down as well as up

any help would be most appreciated!

cheers
Offline

Stu Aitken

  • Posts: 139
  • Joined: Wed May 04, 2016 6:30 pm

Re: BMMCC PWM Specs

PostThu May 05, 2016 5:27 pm

Kristian, any chance you could expand on your previous reply here?

I admit I didn't quite understand what you were getting at when you previously tried explaining this to Marc :)
Offline

Stu Aitken

  • Posts: 139
  • Joined: Wed May 04, 2016 6:30 pm

Re: BMMCC PWM Specs

PostThu May 05, 2016 9:35 pm

Kim Janson wrote:Here is a very simple way to control it, requires just buttons http://www.bmcuser.com/showthread.php?1 ... rCheesyCam


yeah I'd seen that video and the simple voltage change button method is a cool fallback but want to see if I can everything wired up to the arduino and would prefer the ability to dial increments on those functions down as well as up if possible :)
Offline

Christopher Cox

  • Posts: 251
  • Joined: Tue Oct 22, 2013 4:49 am
  • Location: Brisbane, Australia.

Re: BMMCC PWM Specs

PostFri May 06, 2016 2:27 am

Is anyone selling ready made kits that only require plugging in to be operational? All I need is the basic controls (start/stop record, playback, menu navigation, aperture adjustment).
Wielding a Pocket Cinema Camera from a wheelchair.
Offline

Stu Aitken

  • Posts: 139
  • Joined: Wed May 04, 2016 6:30 pm

Re: BMMCC PWM Specs

PostFri May 06, 2016 3:06 am

ok, finally got the arduino wired up to the BMMCC to test this tonight and with a bit of trial and error I got something to work

posting results in case it helps anyone else:

from my tests it seems you have to go through a complete cycle from neutral to MAX (or vice versa) stepping up/down by 1 degree each pulse to get the BMMCC to recognise the PWM signal as a valid input for the controls that expect an 'incremental' step change (e.g. WB, ISO) as opposed to the ones that work fine with a more straightforward 'servo' style value (e.g. Focus, Iris)

however BOTH 'directions' work and in the manner you would expect (i.e. jumping up the range increments the value, jumping down decrements the value)

interestingly altering the PWM frequency by manipulating the delay value shows that there's a reasonable range of PWM frequencies that will be accepted as valid though it seems to work best closest to around 50 Hz - I found it started to get a bit inconsistent beyond 200 Hz or so when I tried to speed it up

this does seem to mean each step change requires an input PWM signal of around a second or so to work (e.g. a sweep of 90-180 in 1 degree steps each pulse takes around a second at 100 Hz, longer at 50Hz)

I tried taking bigger jumps each time, but if I did this (by tweaking the for loop to add say 2 or 3 to the output value 'pos' each time it looped) it no longer worked - thought that was a bit strange, so suspect I'm still missing some detail of how the implementation is supposed to work here

sketch below illustrates the above - the main loop calls either the increment function (sweeps up from 90 to180) or the decrement function (sweeps down from 180 to 90) depending on which line is commented out and just keeps repeating that - it should endlessly cycle in one or the other direction through the values on any assigned setting on the BMMCC until you pull the plug

sketch:

Code: Select all
#include <Servo.h>

Servo myservo;
int pos = 0;

void setup() {
myservo.attach(9); //connect signal pin of PWM lead to pin 9 on Arduino
}

void loop() {
  for(pos = 90; pos <= 180; pos += 1)
  // for(pos = 180; pos >= 90; pos -= 1) swap the for loop to this to go down settings
  {
    myservo.write(pos);
    delay(12);
  }
}

Offline

Stu Aitken

  • Posts: 139
  • Joined: Wed May 04, 2016 6:30 pm

Re: BMMCC PWM Specs

PostFri May 06, 2016 3:12 am

Christopher Cox wrote:Is anyone selling ready made kits that only require plugging in to be operational? All I need is the basic controls (start/stop record, playback, menu navigation, aperture adjustment).


start/stop and iris are easy, but there is currently no support for playback or menu control through the expansion port

I think everyone is generally agreed that it would be great if we COULD assign menu control especially but also other things like playback, frame rate, codec, etc to the expansion port PWM/Sbus inputs, but I suspect BMD would have to enable this in new firmware

several people are working on DIY type arduino based systems (me included) - I'm not sure of anyone is looking at retail solutions yet
Offline

Stu Aitken

  • Posts: 139
  • Joined: Wed May 04, 2016 6:30 pm

Re: BMMCC PWM Specs

PostFri May 06, 2016 3:19 am

interestingly altering the PWM frequency by manipulating the delay value shows that there's a reasonable range of PWM frequencies that will be accepted as valid though it seems to work best closest to around 50 Hz - I found it started to get a bit inconsistent beyond 200 Hz or so when I tried to speed it up


thinking this through the above description may well be a noob misunderstanding on my part - I'm guessing the PWM frequency is actually handled by the servo library itself, but the delay setting definitely seemed to have some sort of effect on wether the camera accepted the input or not.

will try the inbuilt sweep function later to see if that works
Offline

Steve Watson

  • Posts: 30
  • Joined: Thu Apr 14, 2016 10:10 am

Re: BMMCC PWM Specs

PostFri May 06, 2016 8:55 am

Hi,

I've played around quite a bit with using arduino code to do stuff on the camera as demonstrated -

viewtopic.php?f=2&t=46723

I already had app controlling a real servo for focus and just connected the same arduino to the expansion port and it just worked - there is a trick to getting focus to be responsive because if you send say 100 then 20 to the servo it has a habit of trying to go to 100 before going back to 20, in my app(on phone) I just send data based on a timer signal. The range of servo values for the lenses vary but it' s usually somewhere in range 48 - 140 from close to far focus.

For Iris the servo values are start around 46 for widest stop then going up 3 or 4 each time to next stop increment up to what from my testing is 142 for final stop.(as different lenses have different stop increments these need to be set for each), below are arrays of stop names and values for a couple of lenses. I incremented the servo until stop changed and noted values.

Olympus 12-40

Stop names
[2.8,3.2,3.5,3.7,4,4.5,4.8,5.2,5.6,6.2,6.7,7.3,8,8.7,9.5,10,11,12,14,15,16,17,19,21,22]
Stop Servo Values
[46,49,53,57,61,65,69,74,78,81,85,89,93,98,102,106,110,113,117,122,126,130,134,138,142]

Canon 16-35 via speedbooster

Stop Names
[2.0,2.2,2.4,2.6,2.8,3.2,3.5,3.7,4.0,4.5,4.8,5.2,5.6,6.2,6.7,7.3,8,8.7,9.5,10,11,12,14,15,16]
Stop servo values
[46,49,53,57,61,65,69,74,78,81,85,89,93,98,102,106,110,113,117,122,126,130,134,138,142]

(I've only just noticed that those servo values are identical, it's just the stop the lens displays is different but ie on canon 2.8 is 61 but on olympus 2.8 is 46)

I guess you could just use a variable servo value to change value, I just wanted app to display the real stop.

For things like Iso, WB etc I use pins set to digital out and then send high then low with a short delay to pulse.

For record I use a digital out again but it is set to high for off and low for record.

Steve
Offline

Stu Aitken

  • Posts: 139
  • Joined: Wed May 04, 2016 6:30 pm

Re: BMMCC PWM Specs

PostSat May 07, 2016 2:38 am

after more tests, more makes sense:

it seems things are much simpler than I thought and that all you need to increment up is a clear change from neutral to max, and to increment down from neutral to Min

where I was getting confused with timing issues before is also now obvious:

the frequency is 50 Hz so to create a clear change you just need to leave enough of a delay between each change in value so the 50 Hz signal has a chance to deliver that clearly to the camera

so no need for a sweep in values at all a direct change from 90 -180 or 90 - 0 will do fine as long as each value is delivered cleanly - revised code example below in case it helps anyone else

S-Bus next - that seems like it might be more complicated :)

Code: Select all

#include <Servo.h>
Servo myservo;
int servoPin = 9;

void setup()
{
  myservo.attach (servoPin , 1000, 2000); //after some research it seems like a good idea to explicitly set min and max
}

void loop()
{
  // use some sort of event to trigger - e.g. a button press
  // step down one value of assigned setting
  myservo.write(90); //neutral
  delay(20); //creates enough of a delay to allow at least one clear pulse at neutral
  myservo.write(0); //min

  // step up one value of assigned setting
  myservo.write(90); //neutral
  delay(20); //creates enough of a delay to allow at least one clear pulse at neutral
  myservo.write(180); //max
  }
}

Offline

Steve Watson

  • Posts: 30
  • Joined: Thu Apr 14, 2016 10:10 am

Re: BMMCC PWM Specs

PostMon May 09, 2016 6:24 pm

Hi,

more experimentation.

The stop servo values do vary according to lens, these are the ones for a canon 50mm(the 1.8 plastic one) on a speedbooster.

Stops
[1.3,1.4,1.5,1.7,1.8,2.0,2.2,2.4,2.6,2.8,3.2,3.5,3.7,4.0,4.5,4.8,5.2,5.6,6.2,6.7,7.3,8.0,8.7,9.5,10.0,11.0,12,14,15,16]

Servo Values
47,49,51,55,58,62,65,69,72,76,79,81,85,88,92,95,99,102,106,109,112,115,118,122,125,129,132,136,139,142]

I guess this lens has a lot more stops than the others.

Steve
Offline

Stu Aitken

  • Posts: 139
  • Joined: Wed May 04, 2016 6:30 pm

Re: BMMCC PWM Specs

PostTue May 10, 2016 8:49 pm

I only have Oly m43 lenses rigtht now but the micro seems to able to magically map the Iris on those to the full range of the servo channel - ie f1.8 is sitting around 5 degrees, and f22 close to the max

guess maybe its not as straightforward with the metabones adapter?

I did find I sometimes hit an awkward 'in-between' value where I could hear the lens almost flicking between one aperture and another, and its not easy to get around that using a consistent 'step change' in the servo angle each time I go up or down

so even though the full range on these lenses is mapped well automatically the 'steps' don't necessarily correspond perfectly with the limited precision of the 180 values the normal servo.write() method uses

I'm thinking if I continue with the PWM route I'll probably swith to using writeMicroSecond() instead which allows you to use much finer incremements (1000 vs 180) without resorting to any floating point variables
Offline

Steve Watson

  • Posts: 30
  • Joined: Thu Apr 14, 2016 10:10 am

Re: BMMCC PWM Specs

PostWed May 11, 2016 9:18 am

Hi,

that's interesting, I'd assumed that most lenses would act the same but I guess it depends on the iris servo in the lens itself.

What are the range of values for focus for those lenses ?

Steve
Offline

Stu Aitken

  • Posts: 139
  • Joined: Wed May 04, 2016 6:30 pm

Re: BMMCC PWM Specs

PostWed May 11, 2016 4:14 pm

Steve Watson wrote:Hi,

What are the range of values for focus for those lenses ?

Steve


I haven't checked this thoroughly yet, mainly as its quite hard to tell from just looking at the lens whether you are actually at infinity or closest focus :)

on the list of things to check

I could get quite fine adjustments through using commands sent over a serial connection (not got it hooked up to any actual hardware yet, just driving over the serial port via USB from my macbook)
Offline

Steve Watson

  • Posts: 30
  • Joined: Thu Apr 14, 2016 10:10 am

Re: BMMCC PWM Specs

PostThu May 12, 2016 3:08 pm

Hi,

one thing I've discovered doing another shoot is that for these sort of stills lenses with a very small focus throw is that I need to do some kind of reverse logarithmic scale in my app's slider.

Just looking at the olympus 12-40 which has a rough servo values from 45 - 135 most of the range is taken up from 0.2 feet to 5 feet(looking at the lens marks in manual mode I'm estimating it's an angle of 70 degrees - which probably is servo values from 45 - 115) so it has only 20 degrees of movement from 5 feet to infinity which is not that great when you want to do a fine focus change from say 8 feet to 10 feet. This is of course exactly the same when using a manual follow focus on these sorts of lenses, but with a manual follow focus could just use a bigger cog to get finer control.

The exact logarithmic scale(ie to make the movement of the slider have more travel distance in the further focus distances) is probably completely different for every lens. So I'll have to experiment.

But on a gimbal the ability to do focus pulls using it is really useful - more the kind of focus pulls from one object to another, rather than a pull as you move in(at least in single user operation this is tricky, but then doing the same hand held might be equally as taxing.)

Steve
Offline

Denny Smith

  • Posts: 13131
  • Joined: Thu Aug 01, 2013 4:19 pm
  • Location: USA, Northern Calif.

Re: BMMCC PWM Specs

PostThu May 12, 2016 4:15 pm

Yes, the native MFT lenses have a short hard to control focus throw. I have tested the Panny Leica lenses, including the 42.5mm f/1.2, which has a longer focus throw, almost as much as the Zeiss ZF lenses, and can actually be focused with the LANC remote without too much problem. The other Panny Leica lenses perform fairly well too, with the 15m having the shortest focus throw. Assuming similar performance from the SBus, with a degree of greater control. Cheers.
Denny Smith
SHA Productions
Offline

Stu Aitken

  • Posts: 139
  • Joined: Wed May 04, 2016 6:30 pm

Re: BMMCC PWM Specs

PostThu May 12, 2016 5:30 pm

isn't the focus throw on the Oly lenses perhaps different depending on how the clutch on the lens is set (for those that have this feature)?

eg if I engage the Manual focus clutch on the 17mm is obviously a quite short 90 degree throw, but I can also manually focus using the fly by wire with the clutch in the 'normal' autofocus position and the throw is much longer (albeit variable as its non linear dependent on speed of rotation)

I'm not sure if this also has an effect on doing it through the remote servo channel (which presumably would just ignore whatever the lens barrel clutch is set to anyway...)

LANC may be quite different as that is NOT sending an absolute focus position, just a command to focus nearer or further each time and there is no way to control the 'granularity of that - it must be something they have hard coded into the camera?
Offline

Steve Watson

  • Posts: 30
  • Joined: Thu Apr 14, 2016 10:10 am

Re: BMMCC PWM Specs

PostFri May 13, 2016 9:55 am

HI,

I can't speak for other lenses but the 12-40 only works with servo control if it it set to autofocus. If I set the lens so I can see distance marks it doesn't focus with my box.

Steve
Offline

Stu Aitken

  • Posts: 139
  • Joined: Wed May 04, 2016 6:30 pm

Re: BMMCC PWM Specs

PostFri May 13, 2016 1:13 pm

that would make sense - I'm guessing the clutch effectively disengages the auto-focus motors completely then

the thing I could never work out is how it magically transfers the focus range to the absolute range on the manual clutch from the relative focus by wire system when you engage/disengage the clutch...

bringing this back to the main topic:

has anyone confirmed SBUS working with the actual camera yet?

I'm still working on it, but haven't quite got there yet - its quite a difficult protocol to deal with (stores 11 bits for each channel spread among multiple bytes, little endian bytes in big endian packet, inverted signal logic, etc) and I suspect the timing of sending each frame (and sending them repeatedly at regular intervals) is somewhat tricky to code for given the controller app also needs to read inputs from the user and then wrangle those into a valid signal
Offline

Stu Aitken

  • Posts: 139
  • Joined: Wed May 04, 2016 6:30 pm

Re: BMMCC PWM Specs

PostSat May 14, 2016 5:04 am

eureka :)

SBUS works.

hints for anyone else trying (this may be gobbledegook for anyone unfamiliar with arduino land or RC electronics):

the various arduino libraries you can find online for sbus work with a little bit of adjustment - most of them are more aimed at reading sbus than writing it, but there is at least one that does writes as well

https://github.com/mikeshub/FUTABA_SBUS

(thanks to Mike Baker, et al)

I had to tweak the library a bit to get everything to work - I also got rid of lots of it that I didn't need (the read parts and some other RC functions like failsafe mode, etc)

you need to run the Tx out via a signal inverter to convert to inverted logic before running that to the camera Rx - eg http://www.maplin.co.uk/p/74hct14n-hct-cmos-logic-rs17t

I'll post more on all this later...

the camera doesn't seem to care much about the time between sbus frames which is a relief (I didn't have to mess about with difficult stuff like timer based interrupts or anything)

the 'switch mode' functions (ISO, shutter, WB and REC) work like this:

to go UP send a val on the associated sbus channel of 1024 followed immediately in the next frame with a val of 2046 - it won't work with either of the more obvious values of 1023 (neutral) or 2047(max)

to go down send 1024 then 0 in the next frame

the usable min and max for the more 'analog' like camera functions (focus, iris, levels, zoom) seem to be in a significantly smaller range than the possible min/max - my guess would be around half (so say 500 to 1500 aprox centred on 1023) - this seems different behaviour than PWM which did pretty much map the whole of the 'usual' RC servo control range available (ie 1000 to 2000 centered on 1500)) - this may be lens dependent though.

I'll try and make a video showing all of this tomorrow :)
Next

Return to Cinematography

Who is online

Users browsing this forum: Bing [Bot], Geoff Treseder, Google [Bot] and 104 guests