Show Posts
Pages: 1 [2] 3 4 ... 10
16  Using Arduino / General Electronics / Re: 3 stage low pass filter design and performance on: March 12, 2013, 08:38:06 pm
OK. Analog vs PWM. The LP filter wont work well and PWM needs Khz frequency. Two schools of thought?

http://www.tellurex.com/technology/peltier-faq.php 43 linear control - sensitive electronics is the issue.

I need to dither temperature either side of set point for accuracy. PWM does this easily, analog control is better otherwise, for my application.






17  Using Arduino / General Electronics / Re: 3 stage low pass filter design and performance on: March 12, 2013, 03:20:09 pm
Thanks GM and dc42.

On reflection I see what you mean. Current is dependent on the gate voltage. In that case an RC snubber is needed. The TEC is 8 amps. The FET is a 30v 120A RDSon 1.4mohm at 4.5v.
18  Using Arduino / General Electronics / 3 stage low pass filter design and performance on: March 12, 2013, 12:06:04 pm
Hi. Newbie here. I'm designing a control circuit for a TEC device. Super fast response is not a criteria, but it needs to be very low noise.

 Attached is a 3 stage low pass filter design with an output of 2.5v to a logic level n channel mosfet. The source is 490hz Arduino PWM.

The reason for 3 stages is to eliminate continual switching of the mosfet gate and to prevent the mosfet gate from intermittently going low when operating at low voltage.

Newbie questions

With this design do I need an RC filter? I'm guessing no.

Will the response time be too slow to control a thermal mass with low inertia - that is, it wont change temperature too rapidly.






19  Using Arduino / Project Guidance / Re: Telescope control indiserver - Firmata - real time commands on: December 03, 2012, 05:48:55 pm
I'll do some in-depth reading. Thanks again!
20  Using Arduino / Project Guidance / Re: Telescope control indiserver - Firmata - real time commands on: December 03, 2012, 05:41:55 pm
Thanks billroy. I think this might be on the right track.

I conducted a little experiment with the Firmata interface;

Teensy 2.0 on ttyACM0 with XmTel configured for the same port.

In a terminal "indiserver tel" with the following output - still dead after 10 restarts

2012-12-03T22:19:40: Driver tel: We always read the precision encoder and
2012-12-03T22:19:40: Driver tel:   set the motor encoders to match.
2012-12-03T22:19:40: Driver tel: A200HR serial port opened ...
2012-12-03T22:19:42: Driver tel: A200HR drive control did not respond
2012-12-03T22:19:42: Driver tel: stderr EOF
2012-12-03T22:19:42: Driver tel: still dead after 10 restarts
Bye

Launched Firmata test interface and selected port ttyACM0, then "indiserver tel" with this output - connected to a Planewave A200HR telescope mount - not really!

2012-12-03T22:20:36: Driver tel: We always read the precision encoder and
2012-12-03T22:20:36: Driver tel:   set the motor encoders to match.
2012-12-03T22:20:36: Driver tel: A200HR serial port opened ...
2012-12-03T22:20:36: Driver tel: Planewave A200HR
2012-12-03T22:20:36: Driver tel: Sidereal Technology �r
2012-12-03T22:20:36: Driver tel: Telescope connected
2012-12-03T22:20:37: Driver tel: Limits disabled
2012-12-03T22:20:38: Driver tel: Initial telescope pointing request was out of range ...
2012-12-03T22:20:38: Driver tel: Cycle power, set telescope to home position, restart.

The image below shows Xephem with the indiserver connected to the telescope, talking to XmTel with Firmata in between the Teensy.

I don't know much about the firmata interface, but I think this shows that there is communication between all the required elements of the system. All I need to do now, is send real time tracking from Xephem to Firmata to drive the Teensy/Arduino pins - telescope mount stepper motors.

I can see that I will need help with this. Is this a simple task under Bitlash? From what I have read, following the links, it seems feasible, although it can be completely transparent. The only interfaces required, are the XmTel and Xephem

21  Using Arduino / Project Guidance / Telescope control indiserver - Firmata - real time commands on: December 02, 2012, 08:34:14 pm
I want to implement telescope tracking using an Arduino as the interface between a PC/Laptop and a German Equatorial Mount. Very basic - 2 axii, RA and DEC and variable slew speeds through a hand controller. All I want to do is emulate hand controller commands...

It works like this;

An astronomical ephemeris (Xephem) provides real time tracking information to a control interface (XmTel) via the Linux indiserver.

From the control interface, tracking commands are sent to an Arduino with Firmata as the link between XmTel and the Arduino.

I have the ephemeris and control interface installed and communicating via indiserver. I have Firmata sending commands to the Arduino using a GUI that I downloaded from the Firmata site; however

Is it possible to set up Firmata to receive inputs from XmTel (the command interface) real time. I am a bit hazy on what protocol to use to get the commands to Firmata.

INDIUINO is an indi project that controls domes and so on with a Firmata GUI, but I need real time commands.

Is there an easier way to do this - perhaps a PL2303?


22  Topics / Device Hacking / Re: CCD camera and equatorial mount control - using a light sensor... on: November 12, 2012, 12:08:48 pm
I've since changed the code, removing the capacitor, adding the Arduino smoothing script to average on/off indications. The capacitor was too erratic and unreliable, with outliers triggering the dither mechanism during image capture.
23  Using Arduino / Motors, Mechanics, and Power / 28BYJ-48 geared stepper 64 or 32 steps. on: November 10, 2012, 12:54:22 am
I recently acquired a few 5v unipolar steppers - 28BYJ-48. These are advertised as 64 step with 1/64 reduction gearing. They also ship wired in the order, Blue, Pink, Yellow, Orange, Red turning in one direction only. Swapping the Pink and Yellow wires however, has the stepper rotating CW and CCW. But I am not able to solve the fact that motorsSteps must be set at 32, to drive my application as required at 1 rpm, rather than 64 steps advertised. Other than that, these little motors run almost resonance free, which is great for astrophotos.

All my other steppers run as advertised using the standard Arduino library - not sure why the 28BYJ-48 requires only half the number of steps / revolution? I suspect it's a user problem, but have no idea where to start looking.

Furthermore, should I set the stepper pins to OUTPUT, or is this the default stepper library configuration any way?
24  Using Arduino / Installation & Troubleshooting / Re: The Linux ttyACM0 drama - more details after a lot of experimenting on: November 09, 2012, 09:51:41 pm
USB 2 does the trick.
25  Using Arduino / Project Guidance / Re: Astro sector drive - tilt sensors - accelerometers - GPS - compass on: November 09, 2012, 09:50:18 pm
It will be a camera and lens.
26  Topics / Device Hacking / Re: CCD camera and equatorial mount control - using a light sensor... on: October 29, 2012, 03:52:24 pm
I've read a little on the use of linear CCDs - an interesting concept. I imagine that the old GEM CCD/DSLR imaging paradigm may come to an end eventually because of improving technologies such as linear CCDs.

I guess I'm working with what I have to get the best image results, without hacking into devices. I tend to look for non intrusive solutions to avoid damaging expensive components and the expense of upgrading equipment.
27  Using Arduino / Installation & Troubleshooting / Re: The Linux ttyACM0 drama - more details after a lot of experimenting on: October 29, 2012, 03:02:43 pm
Thanks. That's the conclusion I came to. I'll wait for 3.4 which is not too far away. Annoying more than any other issue. smiley-confuse
28  Topics / Device Hacking / CCD camera and equatorial mount control - using a light sensor... on: October 29, 2012, 06:23:46 am
I guess this is the right section after all.

I needed a way to get an astro CCD camera sequenced with a stepper motor driven mechanism, which controls an equatorial mount hand controller, sequentially repositioning the RA and DEC axii between exposures to dither the images. A box shaped spiral was the best pattern for my purposes.

The stepper mecnanism was originally sequenced with a DSLR on the same mount. The CCD camera replaces the DSLR and is still under warranty, so soldering wires here and there is not an option. The mount is quite old, manual, but very accurate.

On the camera side, I used a Freetronics TEMT6000 light sensor break out board, connected to an analog pin to read the camera operation LED, which indicates whether the camera is exposing or not (doing other things).

On the mount side, I  use a bipolar stepper, driven by an L293NE, on a home made arduino shield, to push the hand controller buttons between exposures.

The LED is either off, on or flashing. To differentiate flashing from on and off, I tied a capacitor between the sensor output and GND, which restricted the minimum and maximum values, sampling a mid range.

The code might be helpful to understand the concept fuller - though I warn you, it is very amateurish.
Code:
#include <Stepper.h>

/* This sketch activates a stepper motor/roller arm which  
 presses 4 buttons, RA and DEC, on a German Equatorial Mount
 hand controller. The buttons are pressed in sequence between image
 exposures by reading the camera operational state LED, using
 a TEMT6000 light sensor.
 
 Exposing, LED ON/OFF, 500ms. Not exposing LED ON.
 No operation LED OFF.
 
 Sensor trigger values derived experimentally - 22uf capacitor
 across GND and sensor OUT to 'average' exposing value with LED
 flashing.
 */

#define pin2 2
#define pin3 3

int frames = 0;
int pinval2;
int pinval3;
int steps;
int sensorPin = A1;
int sensor;
int exposure = 0;
bool exposing;

/* motor parameters */

#define motorSteps 200
#define motorspeed 5
#define motorPin1 4
#define motorPin2 5
#define motorPin3 6
#define motorPin4 7

Stepper stepper(motorSteps, motorPin1,motorPin2,motorPin3,motorPin4);

/* dither pattern steps */

#define steps0 50
#define steps1 50
#define steps2 -50
#define steps3 50
#define steps4 50
#define steps5 -50
#define steps6 50
#define steps7 50
#define steps8 -50
#define steps9 50
#define steps10 -50
#define steps11 50
#define steps12 50
#define steps13 -50
#define steps14 50
#define steps15 -50
#define steps16 50
#define steps17 50
#define steps18 -50
#define steps19 50
#define steps20 -50
#define steps21 50
#define steps22 -50
#define steps23 50
#define steps24 50
#define steps25 -50
#define steps26 50
#define steps27 -50
#define steps28 50
#define steps29 -50
#define steps30 50
#define steps31 50
#define steps32 -50
#define steps33 50
#define steps34 -50
#define steps35 50
#define steps36 -50
#define steps37 50
#define steps38 -50
#define steps39 50

void setup(void) {

  // declare sensor INPUT
  pinMode(sensorPin,INPUT);

  // hardware switch - set as input
  pinMode(pin2, INPUT);
  pinMode(pin3, INPUT);

  // pull-up resistors
  digitalWrite(pin2, HIGH);
  digitalWrite(pin3, HIGH);

  Serial.begin(9600);
}

void dither() {  

  // read the light sensor
  sensor = analogRead(sensorPin);

  delay(250);

  Serial.println(sensor);

  if(sensor > 1 && sensor < 235){

    exposing == true;

    exposure = 1;

    if (exposing == true) {

      pause();
    }
  }
  
  // dither during image download
  
  if(exposure > 0 && sensor > 235) {

    exposing = false;

    if(exposing == false) {

      exposure = 0;    

      frames++;

      //Serial.println(frames);
      if (frames == 1)
        steps = steps0;
      if (frames == 2)
        steps = steps1;
      if (frames == 3)
        steps = steps2;
      if (frames == 4)
        steps = steps3;
      if (frames == 5)
        steps = steps4;
      if (frames == 6)
        steps = steps5;
      if (frames == 7)
        steps = steps6;
      if (frames == 8)
        steps = steps7;
      if (frames == 9)
        steps = steps8;
      if (frames == 10)
        steps = steps9;
      if (frames == 11)
        steps = steps10;
      if (frames == 12)
        steps = steps11;
      if (frames == 13)
        steps = steps12;
      if (frames == 14)
        steps = steps13;
      if (frames == 15)
        steps = steps14;
      if (frames == 16)
        steps = steps15;
      if (frames == 17)
        steps = steps16;
      if (frames == 18)
        steps = steps17;
      if (frames == 19)
        steps = steps18;
      if (frames == 20)
        steps = steps19;
      if (frames == 21)
        steps = steps20;
      if (frames == 22)
        steps = steps21;
      if (frames == 23)
        steps = steps22;
      if (frames == 24)
        steps = steps23;
      if (frames == 25)
        steps = steps24;
      if (frames == 26)
        steps = steps25;
      if (frames == 27)
        steps = steps26;
      if (frames == 28)
        steps = steps27;
      if (frames == 29)
        steps = steps28;
      if (frames == 30)
        steps = steps29;
      if (frames == 31)
        steps = steps30;
      if (frames == 32)
        steps = steps31;
      if (frames == 33)
        steps = steps32;
      if (frames == 34)
        steps = steps33;
      if (frames == 35)
        steps = steps34;
      if (frames == 36)
        steps = steps35;
      if (frames == 37)
        steps = steps36;
      if (frames == 38)
        steps = steps37;
      if (frames == 39)
        steps = steps38;
      if (frames == 40)
        steps = steps39;

      // run stepper
      stepper.setSpeed(motorspeed);
      stepper.step(steps);
    }
  }
}

