Show Posts
Pages: 1 2 [3] 4 5 ... 14
31  Using Arduino / Project Guidance / Re: Save encoder data to control stepper on: August 29, 2014, 04:54:22 pm
What sort of resolution are you looking for ? The data rate is what makes the project feasible or not.

Capturing every pulse change and recording the time interval may not be possible on an Uno. I would guess that sampling the position about 100 times a second would reproduce the hand movement accurately enough?

I think for winding, the X axis does not move very quickly. Therefore I would sample the position at a fixed interval, eg. 100/sec. This would give a manageable 120kb of data over 10 minutes. (10*60*100*2 bytes).

If you have an incremental encoder, it produces two pulse outputs out of phase, so you can tell the direction. The Uno CPU does not have a hardware decoder, but it is easy enough to do with an interrupt on change. Each interrupt increments or decrements an internal counter. (The direction is determined by the state of the two encoder lines).

With a timer running at 10ms interval, the internal counter is sampled and written to a buffer. At 10ms rate, you would generate 200 bytes per second, so you could transfer that over serial to a PC. (Assuming 2 bytes per sample, +/-32767 counts).

To generate G-code from the data file, you would need to convert the count values to a position in mm, and the feedrate = dist moved/0.01 * 60 (mm/min).

If 10ms is not enough, you could probably go down to 1ms on an Uno before running into performance problems.

I think as a project it's quite doable, if you are realistic about data rates.
32  Using Arduino / Installation & Troubleshooting / Re: Marlin Ramps 1.4 Clay Delta upload problem on: August 29, 2014, 01:32:04 pm
Marlin includes the SdFat library in its source, you shouldn't need to install a library. So it is probably something else.

But there are hundreds of versions of Marlin, without knowing which source you have it's hard to tell. Posting the original error message would help as well.
33  Products / Arduino Due / Re: Reading Serial Flash Manufacture/Device ID via SPI.transfer on: August 29, 2014, 12:42:40 pm
Your SPI transaction looks good, except that the chip is not responding. Assuming that the clock speed is in spec, we are looking for a hardware problem om the Flash side.

Did you set HOLD and/or RESET  high?
34  Using Arduino / Project Guidance / Re: G Code on Arduino? on: August 29, 2014, 04:18:20 am
Since teacup has built-in code to take data from the serial port it may be possible to modify it so it could get that data from an SD card. The large SD Card data buffer may be a problem. If it worked other teacup users might appreciate your efforts.

SD Cards can be used without the FAT file system (and its large data buffer) but then you are into a very non-standard system.

There is a branch of Teacup with SD/FAT support, might be worth a try -

Probably still need modifying to automatically play/repeat a  file.
35  Using Arduino / Project Guidance / Re: G Code on Arduino? on: August 28, 2014, 06:26:48 pm
I've spent some time developing on teacup and other printer firmwares.

Teacup does not seem to support SD card, as that would be an easy way to inject G-code commands.

The next easiest is to inject characters in the main () function (file mendel.c). Currently it looks like this:

