. .
Page 14 of 23 FirstFirst ... 41213141516 ... LastLast
  1. #131
    Quote Originally Posted by Kitwn View Post

    That's basically what my board was designed to do but I opted to create all-new step pulses while the controller believed the machine was stationary. It also acted as the splitter for sending the pulses from one output axis of LinuxCNC to two motor drivers during normal operation. 'Great minds', eh?
    Great minds! I just wanted the controller to stay in control at all times so I figured this approach was simpler and possibly a bit safer and it squares the axis as part of the controllers normal homing process. Not sure on the pros/cons of detection on approach vs retraction so long as it is done super slow I don't think it matters, may make more of a difference with mechanical switches.

    I did notice a problem with my board yesterday, it was generating a spurious step every few seconds and you could hear them as faint ticks on the stepper whilst it was running. This was due to common mode noise on the step differential line, and is because I didn't bother to put a differential line receiver on the input lines, rather both the +ve and -ve signal are referenced to GND on the arduino. It was fixed by debouncing the inputs over 1 cpu cycle 62.5ns, i.e. reading them twice. However I think I will make a new board in a few days that properly terminates the differential signals, works well enough as it is to to get the machine working now. Any thoughts on the pros/cons of using a opto to terminate the differential signal like the stepper drivers do vs a proper line receiver?

    The next step is work out how to bury these proximity sensors in the machine, the Z will be a bit tight and I may need to source a much smaller switch.

  2. #132
    Not sure on the debouncing bit. Sounds like you have short duration spikes of noise but would need an o'scope to check. Some sort of filtering, ferrite beads or capacitors for example might sort it out but I haven't the experience with line receivers to advise you.

    We've discussed opto-couplers at length in the past (wasn't Doddy involved?) and I have been experimenting with a Long Bendy Optical Coupler (LBOC) recently but that will be for another thread.

    Kit
    An optimist says the glass is half full, a pessimist says the glass is half empty, an engineer says you're using the wrong sized glass.

  3. #133
    Someone mention Optos? Great for killing line noise, but in this case my usual mantra of propagation delay through the Opto applies (but only because I've been bitten by Optos in the past). Arguable you should use a reverse-connected diode to avoid reverse-biasing the LED in the opto.

    If you have noise on the line you really need to deal with it electrically, rather than through software, particularly with a finely crafted LUT solution as you have (I'm not taking the piss - it's a good solution here, mimicking one solution used by FPGAs for logic representation.... I'll be honest, when you first mentioned this project I was thinking it'd be a brilliant first-project for anyone looking to get into FPGAs, a Cyclone IV board will go cheap at around £20... but that sends the chat into a completely different direction and isn't really for this site) - in that case you could have easily configure for differential inputs. Anyway, as-it-is, I suppose my own view is clear from driving the spindle-encoder on the lathe - I use the MAX487 chips, on tuppeth-ha'peny Arduino RS485 interface boards to provide 120R differential drive/sinks as my weapon of choice.

  4. #134
    Hi Doddy,

    Yeh an FPGA would be an excellent choice although I don't have any non-BGA parts here and didn't want send out for 4 layer board to be made. Lattice have some TQFP parts that could be used but I haven't got any. I have some 485 line drivers though left over from running DMX lighting throughout my house, thanks for reminding me!

    On the noise issue, it is being caused by the 328p sampling the differential pair wrt ground without removing the common mode noise (which will always be there). If I'm right it would be completely eliminated by properly terminating the pair with a line receiver.

    The LUT does work nicely, I use an 8 bit address space at the moment, 6 input bits and 2 bits of state. I moved all my code into a loop that executes at startup, this iterates through the address space and writes the 8 bit output [2 bits of updated state as the FSM transitions, 6 bits of compressed output] into a 256byte block of memory aligned on 256byte memory boundaries. This removes the need to hand craft a LUT, all you are really doing is executing your logic for every possible input and caching the result.

    Then the actual runtime programme loop written in assembler reads the input port directly into the lower byte of the indirect addressing register pair, debounces, merges in the 2 bits of state, immediately does the lookup, this is made very easy by keeping the LUT is aligned with a 256 byte memory boundary.

    The assembler the decompresses the output bits, writes them out and updates the state bits. Repeat ad-nauseum.
    Last edited by devmonkey; 14-06-2020 at 04:34 PM.

  5. #135
    All home switch fixings are now done, it is amazing how long the little jobs take, this was a whole afternoon. Milled up a little block to hold the Z switch, decided it would be better outside of the axis rather than inside regards adjustment. Then had to drill two very awkward 12mm holes in the X bearing plates with a portable drill, for this I had to mill up a drill guide, still easier than dismantling the gantry.

    Click image for larger version. 

Name:	IMG_20200614_160329 (Large).jpg 
Views:	266 
Size:	95.4 KB 
ID:	28370 Click image for larger version. 

Name:	IMG_20200614_160351 (Large).jpg 
Views:	264 
Size:	98.6 KB 
ID:	28371 Click image for larger version. 

Name:	IMG_20200614_164852 (Large).jpg 
Views:	252 
Size:	120.4 KB 
ID:	28372 Click image for larger version. 

Name:	IMG_20200614_164954 (Large).jpg 
Views:	266 
Size:	95.3 KB 
ID:	28373 Click image for larger version. 

Name:	IMG_20200614_165056 (Large).jpg 
Views:	264 
Size:	101.7 KB 
ID:	28374

  6. #136
    Last of the tedious mechanical bits I think, energy chain carriers.

    Attachment 28375 Attachment 28376 Attachment 28377 Attachment 28378

    Next job soldering cables, lots of it, and bolting the machine stand to the floor.
    Last edited by devmonkey; 15-06-2020 at 03:21 PM.

  7. #137
    Question for Doddy,

    I've scoped the common mode noise and it isn't sufficient to cause a phantom step to be read at the 328p. I think the phantom steps I was detecting that I have 'fixed' by debouncing the read are actually being caused by reflections and/or induced voltage spikes as the differential pair switches. If this is correct placing a termination resistor across the pair as you do for rs485 should help do you concur?

    Cheers, Joe

  8. #138
    How do people usually wire the alarm outputs of the drivers?

    My plan was to place these in series with the estop but this wont actually work for me. Reason being estop unlatches the relay that switches the main contactor that switches AC into the driver PSU, this means that the drivers are unpowered until reset is pressed latching the relay, however the relay wont latch as the drivers are unpowered therefore cannot switch on their open collector alarm outputs breaking the estop circuit.

    The only thing I can think of is to add another relay in series with estop, via the normally closed contact and then have the driver alarms open this relay, this has the downside that you don't know if the alarm circuit is intact until it doesn't work.

  9. #139
    Quote Originally Posted by devmonkey View Post
    Question for Doddy,

    I've scoped the common mode noise and it isn't sufficient to cause a phantom step to be read at the 328p. I think the phantom steps I was detecting that I have 'fixed' by debouncing the read are actually being caused by reflections and/or induced voltage spikes as the differential pair switches. If this is correct placing a termination resistor across the pair as you do for rs485 should help do you concur?

    Cheers, Joe
    I guess you know a bit about signal theory - you're trying to match the characteristic impedance of the transmission line at both ends - just randomly throwing resistors on won't be as effective as a properly matched terminator - and yes, as per 485. What's the driving system?, have a look at that and match it.

  10. #140
    Quote Originally Posted by Doddy View Post
    I guess you know a bit about signal theory - you're trying to match the characteristic impedance of the transmission line at both ends - just randomly throwing resistors on won't be as effective as a properly matched terminator - and yes, as per 485. What's the driving system?, have a look at that and match it.
    Just taken the DDCS apart again, the differential outputs are all driven by a standard quad differential line drivers, AM26LV31, no resistors at the transmitting end. I'm driving this through a 2m db37 cable, not twisted pair, or if it is it is highly unlikely the right pairs are twisted. Still these are EIA-422 spec drivers same as max485, etc, so I reckon I wont go wrong with 120 ohms.

    It DDCS has a really nice board, has an onboard FPGA, Altera cyclone3 that does all the realtime stuff. I've taken a few photos whilst it is open.

Page 14 of 23 FirstFirst ... 41213141516 ... LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. BUILD LOG: 8x4 router build. Steel base & Aluminium gantry gantry
    By D-man in forum DIY Router Build Logs
    Replies: 57
    Last Post: 13-12-2019, 10:43 AM
  2. BUILD LOG: Design stage - All steel - 1200x750x110 - aluminium capable (hopefully)
    By oliv49 in forum DIY Router Build Logs
    Replies: 3
    Last Post: 08-06-2018, 01:18 PM
  3. welding steel base or just getting aluminium extrusion
    By reefy86 in forum Gantry/Router Machines & Building
    Replies: 200
    Last Post: 15-01-2018, 08:55 AM
  4. BUILD LOG: Steel Frame, Aluminium Hybrid Design Thread
    By f1sy in forum DIY Router Build Logs
    Replies: 0
    Last Post: 23-02-2016, 10:04 AM
  5. Steel vs Aluminium
    By gavztheouch in forum Metalwork Discussion
    Replies: 4
    Last Post: 26-05-2014, 10:11 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
  •