I have my Arduino Nano wired up for grbl as such: Connecting Grbl · gnea/grbl Wiki · GitHub
The only different things I have done, is I am using 5V from the Arduino to power a relay to turn the coolant pump on/off. Everything works fine until I try to wire in the D11 pin. The machine can home, turn on the coolant and jog normally.
The issue I am having is trying to use the D11 pin to control a PWN to voltage 0-10V board (This board is powered by 24V inverter than also runs the stepper driver) That PWN to voltage board is then ran to the VFD which runs the spindle. The VFD is wired and programmed in the same way shown here: VFD Spindle Control via OpenBuilds BlackBox Controller and Software - YouTube
If I try to turn the spindle on 24000 RPM or even 2400RPM, the Arduino loses connection to the PC after the spindle barely spins for a second. If the D11 pin is plugged in and I try to turn the coolant pump on (A3 pin) the same issue happens.
If anything, all I want is to be able to turn the spindle off and on through the VFD (It will almost always be running at 24000rpm)
I would like You to post the schematics.
How is the Nano powered?
Powering a relay module from the controller is bad practise, or worse.
Lots or words but until schematics are posted they get no attention from here.
Module working voltage: DC 12V-30V; (current greater than 100mA)
PWM signal receiving frequency range: 1KHZ-3KHZ
PWM signal input level range:
The peak-to-peak value is 4.5V to 10V, and the jumper cap is inserted at 5V. This type of level signal is mainly for the conventional industrial control card, 5V CPU interface;
The peak-to-peak value is 12 to 24V, and the jumper cap is inserted at 24V. This type of level signal is mainly for the conventional PLC interface.
Conversion range: 0%-100% PWM conversion to 0-10V voltage
Allowable error: 5%
The nano is powered by USB.
I figured it might be bad to do so. I will rewire the relay to a PC power supply at least for it's 5V, do I need to do the same with the nano in hopes of fixing it?
This is my first time working with an arduino/more complex electronics and I may be confused as to what I am misunderstanding here
Thanks. Should not be any problem interfacing it.
Where is Your code? Autoformat the code in the IDE and use code tags, </>, when pasting.
Check the PWM frequency for the PWMing pin.
I don't know the nano. On UNOs there are 990 Hz and 495 Hz used for different pins.
You could make a test code varying the PWM and that way check the RPM response from the motor.
I am using the standard code for GRBL 1.1. I can't get to my machine for a while to copy and paste it exactly. But the frequency could be my issue if the Arduino nano puts out too low of a frequency. I could always buy a Uno to try, a nano was what came with the machine.
I will try to look up exactly what the d11 pin can output EDIT: Seems like it can do the same frequencies as the normal Arduino. I mean if this doesn't work. All I need is for the d11 pin to be able to turn a relay on that could send 10V directly to the VI on the VFD to make it turn on and off
EDIT AGAIN: I thought maybe there was too many amps being drawn from the arduino from the stepper controls or even the relay, I unplugged everything and tried to run only the PWN to voltage board. Which worked, until I also plugged in the VFD causing an alarm 1 in grbl and the arduino quit working like before. The VFD works just fine when supplied a 5V or 10V (Half or full speed) power on those input lines.
You like using words but it confuses more than it helps to understand. Save the thinking for Your own work at home and present scientific facts and reports.
Without code it's more difficult to tell.
Measure all You can measure when the project is running well and then measure the same parameters when the fault occurs. Tell what has changed.
I will try to explain it better than my own phrasing. I am not very familiar with this and was trying to learn just enough to follow the tutorials I had linked. But I am unsure of what code to post from grbl, as it is several different files that are uploaded.
My testing goes as followed:
PWN to voltage control board is wired up as followed, except the VOUT cable is left unplugged.
Turn CNC machine on, stepper motors, control boards, Arduino and VFD. On light shows for Arduino, RX light flashes throughtout it being on. The arduino is able to control the machine as it should, able to home, jog, etc.
No voltage shown for PWN (D11) or VOUT pins on the control board
VFD will run at 12000RPM with 5V or 24000RPM with 10V supplied to the VI and ACM (Ground), not using control board for this, use a power supply
Using GRBL to control the Arduino I set the spindle speed for 50% (M3 12000 in grbl), 4.3V shown on PWN and 5V on VOUT. This is working correctly
When the VOUT is plugged in, the RX light on the Arduino quits flashing, but On light stays on. The spindle will turn for a quarter of a second. After that, no power on the PWN or VOUT. GRBL also sents an Alarm 1 putting the machine into a locked state, can no longer move, home or control the stepper drives either.
This is indirectly related, If the A3 pin (Coolant enable) is turned on (M8 function in grbl) the same error takes place, no voltage is found on the pins and RX light stops blinking.
I do not know what else to measure for as it simply seems to power off all output from the ardiuno until it is reset in GRBL.
" VOUT cable is left unplugged." That cuts out the VFD and the motor. No disturbance, no noise from those units. Good.
The last sentence quoted... Does that happen in a straight sequence with the above procedure?
I will put a coin on a communication issue between the PC and the Arduino.
I've successfully been running a Grbl sender and an Arduino without diving into any parameter setting.
I ask You if You can find any communication parameters to investigate.
Yes that last sentence happens in a straight sequence from what I can see.
I tried a new USB cable routed away from any other wiring. It did something interesting, while I had the same issue with the ardiuno shutting down when trying to run a spindle with the VOUT plugged in. The coolant enable (A3 pin) and it's relayed worked fine with VOUT plugged in.
I did find some comments on amazon saying that PWM to voltage control board might have a common ground for all three grounds, if this is true, what could be done to test this?
I think You can disconnect the PWM to voltage circuit completely and using a DMM in resistance mode to check i up.
Right now I can't tell what this eventual GND connection could do or not. It's very late here and the bed is the best place.....
I am thinking of just removing the PWM to voltage circuit board. I don't think I have the background knowledge to understand my problem here. Thank you so much for trying to help.
I will simply turn the VFD speed on manually so I can use my machine for once, unless someone comes up with a better idea than me.
Control the speed from 0 to 24000rpm. I don't think there will be any application that I need to set it anything other than full speed, but I was trying to just in case. If I could simply control the spindle on/off with the Arduino and GRBL, that's be perfect
You are right that a potentiometer would work, if that was the case I'd use the one built onto the VFD already. The main goal I should say is for the spindle to be able to turn on and off through GRBL. When I had said 0 to 24000, I meant doing it in a way that the arduino could do it by itself through GRBL.
From my understanding of the VFD's open pins, turning the spindle on/off and controlling the speed were combined to the VI/AI inputs. I can give up controlling the speed and I think a relay controlling 10V from the VFD to the VI pin would solve my issue of the PWN to voltage control board causing such weird issues.