Controlling Outputs and writing code

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

Post Reply
Ian Tilley
Posts: 3
Joined: Sat Aug 08, 2020 8:42 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: acorn-3550
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Controlling Outputs and writing code

Post by Ian Tilley »

Hi All,

I have made a machine that has a 'forklift' type operation on it that requires a hydraulic valve to operate to lower it down segment at a time (8 positions in total). I would like to use the acorn outputs to do this. I have attached a hand drawn schematic of basic wiring, plumbing and operation.

Process likes and wants if achievable...

I want to call for output 8 to operate (M68) and have the forklift go down with the hydraulic valve until it reaches or sits on the limit switch and then turn off output 8 (M88).

The problem I have or foresee is that if I am to use the limit switch as an input, when the operation starts it is sitting on the limit switch i.e telling it to stop. I need it to not 'see' the limit switch for a second or so (enough time for the lowering of forklift to get off it) and then start to look for it after to then to be able to stop output 8 (M88).

I have a feeling there is a macro or something that could be written to overcome this simply. I would appreciate if someone could help me with this as the only alternative I am able to achieve is a cumbersome external setup that would take some time to build with timers and relays etc.

Thank You in advance.

Ian Tilley
Attachments
Operation.JPG
report_0035FF8F6DF2-0723203550_2020-08-20_20-43-45.zip
(588 KiB) Downloaded 136 times
Ian Tilley
Posts: 3
Joined: Sat Aug 08, 2020 8:42 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: acorn-3550
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Controlling Outputs and writing code

Post by Ian Tilley »

Hi All,

In the meantime I have been studying the 'Acorn CNC12 Macro Programming' (Page 13) of the PDF download and have come up with might be a possible solution for my problem...


M94 /68 ;Activate Output 8
G4 P1.5 ;Wait 1.5 seconds
IF #50003 THEN M95 /68 ;If Input 3 is closed then deactivate output 8


Could something like this be a possibility?

Thanks
Ian
cncsnw
Posts: 3855
Joined: Wed Mar 24, 2010 5:48 pm

Re: Controlling Outputs and writing code

Post by cncsnw »

A timer like that can work, but there is inevitably some guesswork involved in waiting long enough, but not too long.

In your case, couldn't you simply:
1) Activate the solenoid (M94)
2) Wait until the switch is open (M100)
3) Wait until the switch is closed (M101)
4) Turn off the solenoid (M95)
?
Dave_C
Posts: 669
Joined: Wed Nov 15, 2017 8:25 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: Springfield, MO. USA
Contact:

Re: Controlling Outputs and writing code

Post by Dave_C »

I have made a machine that has a 'forklift' type operation on it that requires a hydraulic valve to operate to lower it down segment at a time (8 positions in total.
This sounds a lot like a hydraulic elevator for an 8 story building!

If you used one input for each of all the 8 levels and you just want to go sequentially down one level at a time then the program might not be all that hard. Basically ignore the tripped limit you are on and move until the next one trips. That is still going to require some decent programing.

What about going up? Will the need always be to go from the bottom all the way to level 8 or are there many combinations of levels needed?

How far from top to Bottom? IE: Max travel distance in inches...

If you used a controller that could read a glass scale and if you had one long enough you could just write g-code to move to an absolute position on the glass scale. One scale input and two relay outputs. One for raising and one for lowering. (Assuming a hydraulic system with a raise solenoid and one for lowering)

Sounds like a fun project and many ways to go at it...

Dave C.
Grizzly G0678 Mill ,CNC conversion with Acorn. G4004G Lathe, Mach 3 conversion to Acorn.
Ian Tilley
Posts: 3
Joined: Sat Aug 08, 2020 8:42 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: acorn-3550
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Controlling Outputs and writing code

Post by Ian Tilley »

Hi Guys,

Thanks for the reply's it was very helpful. I didn't think to wait for the opening and closing of the switch. The code looks like the following and is working well.

M94 /68 ;Activate Output 8
M100/2 ;Wait for input 2 to open
M101/2 ;Wait for input 2 to close
M95 /68


The setup only has one switch on it and when going up it is controlled manually. It is a forklift on an agricultural machine to pick up small square bales. The machine weighs about 8 ton and will carries 320 small square bales behind a tractor.

Thanks again.
Ian
cnckeith
Posts: 7334
Joined: Wed Mar 03, 2010 4:23 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Contact:

Re: Controlling Outputs and writing code

Post by cnckeith »

Ian, please post some photos and or video! we'd all like to see this one! :-)
Need support? READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
Gear we use but don't sell. https://www.centroidcnc.com/centroid_di ... _gear.html
andyolney
Posts: 26
Joined: Sat Nov 11, 2017 7:26 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: Port Townsend, WA

Re: Controlling Outputs and writing code

Post by andyolney »

I'm curious, are you using the acorn stepper motor functionality to control your bale pickup mechanism? Andy Olney
Black Forest
Posts: 346
Joined: Thu Nov 23, 2017 1:39 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Controlling Outputs and writing code

Post by Black Forest »

Oh yeah we want to see this machne! Having hand loaded thousands of hay bales I want to see this machine! A cnc controlled hay wagon...Oh yeah!
Post Reply