Linuxcnc ethernet over Arduino?
- Holzwurm56
- Offline
- Premium Member
- 
				  
		Less
		More
		
			
	
		- Posts: 134
- Thank you received: 0
			
	
						27 Feb 2017 08:46				#88656
		by Holzwurm56
	
	
		
			
	
			
			 		
													
	
				Replied by Holzwurm56 on topic Linuxcnc ethernet over Arduino?			
			
				Hello M4Mazakuser,
you understand what i mean. Mesa is super, but it must be a easy way for beginner to use Linuxcnc with an inexpencive stuff and without printerport. For a beginner who build this "Käsefräse" from scrap are 10 I/Os enough. Can you tell us your way with multiple UNOs.
Thanks
Hans
					you understand what i mean. Mesa is super, but it must be a easy way for beginner to use Linuxcnc with an inexpencive stuff and without printerport. For a beginner who build this "Käsefräse" from scrap are 10 I/Os enough. Can you tell us your way with multiple UNOs.
Thanks
Hans
Please Log in or Create an account to join the conversation.
- M4MazakUser
- Offline
- Premium Member
- 
				  
		Less
		More
		
			
	
		- Posts: 155
- Thank you received: 7
			
	
						01 Mar 2017 01:53				#88791
		by M4MazakUser
	
	
		
			
	
			
			 		
													
	
				Replied by M4MazakUser on topic Linuxcnc ethernet over Arduino?			
			
				I have tried the io over ethernet (it used udp)that someone posted on this forum and for buttons/ other input stuff it works great.not fast enough for an encoder but.			
					Please Log in or Create an account to join the conversation.
- cromaglious
- 
				  
- Offline
- New Member
- 
				  
		Less
		More
		
			
	
		- Posts: 7
- Thank you received: 0
			
	
						06 Apr 2017 19:37				#90978
		by cromaglious
	
	
		
			
	
			
			 		
													
	
				Replied by cromaglious on topic Linuxcnc ethernet over Arduino?			
			
				I have 3 jmc-motor.com Integrated steppers coming tomorrow. I don't need to read encoders.  I just need to check the ESTOP/ERROR pin to see if the estop or one of the motors has alarmed.  When they get here I find out if I can run them as NO or NC switches or if I need to get some more MFQ2222 chips which I already use for home sensors
I'm rewriting the uno ethernet code I found for the Mega2560. From:
forum.linuxcnc.org/24-hal-components/287...rduino-over-ethernet
I have also found using PORTA through PORTM for using coordinated multipin fires at the same time. I can use PA0-PA7 PORTA Digital pins 22 through 29 for 8 axis of DiRECTION pins. and 6usecs later use PC7-PC0 PORTC for digital pins 30-37 for step.
Using
PORTA = B11001101;
delay(6);
PORTC = B00001011;
instead of a whole bunch of
digitalWrite(22,HIGH);
digitalWrite(23,HIGH);
digitalWrite(24,HIGH);
digitalWrite(25,HIGH);
digitalWrite(26,LOW); ...
Integrated Closed-Loop Stepper 2nm 285ozin
www.ebay.com/itm/like/262565317443?lpid=82&chn=ps&ul_noapp=true
This is the layout of the Mega 2560 chip PA0 is PORTA0 which is Arduino Pin Digital 22
www.arduino.cc/en/Hacking/PinMapping2560
					I'm rewriting the uno ethernet code I found for the Mega2560. From:
forum.linuxcnc.org/24-hal-components/287...rduino-over-ethernet
I have also found using PORTA through PORTM for using coordinated multipin fires at the same time. I can use PA0-PA7 PORTA Digital pins 22 through 29 for 8 axis of DiRECTION pins. and 6usecs later use PC7-PC0 PORTC for digital pins 30-37 for step.
Using
PORTA = B11001101;
delay(6);
PORTC = B00001011;
instead of a whole bunch of
digitalWrite(22,HIGH);
digitalWrite(23,HIGH);
digitalWrite(24,HIGH);
digitalWrite(25,HIGH);
digitalWrite(26,LOW); ...
Integrated Closed-Loop Stepper 2nm 285ozin
www.ebay.com/itm/like/262565317443?lpid=82&chn=ps&ul_noapp=true
This is the layout of the Mega 2560 chip PA0 is PORTA0 which is Arduino Pin Digital 22
www.arduino.cc/en/Hacking/PinMapping2560
Please Log in or Create an account to join the conversation.
- cromaglious
- 
				  
- Offline
- New Member
- 
				  
		Less
		More
		
			
	
		- Posts: 7
- Thank you received: 0
			
	
						02 May 2017 23:50				#92556
		by cromaglious
	
	
		
			
	
			
			 		
													
	
				Replied by cromaglious on topic Linuxcnc ethernet over Arduino?			
			
				Yes Arduino can do 5khz easily and by using PORTA (on the MEGA2560) raising 8 pins all at the same rime is trivial is easy.  I'm working on a udpioMEGA project as we speak.  pastebin.com/Rndt0gaz the original code was for the uno, which runs on the Nano.  I have 24pins digital out, 10pins PWM out, 16pins digital input and 6pins read from interrupts and 2 polled pins.  Packet sent from linuxcnc is 14bytes and the receive packet (sent from the Arduino MEGA) is 3bytes.  Writing the 24pins is 3 lines PORTA = rxbuffer[1]; PORTC = rxbuffer[2]; PORTL = rxbuffer[3]; for(i=0; i<PWMPINCOUNT; i++) { analogWrite(pwmpin);}
Most speed controls want a pwm signal arong 1khz. The mega has 4pins to can set the around 980hz for pwm.
Right now I'm fighting a python issue getting it all working with gwibber.
					Most speed controls want a pwm signal arong 1khz. The mega has 4pins to can set the around 980hz for pwm.
Right now I'm fighting a python issue getting it all working with gwibber.
Please Log in or Create an account to join the conversation.
		Moderators: PCW, jmelson	
		Time to create page: 0.070 seconds	
