Replies: 1 comment 1 reply
-
Should not be too hard - if
See the ESP32 driver for how that was made optional.
Already supported, define
Mist is already optional, see the ESP32 driver for how flood was made optional.
IMO no - but depends on your coding skills. By adding board specific driver code you can register handlers supporting the ioports interface - M42 in the openpnp plugin uses this, so no need to modify that. The ioports interface supports reading from inputs as well, M43 should be implemented on top of the interface in a similar manner as M42? |
Beta Was this translation helpful? Give feedback.
-
Hi,
So after being distracted for a year or so, I'm back on my conversion of a Yamaha YM84 Pick and Place machine to OpenPnP.
I'd like to use a single controller based on a Teensy4.1 board to do the lot, and there is a lot to do. :)
The machine has an I/O board that controls 70+ sensor inputs and 60+ actuator outputs. The I/O board has an 8031 processor that looked after the I/O and interfaces to the main controller via a SCSI bus interface.
I built a replacement controller for the 8031. I used a PIC18F4550 USB controller and have a jumper cable that plugs into the I/O board in place of the 8031 DIP chip. The 8031 has an 8 bit data bus that is multiplexed with the lower 8 bits of the address bus. My controller mimics this and is able to control the I/O board. Amongst other M codes, I use the M42 Pxxx Sx to control the outputs and am using the M43 Pxxx to read the inputs. I've done this with a primative Gcode parser and it all seems to work ok.
What I'm thinking of doing is looking at implementing an SPI interface that will control a MCP23S17 serial to 16-Bit Remote Bidirectional I/O Port. I'd prefer SPI over I2C as it has better recovery capability and is a little more robust.
I'd also like to remove the HAL components so that I can reuse their allocated pins for general purpose inputs and outputs. Ideally, if I could reuse enough of the pins I may be able to get rid of the MCP23S17 The changes I'd like to make are;
The M42, M43, M105, M115 and M400 that I have in my I/O processor will be put into the OpenPnP plugin. The MCP23S17 I/O expander will probably go into its own plugin I guess.
Is there a to remove my unwanted HAL components so I can reuse their assigned pins.
Is it difficult to add in an SPI interface for controlling the MCP23S17 without interfering with the core functionality?
For interest, below are sensor and actuator definitions for the I/O board.
///////////////////// I/O Port Register defines /////////////////////
///////////////////// Input Register defines /////////////////////
// Port DI1 Bit 0 : 100 Opto-Isolator --
// Port DI1 Bit 1 : Opto-Isolator --
// Port DI1 Bit 2 : Opto-Isolator --
// Port DI1 Bit 3 : Opto-Isolator --
// Port DI1 Bit 4 : Opto-Isolator DI14 X ORG
// Port DI1 Bit 5 : Opto-Isolator DI15 Y ORG
// Port DI1 Bit 6 : Opto-Isolator DI16 Z ORG
// Port DI1 Bit 7 : Opto-Isolator DI17 R ORG
//
// Port DI2 Bit 0 : 108 Opto-Isolator -- HLT
// Port DI2 Bit 1 : 109 Opto-Isolator DI21 Interlock (hold)
// Port DI2 Bit 2 : 110 Opto-Isolator DI22 Gate In
// Port DI2 Bit 3 : 111 Opto-Isolator DI23 Main Enterance
// Port DI2 Bit 4 : 112 Opto-Isolator DI24 Set Position
// Port DI2 Bit 5 : 113 Opto-Isolator DI25 Main Enterance
// Port DI2 Bit 6 : 114 Opto-Isolator DI26 pin 1 Up Fixed Side
// Port DI2 Bit 7 : 115 Opto-Isolator DI27 pin 2 Up Moveable Side
//
// Port DI3 Bit 0 : 116 Opto-Isolator DI30 Head 1 lower
// Port DI3 Bit 1 : 117 Opto-Isolator DI31 Head 2 Lower
// Port DI3 Bit 2 : Opto-Isolator DI32 Spare
// Port DI3 Bit 3 : Opto-Isolator DI33 Head P Vac
// Port DI3 Bit 4 : 120 Opto-Isolator DI34 Head1 Vac low bit
// Port DI3 Bit 5 : 121 Opto-Isolator DI35 Head2 Vac low bit
// Port DI3 Bit 6 : 122 Opto-Isolator DI36 Head1 Vac Hi bit
// Port DI3 Bit 7 : 123 Opto-Isolator DI37 Head2 Vac Hi bit
//
// Port DI4 Bit 0 : 124 Opto-Isolator DI40 Spare
// Port DI4 Bit 1 : 125 Opto-Isolator DI41 Sub Stopper
// Port DI4 Bit 2 : 126 Opto-Isolator DI42 Push up limit
// Port DI4 Bit 3 : Opto-Isolator DI43 Spare
// Port DI4 Bit 4 : Opto-Isolator DI44 Spare
// Port DI4 Bit 5 : Opto-Isolator DI45 Spare
// Port DI4 Bit 6 : 130 Opto-Isolator DI46 Centre Unit Y Clamp
// Port DI4 Bit 7 : 131 Opto-Isolator DI47 Centre Unit X Clamp
//
// Port DI5 Bit 0 : 132 Opto-Isolator DI50 Beam Sensor
// Port DI5 Bit 1 : Opto-Isolator DI51 Spare
// Port DI5 Bit 2 : Opto-Isolator DI52 Spare
// Port DI5 Bit 3 : Opto-Isolator DI53 Spare
// Port DI5 Bit 4 : 136 Opto-Isolator DI54 Counter Reset
// Port DI5 Bit 5 : Opto-Isolator DI55 Spare
// Port DI5 Bit 6 : 138 Opto-Isolator DI56 Nozzle clamp ATC
// Port DI5 Bit 7 : 139 Opto-Isolator DI57 Nozzle Station up limit
//
// Port DI6 Bit 0 : 140 Opto-Isolator DI60 Head 3 Lower Limit
// Port DI6 Bit 1 : Opto-Isolator DI61 Spare
// Port DI6 Bit 2 : Opto-Isolator DI62 Head P lower
// Port DI6 Bit 3 : Opto-Isolator DI63 Spare
// Port DI6 Bit 4 : 144 Opto-Isolator DI64 Head3 Vac low bit
// Port DI6 Bit 5 : Opto-Isolator DI65 Spare
// Port DI6 Bit 6 : 146 Opto-Isolator DI66 Head3 Vac hi bit
// Port DI6 Bit 7 : Opto-Isolator DI67 Spare
//
// Port DI7 Bit 0 : 148 Opto-Isolator DI70 Nozzle 1 Recognition ATC
// Port DI7 Bit 1 : 149 Opto-Isolator DI71 Nozzle 2 Recognition ATC
// Port DI7 Bit 2 : 150 Opto-Isolator DI72 Nozzle 3 Recognition ATC
// Port DI7 Bit 3 : 151 Opto-Isolator DI73 Centering Unit Z Lower limit
// Port DI7 Bit 4 : Opto-Isolator DI74 ACK
// Port DI7 Bit 5 : Opto-Isolator DI75 Tray Wait
// Port DI7 Bit 6 : Opto-Isolator DI76 Tray Feeder Alarm 2
// Port DI7 Bit 7 : Opto-Isolator DI77 Tray Feeder Alarm 1
//
// Port DI8 Bit 0 : 156 Opto-Isolator DI80
// Port DI8 Bit 1 : Opto-Isolator DI81
// Port DI8 Bit 2 : Opto-Isolator DI82
// Port DI8 Bit 3 : Opto-Isolator DI83
// Port DI8 Bit 4 : Opto-Isolator DI84
// Port DI8 Bit 5 : Opto-Isolator DI85
// Port DI8 Bit 6 : Opto-Isolator DI86
// Port DI8 Bit 7 : Opto-Isolator DI87
//
// Port DI9 Bit 0 : 164 Opto-Isolator DI90
// Port DI9 Bit 1 : Opto-Isolator DI91
// Port DI9 Bit 2 : Opto-Isolator DI92
// Port DI9 Bit 3 : Opto-Isolator DI93
// Port DI9 Bit 4 : Opto-Isolator DI94
// Port DI9 Bit 5 : Opto-Isolator DI95
// Port DI9 Bit 6 : Opto-Isolator DI96
// Port DI9 Bit 7 : Opto-Isolator DI97
//
// Port DIa Bit 0 : 172 Opto-Isolator DIa0
// Port DIa Bit 1 : Opto-Isolator DIa1
// Port DIa Bit 2 : Opto-Isolator DIa2
// Port DIa Bit 3 : Opto-Isolator DIa3
// Port DIa Bit 4 : Opto-Isolator DIa4
// Port DIa Bit 5 : Opto-Isolator DIa5
// Port DIa Bit 6 : Opto-Isolator DIa6
// Port DIa Bit 7 : Opto-Isolator DIa7
//
// Port DIb Bit 0 : 180 Opto-Isolator DIb0
// Port DIb Bit 1 : Opto-Isolator DIb1
// Port DIb Bit 2 : Opto-Isolator DIb2
// Port DIb Bit 3 : Opto-Isolator DIb3
// Port DIb Bit 4 : Opto-Isolator DIb4
// Port DIb Bit 5 : Opto-Isolator DIb5
// Port DIb Bit 6 : Opto-Isolator DIb6
// Port DIb Bit 7 : Opto-Isolator DIb7
//
//
///////////////////// Output Register defines /////////////////////
// Port D00 Bit 0 : 10 NPN Array DO00 Alarm Red Lamp
// Port D00 Bit 1 : 11 N/A
// Port D00 Bit 2 : 12 SPST Relay K14 DO02
// Port D00 Bit 2 : 12 SPST Relay K1 T02
// Port D00 Bit 3 : 13 SPST Relay K5 DO03 Caution Yellow Lamp
// Port D00 Bit 4 : 14 SPST Relay K7 DO04 Gate Out
// Port D00 Bit 5 : 15 DPDT Relay K17 DO05 RUN Green Lamp
// Port D00 Bit 6 : 16 NPN Array DO06 Main Conveyor
// Port D00 Bit 7 : 17 N/A Buzzer?
//
// Port D01 Bit 0 : 18 NPN Array DO10 Main Stopper
// Port D01 Bit 1 : 19 NPN Array DO11 Locator Pin
// Port D01 Bit 2 : 20 NPN Array --
// Port D01 Bit 3 : 21 NPN Array --
// Port D01 Bit 4 : 22 NPN Array --
// Port D01 Bit 5 : 23 N/A
// Port D01 Bit 6 : 23 N/A
// Port D01 Bit 7 : 25 N/A
//
// Port D02 Bit 0 : 26 NPN Array DO20 Head1 Down
// Port D02 Bit 1 : 27 NPN Array DO21 Head2 Down
// Port D02 Bit 2 : 28 NPN Array DO22 Spare
// Port D02 Bit 3 : 29 NPN Array DO23 HeadP Vac
// Port D02 Bit 4 : 30 NPN Array DO24 Head1 Vac Blow
// Port D02 Bit 5 : 31 NPN Array DO25 Head2 Vac
// Port D02 Bit 6 : 32 NPN Array DO26 Spare
// Port D02 Bit 7 : 33 NPN Array DO27 Spare
//
// Port D03 Bit 0 : 34 NPN Array DO30 Camera
// Port D03 Bit 1 : 35 NPN Array DO31 Conveyor Reverse
// Port D03 Bit 2 : 36 SPST Relay K8 DO32 Push Up
// Port D03 Bit 3 : 37 SPST Relay K9 DO33 Edge Clamp
// Port D03 Bit 4 : 38 SPST Relay K10 DO34 Conveyor Speed
// Port D03 Bit 5 : 39 SPST Relay K11 DO35 PCB Push in
// Port D03 Bit 6 : 40 SPST Relay K12 DO36 Tape Cutter
// Port D03 Bit 7 : 41 SPST Relay K13 DO37 Counter
// Port D03 Bit 5 : 39 SPST Relay K15 T35 PCB Push in
// Port D03 Bit 7 : 41 SPST Relay K16 T37 Tape Cutter
//
// Port D04 Bit 0 : 42 NPN Array DO40 Head3 Down
// Port D04 Bit 1 : 43 NPN Array DO41 Strobe
// Port D04 Bit 2 : 44 NPN Array DO42 Head P Down
// Port D04 Bit 3 : 45 NPN Array DO43 Tray bit 0B
// Port D04 Bit 4 : 46 NPN Array DO44 Head 3 Vac
// Port D04 Bit 5 : 47 NPN Array DO45 Tray Bit 1B
// Port D04 Bit 6 : 48 NPN Array DO46 Spare
// Port D04 Bit 7 : 49 NPN Array DO47 Tray Bit 2B
//
// Port D05 Bit 0 : 50 NPN Array DO50 Centering Unit Y
// Port D05 Bit 1 : 51 NPN Array DO51 Centering Unit X
// Port D05 Bit 2 : 52 NPN Array DO52 Nozzle Clamp
// Port D05 Bit 3 : 53 NPN Array DO53 Nozzle Station Up
// Port D05 Bit 4 : 54 NPN Array DO54 Centering Unit Z
// Port D05 Bit 5 : 55 NPN Array DO55 Spare
// Port D05 Bit 6 : 56 NPN Array DO56 Tray Bit 3B
// Port D05 Bit 7 : 57 NPN Array DO57 Spare
//
// Port D06 Bit 0 : 58 TTL DO60
// Port D06 Bit 1 : 59 TTL DO61
// Port D06 Bit 2 : 60 TTL DO62
// Port D06 Bit 3 : 61 TTL DO63
// Port D06 Bit 4 : 62 TTL DO64
// Port D06 Bit 5 : 63 TTL DO65
// Port D06 Bit 6 : 64 TTL DO66
// Port D06 Bit 7 : 65 TTL DO67
//
// Port D07 Bit 0 : 66 TTL DO70
// Port D07 Bit 1 : 67 TTL DO71
// Port D07 Bit 2 : 68 TTL DO72
// Port D07 Bit 3 : 69 TTL DO73
// Port D07 Bit 4 : 70 TTL DO74
// Port D07 Bit 5 : 71 TTL DO75
// Port D07 Bit 6 : 72 TTL DO76
// Port D07 Bit 7 : 73 TTL DO77
//
Cheers,
Peter
Beta Was this translation helpful? Give feedback.
All reactions