/* pause */

void pause() {

  stepper.setSpeed(0);
  stepper.step(0);
}

void loop() {

  /* switch pause */

  pinval2 = digitalRead(pin2);
  pinval3 = digitalRead(pin3);
  while (pinval2 == HIGH && pinval3 == LOW) {
    pause();
    break;
  }

  /* sense camera operation - read LED - wait for
  integration then dither*/

  pinval2 = digitalRead(pin2);
  pinval3 = digitalRead(pin3);
  if (pinval2 == HIGH && pinval3 == HIGH) {
    dither();
  }
}
29  Using Arduino / Installation & Troubleshooting / Re: The Linux ttyACM0 drama - more details after a lot of experimenting on: October 29, 2012, 05:33:44 am
I have 1 USB2 port and it works without a hitch. I guess I was looking to fix the USB3 thing. Will have to wait for the new kernel? Will have to find a new spot for the mouse  smiley-eek

Code:
dmesg
[10998.175212] 3-1: USB disconnect, device number 18
[11013.463158] usb 2-1.2: new full-speed USB device number 10 using ehci_hcd
[11013.557924] cdc_acm 2-1.2:1.0: ttyACM0: USB ACM device

sudo lsusb -v attached as a .txt file. Too many characters.
30  Using Arduino / Installation & Troubleshooting / The Linux ttyACM0 drama - more details after a lot of experimenting on: October 29, 2012, 02:29:35 am
I have looked and looked at this ttyACM0 thing with linux and tried just about every fix on the net smiley-eek

I also have a Decimilia and Duemilanove running other projects, both of which work out of the box on the same system and default appropriately to /dev/ttyUSB0 - no issues.

This is what happens on my xubuntu 12.04 system and UNO compatible - Freetronics Eleven.

First - permissions set as recommended for groups and files.

Next - Uno is selected as the board, and when it appears (not grayed out), serial port /dev/ttyACM0.

From the beginning;

Connect board to USB

Code:
dmesg
[ 1562.488131] usb 3-1: USB disconnect, device number 6
[ 1570.049707] usb 3-1: new full-speed USB device number 7 using xhci_hcd
[ 1570.121549] usb 3-1: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[ 1570.124259] cdc_acm 3-1:1.0: ttyACM0: USB ACM device

Open IDE (1.0 ubuntu installed or 1.0.1 in user folder)

Serial port /dev/ttyACM0 with a tick

But this is where the trouble starts;

Select File (or File > Sketchbook > 'your favorite sketch')

Serial port grayed out; and this

Code:
dmesg
[ 1611.679418] xhci_hcd 0000:0c:00.0: ERROR no room on ep ring
[ 1611.679423] cdc_acm 3-1:1.1: acm_submit_read_urb - usb_submit_urb failed: -12
[ 1611.679426] tty_port_close_start: tty->count = 1 port count = 0.
[ 1615.390878] xhci_hcd 0000:0c:00.0: ERROR no room on ep ring
[ 1615.390893] cdc_acm 3-1:1.1: acm_submit_read_urb - usb_submit_urb failed: -12
[ 1615.390903] tty_port_close_start: tty->count = 1 port count = 0.

Now disconnect USB and reconnect;

Serial port /dev/ttyACM0 with a tick. Compile and upload OK, except for

Code:
avrdude: ser_open(): can't open device
"/dev/tty/ACM0" : Input/output error
ioctl("TIOCMET") : Invalid argument

Sometimes the error above doesn't show

Now try selecting the Serial Monitor (bunch of Java errors). Serial port '/dev/tty/ACM0' not found (of course). dmesg output same as previous failure.

This behaviour occurs when connecting and opening the IDE the first time. Second time around is unpredictable as to whether you even get to upload the script.

As I see it, any attempt to use the IDE causes ttyACM0 to become unavailable. I guess, if I understand dmesg output correctly, writing to the device fails, I think?

Reading further, Kernel 3.4 (version from memory) should fix this. Apparently, it's a bug in 3.2, however, some people have found a fix. Interestingly, there is not a lot of consistency to each one.

I have tried a lot of fixes on the net to no avail, except at one point I had it running smoothly. Then looked the other way and sneezed - and of course it broke. Reapplying the previous 'fix' did not fix it.

Hope there's enough here to help, but I guess it's old news anyhow.
Pages: 1 [2] 3 4 ... 10