. .

Thread: Raspberry Pi

Page 2 of 6 FirstFirst 1234 ... LastLast
  1. #11
    Quote Originally Posted by Robin Hewitt View Post
    If you fancy a collaboration I am your man.
    Me too. If there's one that's available in a sensible package, i.e. not much smaller pin spacing than SOIC then I'm up for making us some 'development boards' as you suggest. Unless of course there's something cheap and suitable already available.
    Old router build log here. New router build log here. Lathe build log here.
    Electric motorbike project here.

  2. #12
    bobc's Avatar
    Lives in Eastbourne, United Kingdom. Last Activity: 23-02-2015 Has been a member for 9-10 years. Has a total post count of 19.
    There are many cheap ARM eval boards around, I set a goal to find the cheapest! The cheapest so far I have found is the STM32 discovery http://uk.rs-online.com/web/p/proces...-kits/7458434/ for £10. No wait, here is a cheaper one! http://uk.rs-online.com/web/p/proces...-kits/7587554/

    I've got one of the former, haven't done anything with it yet. Instead I build one of the LPC1343 boards you can here http://code.google.com/p/micropendou.../Older_Designs. The nice thing about the LPC chips is they come with a USB bootloader built in, it loads likes a USB flash drive. You just need the GNU compiler and you can start using it.

    I have been using it to make a Control Panel for a 3d printer, you can just make out the board here http://www.flickr.com/photos/4829929...in/photostream

    There are some many options now, we are spoilt for choice. The only thing is if you are into DIY hardware, there are virtually no ARM chips in a DIP package, all LQFP or smaller. The '1343 board above is not too hard to build, I used the two soldering iron technique, a magnifier, and patience ;)

    I have some spare blank PCB's if anyone wants one, most of the parts are available via RS or Farnell.

    ETA; design files and sample firmware for my project is at https://github.com/bobc/bobc_hardware

  3. #13
    Quote Originally Posted by bobc View Post
    I have been using it to make a Control Panel for a 3d printer,
    Blimey! I thought all the "interesting" people on the planet lived miles away from me, but here you are just up the road

  4. #14
    bobc's Avatar
    Lives in Eastbourne, United Kingdom. Last Activity: 23-02-2015 Has been a member for 9-10 years. Has a total post count of 19.
    Quote Originally Posted by Robin Hewitt View Post
    Blimey! I thought all the "interesting" people on the planet lived miles away from me, but here you are just up the road
    Heh, I didn't expect to find a "high-tech" client in Eastbourne, for some reason they have a factory and design centre here. Normally I am found cruising up and down M25/M4. It's a gentler pace of life down here, shall we say ;)

  5. Maybe the Pi isn't the way to go, but my thought process was to create a g-code interpreter to drive the stepper drivers etc. and provide a real-time display of the process. Sort of MACH3 in a matchbox... (or should that be EMC2 in a matchbox)... anyway, a cut down version. No frills, no bells n whistles, just motion control and some graphics. I don't think the other boards suggested can do this (well of course with a multitude of added perpherals maybe). Big ask? maybe.

    I/O isnt an issue, already sketched some ideas for a 16 port TTL compatible I/O module that uses a minimal # of GPIO and will be fast enough for this purpose (a few uS switching time and some bit-banging software) with an RTC as well. Also looking at using the I2C interface for the same, albeit slower...

    So far just knocked up a simple I/O connector to get to the breadboard easily.

  6. #16
    bobc's Avatar
    Lives in Eastbourne, United Kingdom. Last Activity: 23-02-2015 Has been a member for 9-10 years. Has a total post count of 19.
    Quote Originally Posted by irving2008 View Post
    Maybe the Pi isn't the way to go, but my thought process was to create a g-code interpreter to drive the stepper drivers etc. and provide a real-time display of the process. Sort of MACH3 in a matchbox... (or should that be EMC2 in a matchbox)... anyway, a cut down version. No frills, no bells n whistles, just motion control and some graphics. I don't think the other boards suggested can do this (well of course with a multitude of added perpherals maybe). Big ask? maybe.
    It is entirely possible, it is what all the Reprap printer controllers do, they take GCode sent from a PC over RS232, plan the motion and control the steppers, and on the 8 bit Arduino platform. There is also software for CNC, have a look for GRBL.

    It is the sort of project you can do from scratch, you may not achieve reliable motion control on the first go, but steppers are quite easy to work with. If you have got a Pi, you may as well use it. The nice thing about the Pi is you can use a nice sized display with it.

    My Pi should arrive any day now!

  7. Quote Originally Posted by bobc View Post
    It is entirely possible, it is what all the Reprap printer controllers do, they take GCode sent from a PC over RS232, plan the motion and control the steppers, and on the 8 bit Arduino platform. There is also software for CNC, have a look for GRBL.

    It is the sort of project you can do from scratch, you may not achieve reliable motion control on the first go, but steppers are quite easy to work with. If you have got a Pi, you may as well use it. The nice thing about the Pi is you can use a nice sized display with it.

    My Pi should arrive any day now!
    I'll have a look...

    The nice thing about the Pi is the fact that, while you could plug a display in, if you were to use Linux you could equally remotely view/control it with VNC. I want to add this to a new PCB mill I am planning that can sit inside a sound-proof box on the next bench but I can watch it on the main PC... without tying up the main PC and without taking up the space of another PC...

    For what I have in mind, I think it could be done without a real-time kernel with a 'device driver' hooked into a higher priority interrupt and a shared memory queue of simple motion commands. Sort of like a smoothstepper in software... I did something like this more than a few years back in Windows 95 for a real-time data transponder so I know the concept works, but I need to learn more about the Linux low level stuff.... and thats proving hard to find an easy way in...

  8. #18
    bobc's Avatar
    Lives in Eastbourne, United Kingdom. Last Activity: 23-02-2015 Has been a member for 9-10 years. Has a total post count of 19.
    Quote Originally Posted by irving2008 View Post
    I'll have a look...

    The nice thing about the Pi is the fact that, while you could plug a display in, if you were to use Linux you could equally remotely view/control it with VNC. I want to add this to a new PCB mill I am planning that can sit inside a sound-proof box on the next bench but I can watch it on the main PC... without tying up the main PC and without taking up the space of another PC...
    That sounds like a good job for a Pi...

    For what I have in mind, I think it could be done without a real-time kernel with a 'device driver' hooked into a higher priority interrupt and a shared memory queue of simple motion commands. Sort of like a smoothstepper in software... I did something like this more than a few years back in Windows 95 for a real-time data transponder so I know the concept works, but I need to learn more about the Linux low level stuff.... and thats proving hard to find an easy way in...
    Some years ago I worked on Unix device drivers so I know the basics, I have been mostly working on RTOS or bare-metal systems. I am currently reading http://shop.oreilly.com/product/9780596005900.do to get up to date with latest way of doing things on Linux, it seems like a fair introduction but is not comprehensive - that would take multiple volumes I think. There are also online sources of info of course.

    If you don't mind that the device driver is specific to the R.Pi, that should work. For stepper control, it basically needs a high-res timer and access to GPIO pins. The latter is straightforward. By high-res I mean < 10ms ;) I think there is a spare hardware timer on the Pi that a driver could hook into. The user-space app could parse the GCode, and sends "blocks" of motion commands (move N steps on X, M on Y etc) to the device driver with write() (to keep it simple). The driver just needs to generate a stream of step pulses with the required timing.

  9. So, I got a breakout module (a Cobbler, it was quicker/cheaper than putting my own together). I've been teaching myself Linux Kernel and module programming and playing with an GPIO library WiringPi . A quick bit of bit bashing and inspection with the scope has proven, as I suspected, the need for an external interrupt. The Pi can generate 100nS pulses (from C) but the jitter is horrible. I'm currently writing a module that'll take an interrupt from the GPIO and toggle a GPIO line every 'n' pulses, where 'n' is a value in user space. That'll allow me to see what the latency and jitter is from an interrupt.

  10. #20
    Jitter is the problem with running an operating system which happily delays your interrupt service.

    The ARM micro's come with numerous timer channels and you can prioritise the interrupts. However I like to use a single timer for stepping because it makes it darned easy to keep the accelerations/decellerations in synch. I buffer incoming data from the host PDQ then handle it in background so it doesn't interfere with the stepping.

    Two timer interrupts per step, one to set the STEP lines for any steps required, one to step everyone who is primed to go. Makes for nice square pulses and good settle time on the direction lines.

    I like to smash my arcs in to individual straight lines in a buffer to keep the timer interrupt fast and simple. The timer interrupt fetches the next when it exhausts the one it is doing.

    A line has 3 seperate components, acceleration steps, constant speed steps and decelleration steps.

    Lines also have 3 slope values, one for each axis. Basically a number which you add in to a tally and if the tally carries that axis steps.

    If the PAUSE button is pressed things get a bit hairy, every step becomes a decelleration step. It tallies decellerations so it can update the buffer to get back up to speed if it gets unPAUSEd.

    If you smash the arc into enough segments you keep within 1 step resolution. I check the angle at which individual lines intersect and use a table to guess-timate how fast it is safe to take the corner. My PC does the arc to line/speed conversion with no appreciable delay and I am sure the ARM is up for it.

    My mill runs it very smoothly with an 8MHz, 8 bit micro crunching 24 bit numbers. With 32 bit registers it should be a doddle, I could do the whole interrupt in ARM assembler nil problemo.

Page 2 of 6 FirstFirst 1234 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Similar Threads

  1. cnc print a raspberry
    By george uk in forum General Discussion
    Replies: 7
    Last Post: 13-06-2014, 01:13 PM
  2. Raspberry Pi as a PC + Mach3 .. very possible
    By Fivetide in forum General Electronics
    Replies: 2
    Last Post: 05-09-2012, 11:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •