Battery third (temp) terminal as multipurpose analogue input - page 14 - Hotwire! Hardware Mods, Accessories and Insights - CHDK Forum
supplierdeeply

Battery third (temp) terminal as multipurpose analogue input

  • 199 Replies
  • 33634 Views
Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #130 on: 01 / February / 2014, 18:01:33 »
Advertisements
Hehe!  :D  Seems you've got some experiences with the working class!?!
You know you have reached middle age when your friends come to help you move but nobody drinks beer until after everything is done.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #131 on: 01 / February / 2014, 18:19:24 »
Yes, actually sometimes I have the feeling I have to hurry with this monster major project to finish before I enter the next level. Noone knows if they have beer there, though. If so we'll meet there to knock back a beer then, at least!




Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #132 on: 19 / February / 2014, 12:03:04 »
Hi girls and guys and  betweens. Having soldered together a lot of cables and photos and an Arduino and having coded some fancy stuff two hours ago I managed to trigger the camera rig for the first time with my wireless trigger and having the pictures 25 seconds later on my notebook. A lot of blood and tears and fears an technical wonders and all you great people here made that possible. Thanks a lot again.

Here are some impressions.






Now there are some cases to put the hubs into and to make some things nicer, but then it is done.

The whole system is capable of triggering flashes, use multiple triggering devices like e.g. loght and sound sensors, it can delay each camera, so slowmo in the bullet time is possible, and all the results can be made visible in about 30 seconds. I will put some raspberry pis into the system to make it even faster, but that's a next level.

For now everything works very nice. But one thing I would like to find out: Is there a way to download the last made image without having to send the get_exp_count before? It tkes about 5 seconds for all cameras, and I would really like to skip this step. Is there maybe a way to autorename every image within chdk after each shot? I am able to compile my own CHDK version if needed.

Thanks a lot. :-)

*

Online reyalp

  • ******
  • 11919
Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #133 on: 20 / February / 2014, 00:33:24 »
For now everything works very nice. But one thing I would like to find out: Is there a way to download the last made image without having to send the get_exp_count before? It tkes about 5 seconds for all cameras, and I would really like to skip this step. Is there maybe a way to autorename every image within chdk after each shot? I am able to compile my own CHDK version if needed.
Can you describe how your current download process?

It would be theoretically possible to use the filewrite hook to override the filename. This would make review on the camera not work, but you probably don't care about that.

edit:
Oh and big congratulations on making this work, that's a very impressive rig. Seeing stuff like this really makes me happy :D
« Last Edit: 20 / February / 2014, 00:35:44 by reyalp »
Don't forget what the H stands for.


Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #134 on: 20 / February / 2014, 04:46:32 »
Thanks for the answer and the kind words about the project.  :)

The download process is: Take a picture, download the last one and delete it immediately, so the cards should always be empty. I was hoping that deleting the image would result in resetting Canons image counter, but that is not the case.

Since there is no explicit filewrite.c for the SX200IS, I suppose the "generic" one is the one I should have a look into, right? Doing so, I must admit that I am probably not the one to make an auto-rename solution, my coding experiences are either quite old (MFC in VS 6.0) or they are LUA, which does not help much in pure C. So I would appreciate your help very much.

Also, it would be great to be able to turn on/off an automatic renaming, because I probably will also have to shoot RAW and then I can't download immediately because of the size. Hmmmm. On the other hand I can shoot RAW and JPG at once, right?

Well, maybe, while writing I have the idea how to solve it quite elegant. I could remember the last downloaded filename for each camera and then internally increment the counter and download the image with this "calculated" name. If that fails, I will have to send the "get_exp_count()" to refresh the counter. Well, that sounds like a solution without having to alter CHDKs code. So, thanks for you help here, please stand by until I checked out my idea!  :)

Thank you very much!

« Last Edit: 20 / February / 2014, 04:50:51 by Karmaschinken »

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #135 on: 20 / February / 2014, 19:23:10 »
Yes, that did it. 5 seconds DL-Time won. Thanks!

*

Online reyalp

  • ******
  • 11919
Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #136 on: 20 / February / 2014, 22:07:51 »
I was hoping that deleting the image would result in resetting Canons image counter, but that is not the case.
You could try putting an IMG_0001.JPG on the card before you restart. If you always download and delete the subsequent images, you could just leave it there. I'm not sure if it needs to be a valid image or just the filename.

Quote
Since there is no explicit filewrite.c for the SX200IS, I suppose the "generic" one is the one I should have a look into, right?
No, "generic" is common code, filewrite needs to be implemented for each camera, "generic" is just common code in this case. This is probably more than you want to get into.

Quote
Well, maybe, while writing I have the idea how to solve it quite elegant. I could remember the last downloaded filename for each camera and then internally increment the counter and download the image with this "calculated" name. If that fails, I will have to send the "get_exp_count()" to refresh the counter. Well, that sounds like a solution without having to alter CHDKs code. So, thanks for you help here, please stand by until I checked out my idea!  :)
excellent ;)
Don't forget what the H stands for.

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #137 on: 26 / February / 2014, 06:19:41 »
Hi,

waterwingz guided me to this thread (thanks).
Since I plan to control my S110 by a microcontroller battery middle terminal could also be one option for me.
I have a question regarding the battery middle terminal option. So here my questions:

1. Can I use middle terminal to send a pulsed signal to it by the microcontroller?

2. What is the shortest pulse width I can detect on that terminal?

3. what is the minimum resistor value (Ohm) difference one can detect on that terminal? e.g. can I detect 1 Ohm difference 10, 100, 1000 Ohm?

4. Can I use triggering middle battery terminal and usb remote (for taking synced stereo photos) simultanously?

If it is possible to detect different resistor values on that terminal it would be possible to send different information to the S110 by only one pulse.
Lets say we can detect 100 Ohm difference, than we can use e.g.

resistor: 100 Ohm to zoom in
resistor: 200 Ohm to zoom out
resistor: 300 Ohm to increase shutter time
resistor: 400 Ohm to decrease shutter time
...

The different resistor values I can change by the microcontroller (e.g. using an R2R network) and send only one pulse to the middle terminal. This could ease up and speed up controlling the cams from microcontroller.

This would be much fatser compared sending different pulses (pulse widths) to the USB remote and decode them in CHDK.

Thanks for any discussion...
« Last Edit: 26 / February / 2014, 06:21:50 by mr.burns »
2 x IXUS 860IS 100c
2 x Powershot S110 103a


Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #138 on: 26 / February / 2014, 07:33:45 »
You'll probably want to stick within the 2k to about 50k ohm range, which will report temperatures of about 70 and -10 degrees C respectively. Perhaps starting higher than 2K if the camera shuts down at that temp. Some cameras don't seem to care (mainly older ones) but most will shut down when the battery reaches a certain temp.

I once did something like that with buttons and different resistors on the temp terminal, never quite finished it but it worked though. It should in theory be possible to use a DAC or maybe even a highly filtered PWM signal to drive it directly (or maybe through a simple analogue buffer with an op-amp) if you're short on micro pins or want a more precise analogue control. Note that if you're using resistance the minimum detectable change in resistance will not be constant as it is a voltage divider, the resolution in voltage is just under 2 millivolts however.

I've attached the original list of resistance vs output value vs temp vs voltage for reference.

If you're going to be using the temp terminal you might as well use it for syncing the shots aswell to avoid a large fragile mini-usb connector waiting to get snapped off on each side of your rig. But it should be possible to use both if you want to.

I haven't tested the minimum pulse time that's detectable yet as I've been sidetracked with another stereo rig with two SX40s (been having problems getting one of them to actually turn on). But when I test it (maybe tomorrow if I get it working) I'll report back the results.
« Last Edit: 26 / February / 2014, 07:37:41 by Recyclojunk64 »

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #139 on: 26 / February / 2014, 07:59:00 »
Hi Recyclojunk64,

thanks, sounds not too bad ;-). I will order now a few resistors (for r2r network) and also an 8Bit DAC to get started somehow. Where inside CHDK I can read the value of the temperature?
I mean since I want to detect quickly if the resistor value changes I need some place in the source code to read that value and trigger an action (e.g. zoom in / out). Best would be an interrupt of course but I doubt that there exists one for the temperature sensor. So I think I have to poll in certain intervalls is that correct? Where should I place the code exactly?
How do I read the temperature value for my S110? Is there already a function available?

Thanks again for any help!

2 x IXUS 860IS 100c
2 x Powershot S110 103a

 

Related Topics