{"action":"created","issue":{"url":"https://api.github.com/repos/grbl/grbl/issues/570","labels_url":"https://api.github.com/repos/grbl/grbl/issues/570/labels{/name}","comments_url":"https://api.github.com/repos/grbl/grbl/issues/570/comments","events_url":"https://api.github.com/repos/grbl/grbl/issues/570/events","html_url":"https://github.com/grbl/grbl/issues/570","id":54375877,"number":570,"title":"Power supply control pin","user":{"login":"cjd000","id":7176783,"avatar_url":"https://avatars.githubusercontent.com/u/7176783?v=3","gravatar_id":"","url":"https://api.github.com/users/cjd000","html_url":"https://github.com/cjd000","followers_url":"https://api.github.com/users/cjd000/followers","following_url":"https://api.github.com/users/cjd000/following{/other_user}","gists_url":"https://api.github.com/users/cjd000/gists{/gist_id}","starred_url":"https://api.github.com/users/cjd000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjd000/subscriptions","organizations_url":"https://api.github.com/users/cjd000/orgs","repos_url":"https://api.github.com/users/cjd000/repos","events_url":"https://api.github.com/users/cjd000/events{/privacy}","received_events_url":"https://api.github.com/users/cjd000/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-14T20:59:35Z","updated_at":"2015-01-20T23:04:55Z","closed_at":null,"body":"Hi,\r\nThis is an addition request - not an issue, but let me start by saying what a fantastic job you guys are doing at making this kind of tech available to joe public. If it wasn't for you guys doing this, the general hobbyist like me wouldn't stand a chance!\r\n\r\nCurrently i am using a set of TB6560 single axis stepper controllers linked to a Atmel 328P board being powered by a computer ATX style Power supply.\r\n\r\nThe problem i have is that, as some of you may know, the TB6560 drivers require a particular power on sequence to ensure that the 5V supply is on before the motor power is applied and that the reverse is followed for switch off, otherwise these controllers can blow (from experience!). I've accomplished this by using the Coolant Mist pin as a PSU (power supply) control signal and hook up the 5v from the PSU USB \"always on\" output.\r\n\r\nThe advantage is that i can shut down the power at the end of a machining cycle (lights, vacuum table, spindle, fans, motors etc) all with one command - Coolant off.\r\n\r\nWhat i would like to see is this feature embedded so that 'feed hold' or soft resets etc control the power rails correctly. Also at initial power on i need to ensure that the PSU control pin is set correctly. This pin on all ATX style PSU's is active low so i also need to figure out how to invert the pin. Currently i'm using a transistor circuit to invert it (its probably very easy through the code but i'm struggling to find it)\r\n\r\nIs this something you would be interested in adding as a feature? I'm sure there are others using these PSU's for their CNC systems as they provide high current and a stable 12v & 5v output.\r\n\r\nThanks\r\nChris\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/grbl/grbl/issues/comments/70753174","html_url":"https://github.com/grbl/grbl/issues/570#issuecomment-70753174","issue_url":"https://api.github.com/repos/grbl/grbl/issues/570","id":70753174,"user":{"login":"cjd000","id":7176783,"avatar_url":"https://avatars.githubusercontent.com/u/7176783?v=3","gravatar_id":"","url":"https://api.github.com/users/cjd000","html_url":"https://github.com/cjd000","followers_url":"https://api.github.com/users/cjd000/followers","following_url":"https://api.github.com/users/cjd000/following{/other_user}","gists_url":"https://api.github.com/users/cjd000/gists{/gist_id}","starred_url":"https://api.github.com/users/cjd000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjd000/subscriptions","organizations_url":"https://api.github.com/users/cjd000/orgs","repos_url":"https://api.github.com/users/cjd000/repos","events_url":"https://api.github.com/users/cjd000/events{/privacy}","received_events_url":"https://api.github.com/users/cjd000/received_events","type":"User","site_admin":false},"created_at":"2015-01-20T23:04:55Z","updated_at":"2015-01-20T23:04:55Z","body":"Thanks for the response. \r\n\r\nI have the hardware side fixed using the transistor circuit so the PSU is only enabled when arduino outputs the high state for mist control.\r\n\r\nWhat I need the help with is the software side as my solution is a bit of a temporary bodge!\r\nWhat I'd like to get to is utilising the last unused pin on the 328 board for this and then being able to use a command to turn the power on and off without some of the built in limitations of using the mist control pin.\r\n\r\nEg, automatically turn the power on a second or two before starting the homing procedure, adding a power on/off button to the grbl interface software and having the power auto off after the gcode is finished etc.\r\n\r\nAll this functionality can be added by the interface designers once the firmware has that extra output pin setup. Kind of like a 'universal' control pit that can be enabled from the firmware configure.h and pins files with invertable output and configurable command to turn on/off the pin\r\n\r\nAny help you could give on this would be great as I'm sure others would appreciate the flexibility of a controllable extra output pin, even if it's just to enable the stepper controller fans!\r\n\r\nRegards,\r\nChris\r\n\r\nSent from my iPad\r\n\r\n> On 20 Jan 2015, at 9:37 pm, doppelhub <notifications@github.com> wrote:\r\n> \r\n> When you issue a reset, the Arduino pins are unprogrammed, and will float until grbl reloads. Unfortunately, there's nothing that can be done in software. There same condition occurs whenever the 328p is unplugged, or plugged in and has not yet loaded grbl? Or when your computer goes to sleep.\r\n> \r\n> If I understand your requirements correctly, you need a hardware solution, such as the transistor circuit you've already mentioned. In all above cases, the pins are floating by default, so you'll need a pull down (if your transistor circuitry doesn't already handle this). Another solution is to gate the external power supply with a 5 V saturation N channel FET, instead of the logic input. With the proper (e.g. 2 kOhm) pull down resistor, you can guarantee the power supply never hits the TB6560 until the 5V rail is up and stable (e.g. grbl has loaded and pulled the FET gate high).\r\n> \r\n> Please let me know if I've misunderstood your deliverables. Ultimately, this is an Arduino HW limitation... no discrete pulldowns onboard.\r\n> \r\n> —\r\n> Reply to this email directly or view it on GitHub.\r\n> \r\n"}}