Arduino IO Expansion

More
27 Dec 2023 09:28 #289155 by blazini36
Replied by blazini36 on topic Arduino IO Expansion
Is there any possibillity of adding a low performance stepgen with basic position feedback to this? I have a project where I need to remotely drive 3 tiny steppers @ 1khz max, possibly higher if microstepping is possible on that end but I'm not sure. Rest of the system already uses LinuxCNC and it wouldn't be practical to run these steppers from a Mesa card. I already have a custom PCB at that location, so I could add an attiny or something and communicate via UART @ 2.5mbaud. The documentation mentions this running over USB but it looks like it's just using the USB serial port so I assume UART would be fine as well?

Please Log in or Create an account to join the conversation.

More
01 Jan 2024 02:54 - 01 Jan 2024 02:55 #289457 by COFHAL
Replied by COFHAL on topic Arduino IO Expansion
I don't understand how to use the parameters, arduino. xx. x-invert. I understand that it is to invert the digital inputs.
Last edit: 01 Jan 2024 02:55 by COFHAL.

Please Log in or Create an account to join the conversation.

More
26 Feb 2024 13:21 #294515 by billykid
Replied by billykid on topic Arduino IO Expansion
I had made a meter for the current of a dc spindle with an acs712 connected to arduino nano analog pin 0 working with arduinoIO made by Dino. now I tried to install mint debian edition but I couldn't make it work anymore, so I tried arduino connector. Arduino is loaded in hal and also marks the analog value read, but when I want to use it it tells me that the pin does not exist. I attach the errors.
Attachments:

Please Log in or Create an account to join the conversation.

More
28 Feb 2024 15:34 #294697 by AlexMagToast
Replied by AlexMagToast on topic Arduino IO Expansion
Sorry guys, I somehow was not notified by your posts.
@COFHAL If halrun can't find the py file run python3 --version.
then in the .py file change the first line to match your version, this seems to help.
Also arduino.xx.x-invert is a parameter you can set to True in your HAL file, to invert the Logic of this pin.

@blazini36 May I ask which usecase you have in mind? How would you like to interface with the stepgens?
The following user(s) said Thank You: COFHAL

Please Log in or Create an account to join the conversation.

More
28 Feb 2024 15:36 #294698 by AlexMagToast
Replied by AlexMagToast on topic Arduino IO Expansion
@billykid
How are you using it? Maybe the arduino-connector is not loaded before hal tries to use the Pins?
The following user(s) said Thank You: billykid

Please Log in or Create an account to join the conversation.

More
28 Feb 2024 19:28 #294718 by blazini36
Replied by blazini36 on topic Arduino IO Expansion
@Alex, you had responded to the github request I made of the same.
The following user(s) said Thank You: AlexMagToast

Please Log in or Create an account to join the conversation.

More
28 Feb 2024 22:22 #294735 by billykid
Replied by billykid on topic Arduino IO Expansion
Now it works, I changed the position of the "loadusr arduino" line and it starts normally. it doesn't measure yet but I will have to change some settings... now pin a0 measures 511 which corresponds to 2.5 volts of the ACS712 sensor at zero current. However, if the current varies and the pin drops to 2 volts, the measurement on HAL does not move, it seems to only read the first time.

Please Log in or Create an account to join the conversation.

More
28 Feb 2024 22:56 #294740 by AlexMagToast
Replied by AlexMagToast on topic Arduino IO Expansion
hmm, thats odd.

Please Log in or Create an account to join the conversation.

More
03 Mar 2024 08:26 #294990 by blazini36
Replied by blazini36 on topic Arduino IO Expansion
I posted an issue in the git explaining most of the problems I'm having with this. Might be better to do it here. I'll attach some examples that do work since it may help.
 
There is some weird issue with loading the python component. I  made a separate hal file to load arduino-connector and make the connections. I kept getting "pin xxx does not exist" regardless of where "loadusr arduino-connector" was in the file until I set "[HAL] TWOPASS = ON" in the ini file.

I had some issues with encoders, first they were just counting non-stop but I realized this is just because of the joystick conflict, the joysticks have to be disabled in the firmware as well. I have 4 encoders. 3 are attached to both interrupt pins, 1 is no interrupt. 2 of the interrupt encoders work fine. The other 2 do not. I'm not sure why the 3rd interrupt encoder does not work as it doesn't work with a simple sketch using the QuadEncoder  library either. I found another sketch that uses no interrupt library and the 3rd and 4th encoder work fine with this. I guess the point is, arduino-connector does not seem to work with non-interrupt encoders for some reason.

This one works with the interrupts
 

File Attachment:

File Name: EncoderTes...rupt.txt
File Size:1 KB


This one works with the non-interrupt encoders
 

File Attachment:

File Name: EncoderTes...rupt.txt
File Size:4 KB


I can't get the key matrix or LED mux working at all really. The key matrix kinda works but the key pins are very unreliable. The matrix hal pins "stick" or don't register, or just register very flaky. I've tried setting the LED muxed hal pins and they just don't seem to work right at all.

I've tested the key matrix with this sketch, it works perfectly printing to the serial terminal:
 

File Attachment:

File Name: MatrixKeyp...Test.txt
File Size:2 KB


I've tested the LED matrix with this sketch, works perfectly:
 

File Attachment:

File Name: LEDMatrix_Test.txt
File Size:1 KB


I've posted this before, this is the matrix circuit and Arduino connection
 
 

The Normal IO that I tested so far seems to work OK but I didn't spend a whole lot of time with it as I was working on figuring out if these issues were my problem or Arduino-connector.

Here is the firmware and python component I tried last, could be some issues here I'm not really one for code:
 

File Attachment:

File Name: LinuxCNC_A...ctor.txt
File Size:33 KB

 

File Attachment:

File Name: arduino-connector.py
File Size:18 KB





 
Attachments:

Please Log in or Create an account to join the conversation.

More
03 Mar 2024 10:29 #295001 by tommylight
Replied by tommylight on topic Arduino IO Expansion
Is the encoder issue on Arduino Nano?
Nano has only 2 interrupt pins, Mega has 6, no idea how many the ESP8266 or ESP32 have.

Please Log in or Create an account to join the conversation.

Time to create page: 0.119 seconds
Powered by Kunena Forum