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
Online
User avatar

Kim Janson

  • Posts: 942
  • Joined: Wed Jul 15, 2015 6:54 pm
  • Location: Finland

Re: BMMCC PWM Specs

PostFri Mar 25, 2016 7:56 pm

Try some of the Arduino servo libraries.
LeViteZer Smooths the movement, www.levitezer.com
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 :(
Online
User avatar

Kim Janson

  • Posts: 942
  • Joined: Wed Jul 15, 2015 6:54 pm
  • Location: Finland

Re: BMMCC PWM Specs

PostFri Mar 25, 2016 9:10 pm

It could be something wrong on your Arduino implementation or cable, did you try with normal RC radio/ PWM receiver.

It could of course be also a problem on the BMMCC, I do not have the camera yet.

As you are using Arduino, I would actually success looking on the SBUS libraries. That gives much more flexibility, plenty of control with only GND and SBUS connection.
LeViteZer Smooths the movement, www.levitezer.com
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: 768
  • 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: 768
  • 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.
Online
User avatar

Kim Janson

  • Posts: 942
  • Joined: Wed Jul 15, 2015 6:54 pm
  • Location: Finland

Re: BMMCC PWM Specs

PostSat Mar 26, 2016 5:00 am

BTW, are the camera menu button commands available via SBUS/PWM. (up, down, left, right, enter) That would be useful to control the camera menus on gimbal installation (with joystick and button).
LeViteZer Smooths the movement, www.levitezer.com
Offline

George Leon

  • Posts: 45
  • 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
Online
User avatar

Kim Janson

  • Posts: 942
  • Joined: Wed Jul 15, 2015 6:54 pm
  • Location: Finland

Re: BMMCC PWM Specs

PostSun Mar 27, 2016 7:43 am

What Arduino board are you using, have you ensured PWM is available on th epin you are using?

Also are you using the cable that came with the camera? If you have build you own cable, I saw somewhere mentioned that the pin order is strangely documented, looking backwards the connector etc. One should follow the pin numbers.

I hope they would make the menu buttons available over SBUS.... On handheld gimbal installation that would be a good way controlling the camera settings holding both hands on the gimbal, just using the joystick. I have a SBUS joystick that could easily be modified to have a control mode for controlling the camera menus (only a small SW change and wiring SBUS to camera also.). Much more complicated and expensive to add many potentiometers to it to control all the parameters, though there might be few.
LeViteZer Smooths the movement, www.levitezer.com
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: 45
  • 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: 45
  • 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: 45
  • 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: 45
  • 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: 768
  • 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: 45
  • 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: 768
  • 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

Dmitry Shijan

  • Posts: 824
  • 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
All my custom made accessories for BMMCC/BMMSC now available here https://lavky.com/radioproektor/
Offline
User avatar

Dmitry Shijan

  • Posts: 824
  • 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
All my custom made accessories for BMMCC/BMMSC now available here https://lavky.com/radioproektor/
Online
User avatar

Kim Janson

  • Posts: 942
  • Joined: Wed Jul 15, 2015 6:54 pm
  • Location: Finland

Re: BMMCC PWM Specs

PostThu Mar 31, 2016 11:02 am

I am using Teensy 3.x and do not need any adapter for SBUS, but have not tested yet with BMMCC.
LeViteZer Smooths the movement, www.levitezer.com
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.
Online
User avatar

Kim Janson

  • Posts: 942
  • Joined: Wed Jul 15, 2015 6:54 pm
  • Location: Finland

Re: BMMCC PWM Specs

PostSat Apr 02, 2016 9:07 am

I will build a solution as soon I have the camera. It will not be that complicated.
LeViteZer Smooths the movement, www.levitezer.com
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.
Online
User avatar

Kim Janson

  • Posts: 942
  • Joined: Wed Jul 15, 2015 6:54 pm
  • Location: Finland

Re: BMMCC PWM Specs

PostSat Apr 02, 2016 3:25 pm

Potentiometer works too, but good to use some about 1uF filtering capacitor or SW filtering.

Ps. started an other tread about lenses viewtopic.php?f=2&t=46293 really interested to hear how the RC (SBUS or PWM) works with different lenses, how smooth focusing, zooming or aperture changes are etc.
LeViteZer Smooths the movement, www.levitezer.com
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: 2
  • 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
Online
User avatar

Kim Janson

  • Posts: 942
  • Joined: Wed Jul 15, 2015 6:54 pm
  • Location: Finland

Re: BMMCC PWM Specs

PostThu May 05, 2016 4:29 pm

I have not actually tested with the camera yet, but I am using SBUS on other applications, so that part should be easy.

Just had the camera long enough to take this picture, should have one next week I hope, to continue the gimbal tests and build the full control for the BMMCC.

hmm... I get "Sorry, the board attachment quota has been reached." what ever that means, here is a link to the picture https://www.facebook.com/levitezergimba ... 03/?type=3

I wonder though how are the ISO, white balance shutter angle, REC start/stop controlled over SBUS? Are they controlled with short up/down pulses or directly with the channel levels, but that should be easy enough to find out when I have the camera. Would be nice though to have that specified on the users manual.

I think I will start testing with focus or iris, they hopefully are directly proportional to the SBUS/PWM levels.
LeViteZer Smooths the movement, www.levitezer.com
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 :)
Online
User avatar

Kim Janson

  • Posts: 942
  • Joined: Wed Jul 15, 2015 6:54 pm
  • Location: Finland

Re: BMMCC PWM Specs

PostThu May 05, 2016 7:52 pm

Here is a very simple way to control it, requires just buttons http://www.bmcuser.com/showthread.php?1 ... rCheesyCam
LeViteZer Smooths the movement, www.levitezer.com
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
Next

Return to Cinematography

Who is online

Users browsing this forum: Adam Silver, Chris Maier, Craig Seeman, Geoff Treseder, Kim Janson, pnguyen720 and 38 guests