// if queue is full, no point in reading chars- host will just have to wait
if ((serial_rxchars() != 0) && (queue_full() == 0)) {
uint8_t c = serial_popchar();

if you add something like the following psuedocode :
  if queue is not full
        c = get next char from my buffer at next_ptr
       gcode_parse_char (c)
       next_ptr ++
       if next_ptr end of my buffer
           set next_ptr to 0

it will repeatedly run the built-in G-code commands.

You can store a "script" of G-code commands as a simple progmem array something like

PROGMEM char my_gcode [] = "G1 X10 Y10\nG1 X20 Y20\n G1 X0 y0\n";

next_ptr can just be an int, going from 0 to strlen(my_gcode).

If you want to get fancy you could add G-code commands to start/stop your script, run different scripts, react to buttons, etc.

There is a G4 command if you want to put pauses in to the script.
36  General Category / General Discussion / Re: Arduino Newbie on: August 28, 2014, 04:06:14 pm
I think we are talking cross purposes. I didn't mean "why are people picking on Intel" - they seem to be fair game!

What I meant was, there have been several newbies with Galileos, asking how to use them. I am just wondering where and why they got them - giveaways, universities, RS/Farnell, sales reps at work?

Because I think if you went to any Arduino-friendly hobby store/maker type place, people probably wouldn't come out with a Galileo.

Microsoft will be giving away Gen 2 Galileos running Windows, not sure if there is any Arduino involved, but I guess there will be the inevitable questions.

37  Using Arduino / LEDs and Multiplexing / Re: Strange RGB LED on: August 28, 2014, 12:53:53 pm
That was indeed the problem. Kind of nuts. This is the result of having the wrong LED and having it hooked up wrong?  I am expecting to order a lot of 50-100 for a project. Is this type of thing common?

If you buy cheap stuff from China, yes smiley

A colleague bought an iPhone car charger off ebay. Being a curious sort, he opened it up to see what regulation was used. There was none! 12V was wired direct from input to output.

Buying in volume seems to provide an opportunity to hide wrong spec/faulty parts, in some cases I've heard of 50% failure rates.
38  General Category / General Discussion / Re: Arduino Newbie on: August 28, 2014, 12:37:31 pm
I am slightly puzzled where people are picking up on Intel Galileo. Obviously Intel have a big marketing machine and can push sales down lots of existing channels, unlike Arduino which has much different community.

Where Intel's marketing side are succeeding, I agree the engineering side is lacking. The Galileo Gen2 not much better than it's predecessor. The Galileo is not cheap either.

For your application, an AVR Arduino would be fine.
39  Products / Arduino Due / Re: Library for Arduino Due & Serial Flash communication over SPI? on: August 28, 2014, 12:24:26 pm
Some puzzling commits in that repo. The maintainer merges a pull request, then the same day rips out all those changes and adds new stuff which breaks compatibility.  smiley-confuse

I suggest if you take the version at Merge pull request #3 from PaulStoffregen/master it will work ok on Due.
40  Products / Arduino Due / Re: Question on pwm using due on: August 27, 2014, 01:23:14 pm
For the PWM, the actual clock rate is the PWM frequency times the PWM count. For an 8 bit resolution, the count is 255.

Therefore the max PWM frequency with 8 bit resolution is MCK/255, as you have found.
41  Using Arduino / Microcontrollers / Re: Using an ATtiny85 as SPI Slave on: August 27, 2014, 01:11:15 pm
I was thinking of adding an SPI protocol to the cyz_rgb firmware, so I might have go with this.

However, I would really try to avoid putting delays into SPI transactions. The slave should return data it has already calculated, or the master should disconnect and then poll a status register until the slave indicates it is ready. Pausing the SPI transfer is somewhat impossible with a hardware SPI.

At a pinch, you could insert a padding byte or two into the transaction to allow the slave some time, but you always have to draw the line somewhere.

42  Using Arduino / Project Guidance / Re: Can I use a Arduino uno as a LPT port for laptop? on: August 27, 2014, 12:50:32 pm
this is just an alternative way of reading the nand flash through lpt

I have looked into lpt emulation because we have legacy applications at work that use parallel ports and laptops without parallel ports. The short story is that it is impractical to do. The only practical option is to get a PC with a PCI parallel port card, if you want to use LPT, or to ditch it and buy new stuff that works over USB (what we did).

The USB to parallel cables don't work for general use because they only work with printer drivers. For PC applications that expect to find parallel port registers at 278 or 378, you would need to write a kernel driver to emulate the registers, invent a protocol to transfer data over USB, write the firmware for a USB device...

So my advice is forget LPT completely. nandpro supports a USB device, if you want to get stuff done, use that.

If you want to write a nand flasher for educational reasons it would be a fun little project, but it doesn't appear that nandpro provide source code, so you would probably have to write the application side as well.

The Hynix NAND chip is fairly easy to interface to. Decoding the flash file system might take some coding. Overall quite doable, but probably not something I would recommend as first project, unless you already have experience with programming flash chips.
43  Products / Arduino Due / Re: General Due Question on: August 26, 2014, 06:45:11 pm
You could also add an external EEPROM module AT24C256,

Either way you will probably need to edit the sketch accordingly.

Does anyone have a link to the EEPROM emulation library for the Due? I couldn't find it via google.
44  Products / Arduino Due / Re: How to store Data fast in RAM on: August 25, 2014, 06:47:25 pm
1MB/sec to write on a sdcard is possible with DUE, imho. You need to buffer the data into an fifo to eliminate the sdcard's write latency.
That fifo buffering while writing to an sdcard has been discussed dozen times on this forum already.

Maybe, but SD cards can pause for long times, 100ms (or longer!) is possible . At 1MB/sec that means buffering up to 100k of data in 96k of RAM...

However, data compression can often cut down the data rate significantly, which might make some things more feasible.
45  Using Arduino / LEDs and Multiplexing / Re: Controlling LEDs from MATLAB with less than 1ms execution delay? on: August 25, 2014, 03:02:49 pm
adioes.pde appears to be part of a Matlab package Arduinoio (sic)

My guess is that it allows remote operation of an Arduino via Matlab. With comms going over USB serial, the absolute minimum delay is going to be 2ms (since USB serial is polled every 1ms, command out + response back).

So what you need to do is to get the Arduino to measure the delay and report back to the Matlab program. The Arduino side is easy, the Matlab side should be too, you just need to open a tty device as a file then write/read data - I don't know what the commands are in Matlab.

ETA This might help
Pages: 1 2 [3] 4 5 ... 14