Hello all, I am in process of building a cnc router and could use

Unfortunately this is not the manual for my drive @donkjr :disappointed_relieved: it looks slightly more comprehensive than the garbage I received with mine. I’ll see if I can find a .pdf of the manual for my drive if you’ve got the heart to look at it. I’ve read the manual from cover to cover several times but I can’t find any info in there to help with this problem. On the plus side of there’s ever a job going for a Chinglish translator I’ll be a shoe in!

I can find a setting for analog gain but unfortunately it’s for the analog output, there seem to be many settings on these drives that might actually be useful for tuning but they don’t seem to be present on this model. Or, if they are, they’re hidden behind badly translated Chinese!

Here’s the ā€œcatalogueā€ lol :

https://www.google.co.uk/url?sa=t&source=web&rct=j&url=http://www.frequency-converter-china.com/uploads/soft/170823/1_2143083921.pdf&ved=2ahUKEwjBxf-ixJzaAhUIe8AKHYFhB0sQFjAAegQIABAB&usg=AOvVaw2IsATgQbNYw3oFkGWET_jn
https://www.google.co.uk/url?sa=t&source=web&rct=j&url=http://www.frequency-converter-china.com/uploads/soft/170823/1_2143083921.pdf&ved=2ahUKEwjBxf-ixJzaAhUIe8AKHYFhB0sQFjAAegQIABAB&usg=AOvVaw2IsATgQbNYw3oFkGWET_jn

AI1 is the only input of any kind on my drive, it’s obviously serving double duty, hence the jumpers to switch modes. Jp1 on mine is an all or nothing thing, removing it must just bypass external control all together. Jp2 and 3 seem to take care of the functions, unpopulated jumpers is 0-5v. Setting both to bridge 2 and 3 should be 0-10 and both to 1 and 2 should be 0-20mA. I’m just not sure what the designation of the pins is. No markings! Logic would dictate that they’re set at 0-10v atm. Since the pot worked when I delivered the 10v from the analog output on the drive.

@cprezzi It looks like you may have been on to something with the PWM period suggestion. I just changed the value which was set a 1000 (I’m presuming they’re milliseconds) down to 500 since 1000 would give me a frequency of 1000Hz and that’s on the threshold of being out of range. If I’m getting this, 500ms gives me 2kHz slap bang in the middle of the range.

Testing now and the range of the fluctuations has halved (I see a pattern here). I’m betting the lowest period my DAC can interpret will give the best signal It’s still unusable as is but I feel I’m getting closer to the solution here. Going to try 340 and see what impact that has. It’s looking like I may need a better converter.

At 340 fluctuation is down to about 4Hz so about 1%. Much better than the 25% I started out with. A fluctuation of 240RPM, would this be tolerable? Guess it will have more impact at lower speeds.

So this looks like the converter doesn’t produce a very stable output. You could try to connect a electrolyth capacitor between the pins (gnd/signal) to equalize the signal some more. Something like 2200uF (>15V) should be ok.

You should also check the PID parameters of the VFD. They determine the behaviour of the regulation loop.

Thanks @cprezzi I’ll look into these suggestions. Would the capacitor be inserted at the DAC output terminals or the inverter input terminals?

I don’t think the PID parameters will be relevant as I’m conducting my tests without a load (i.e. the motor) attached to the vfd output. So there’s no feedback for the VFD to make adjustments for. I could be wrong here, I understand the purpose of PID loops but the mechanisms are a bit over my head.

Another thing I noticed last night, the converter I have is the magideal one @donkjr mentioned above. It’s only supposed to accept PWM inputs of 5 or 24V and smoothie’s logic is 3.3V. Could this be part of my problem? I’d assume if it was I just wouldn’t be getting an output from the converter full stop. Although if the gate isn’t being triggered by every pulse due to being on the threshold and slight fluctuations in voltage, it stands to reason that the output wouldn’t be stable. Unfortunately I’ve no logic shifters to test this theory and it’ll be the end of the week before I can get my hands on one. I might be able to build one from parts I already have, but I’d rather not waste my time figuring that out if I’m off the mark here. Thoughts?

I’ll go and see if I can dig out a suitable cap and give that a try for now. Thanks once again for all your suggestions.

@Steven_Kirby
…as I’m conducting my tests without a load (i.e. the motor) attached to the vfd output…

…you do not have a motor connected? If not how are you measuring the RPM?

I don’t think testing this without an inductive load can be trusted. The parameters that the VFD comes with are likely setup to handle the characteristics of a motor and its inductance which is part of the feedback path.

BTW: You can use a open drain mosfet configuration with a pull-up to 5v to get the right voltage for the converter input. You do not need a level shifter.

@donkjr I’m not measuring the RPM, that’s how. :yum:

From what I gather this is an open loop system anyway, if it was closed loop the vfd wouldn’t run, at least not for very long, without feedback from the motor.

When I initially experienced the frequency fluctuations (you can clearly see these from the vfd display no need to measure anything) I connected the motor, following your above logic, to see if the problem was due to the absence of a load. Unfortunately it changed nothing. The sound from the motor was akin to that of a car on a learner driver’s first lesson. You could audibly hear the RPM fluctuate massively, I’m betting with the ~1% fluctuation I have now it wouldn’t be audible at all, but it will probably manifest as reduced cutting quality I’d guess. Also, if I run the vfd with no load but from the manual controls the frequency remains stable, so I think my problem lies elsewhere.

I have some mosfets resistors and diodes kicking about that I should be able to use to make the voltage conversion. I know from my research that there’s a number of circuits that will do the job, wouldn’t know which one to pick though. Question is will it help? I’m barely even competent with electronics so it’ll be taxing for me to figure out. I’m hoping the capacitor will be the solution but I don’t have the right value here so it’ll be a trip to the shop for that. If you’ve a suggestion on suitable mosfet and resistor values (and possibly an easy to follow diagram for an electronics n00b on how to build the thing) it would be greatfully received.

@Steven_Kirby below is a diagram that includes the Magdeal converter and smoothie.

The converters input is an opto-coupler so connecting to it is easy and you do not need any more parts if you hook it up like below.

You will need to use an open drain mosfet on your controller that is PWM capable.

It may solve your problem especially if you are driving it with 3V logic on the D+ line. However, I think something else is amiss. All you can do when docs are this bad is keep trying stuff :)!

Using 3V PWM will probably work but not be very reliable. The K817 must be driven to saturation to work properly and 3V logic probably is marginal.

…
I thought these VFD’s were closed loop but I have never cracked one open so I’m not sure. I am pretty confident that the VFD parameters need to be tuned to the motor, that is why folks have a challenge getting it right.

BTW how are you generating the PWM?
missing/deleted image from Google+

Ok, you may be on to something here…

The pwm is coming from one of the header pin breakouts on the motion controller, not the mosfets that you would ordinarily use to drive the heaters and fans on a 3d printer, one that might be used to communicate with an LCD panel.

I have the jumper on the magideal converter set to 5v as I was under the assumption that this was to be set for the voltage of the pwm, not the voltage of the supply. If I’m understanding your diagram correctly it’s for the supply voltage? The reason I arrived at this conclusion is because the info on the eBay listing says the input power to drive the converter should be between 12 and 30 volts, so logic would dictate that the jumper is for the pwm voltage.

So my suspicions could be correct about the 3v pwm just not being ā€œloudā€ enough for the converter to ā€œhearā€ properly would using the mosfet outs on smoothie and changing the config to suit solve this? I assumed they would also just output 3.3v in this config.

I think the even basic configuration of frequency curve parameters and motor ratings for these spindles and VFDs are enough of a challenge with the provided docs. Took me a couple of days just to get the motor running. Many people have burned up their motors form not adjusting the minimum frequencies set on the drive at the factory, which is too low for the air cooled motors.

So you think if I set the jumper to the 12-24v config on the DAC and use a mosfet output on smoothie this could work?

@Steven_Kirby
I am guessing that on the Magdeal you connected the 3V PWM signal from the controller to the D+ and the D- signal to ground …Yes? This will work… just not work reliably.

In the drawing think of the D+ as the supply voltage for the LED in the opto-coupler. The Mosfet acts like a switch that grounds the LED in the opto-coupler turning it on. Of course the LED is switching on/off at the PWM rate.

Without reading back through the posts did I recall that you measured the output of the Magdeal and saw a stable DC value??? If so its doubtful that the converter is at fault?

If you have a stable DC voltage between 0-10 going into the VFD you should have a stable frequency & drive at a specific speed and its not likely the fault of the converter.

Then again noisy signals can make all this difficult to troubleshoot!

I assume you do not have an oscilloscope?

…

If it were me I would redo tests of each subsystem standalone with known stable inputs.

1). To test the converter: you should be able to put a known and constant PWM (like 50%) into the converter and get a stable voltage out (@50% = 5V). Test unconnected to the VFD.

2.) To test the VFD: connect a known voltage on the analog pin of the VFD referenced to ground. Use a battery. Not connected to the converter. Connect the motor.

Hey @donkjr , thanks for your reply. Unfortunately my internetz went down this afternoon and It’s only just come back online. The shops will now be closed so trying to deal with my noise issues (if that’s what they are) will have to wait 'til tomorrow.

I have tested the converter, as you suspected, I did mention that in an earlier post. I’m fairly confident the pwm from the smoothie is working properly. To calibrate the converter I used an M3 S12000 command from pronterface which, given my settings for motor speed in smoothie’s config, should be giving me a 50% pwm. Sensibly, with a multi-meter on the converter output at this pwm % I get ~5.4v out from the converter. similarly at M3 S24000, the top speed of my motor, I get ~10v. All working as expected. Maybe what we’re not seeing, due to the meter not being able to keep up, is that the voltage is actually fluctuating very rapidly but on the display we just see the expected 5 or 10 volts. To the more sensitive voltage detection circuitry on the VFD this manifests as the oscillations in frequency I’m seeing.

You are also correct about my lack of scope. Pricey! I’ll put one on my to buy list once I’ve recovered from buying expensive lathes, routers and associated paraphernalia.

I also did a test with the pot I found taking 10v from the inverter and feeding it back through the pot to VI1 on the inverter, the set voltage via the pot produced stable frequency, so I don’t think the trouble is at the inverter end in the interpretation of the analog signal.

I’m also not 100% convinced it’s noise. Since I don’t have my spindle connected during the tests plus the cabling is shielded, it cant be rf from the spindle cable running near the wires from the converter causing issue. I can’t imagine what else would be generating noise, any clues?

Humour me here because this theory is based on a very limited understanding of electirckery. What I suspect the problem is, is the logic signal from the smoothie not being high enough:

As you state the pwm voltage triggers the optocoupler by switching an led on and off rapidly it must reach given brightness to be sensed as a pulse by the converter. the circuit is designed for 5v input, like you say 3.3v is probably just enough to illuminate the led but even a minor fluctuation in the voltage received from the smoothie might cause the brightness to occasionally drop below the required threshold to trigger the optocoupler, these ā€œlost pulsesā€ essentially result in a dip in the frequency on the output resulting in the observed frequency oscillations.

I think this theory is backed up by my experimentation with the pwm period. by shortening the period and thus increasing the frequency, the train of pulses received by the converter is a much higher ā€œresolutionā€ so the dropped pulses have less impact on the frequency output.

So, my idea for the fix thanks to your wonderful pendoodles is as follows:

  1. I set up the DAC for 12-24v with the jumper

  2. I provide 24v to the DIN+ on the DAC from my 24V psu and connect DIN- to the pwm capable mosfet on the smoothieboard.

  3. Set the PWM capable mosfet to open drain in the config with a lower case o.

  4. set the PWM capable mosfet as the frequency source for spindle speed control in the spindle module config.

  5. Conduct a test with the vfd to see if it works, being sure to cross fingers that the magic smoke stays inside everything.

  6. Rejoice at the success of the test and finding the solution to my unstable frequency problems.

My theory with all this in case you hadn’t already guessed is, even with slight voltage fluctuations at 24v, the voltage will never dip below what is required to trigger the optocoupler on the DAC, resulting in a more stable analog output. Seems logical enough, right?

Just need to confirm that I’ve interpreted your diagram correctly and this is a legit way of wiring things, does that seem right to you?

Just to make this message even longer because I’m sure you love reading all my waffle! :stuck_out_tongue: I just checked out your video of the ox cutting out your tape holders, cool invention! Gotta keep that tape organised! I’ve also built an openbuilds design, the workbee which is a variation on the ox designed by Ryan Lock who runs a 3D printing firm here in the UK called Oozenest. I wanted leadscrews on all axes and this design had it. Can’t wait to get cutting. I’m also just getting my head around Fusion too. Like you say, steep learning curve but once it starts to click it’s so powerful and quick to reiterate designs and refine things. I’m loving it! If you’re interested there’s some good tutorials at Udemy for fusion made by autodesk themselves and they’re free, check them out if you didn’t already find them.

Right, I’ll shut up now but let me know what you think of the plan and if it’s all safe for my hardware.

Cheers,

Steve

@Steven_Kirby
when you use an external Mosfet you do not need to do #3. The programmable open drain pertains to the processor chip not devices connected to it such as the mosfet. The port also should not be inverted.
Note: you are wiring from a screw terminal on the edge of the smoothie not connectors internal to the board. This confuses most people.

Post a picture of your mosfet connection so it can be checked.
Also post the config file when you are ready.

…the voltage will never dip below what is required to trigger the optocoupler on the DAC, resulting in a more stable analog output. Seems logical enough, right?
The current in the diode and its subsequent amount of light biases the transistor receiver in the coupler. These devices are analog and nonlinear so they do not trigger. They should be designed to operate on a linear part of their transfer function. If you operate without enough current in the diode they may end up operating in a nonlinear zone and its possible that can change the pulse width of the resulting PWM output. We will see…

Ok, @donkjr Yep I know where the mosfets are so no problem with the connections at least.

Thanks for the physics lesson though. So it’s the current not the voltage that’s responsible for the brightness of the diode and it’s intensity based not pulse based. So hopefully this will put us in the linear zone of the receiving transistor. Hopefully!

I’ve taken 24v to the DIN+ on the DAC and sent the DIN- from the DAC to the -ve terminal of the heated bed mosfet and configured it’s respective pin 2.5 to be the pwm generator. The only thing I’m not sure of is the frequency setting as I recall reading smoothie’s mosfets can only handle frequencies up to a certain threshold. PWM period is currently set to 340 so almost 3kHz will this be ok? Here’s a hastily scrawled pen diagram of the result. not mentioned on the diagram but the jumper on the DAC is now set to 24V.
missing/deleted image from Google+

Oh yeah and here’s the config, well the bit that counts at least:

##Spindle Module

spindle.enable true
spindle.type analog
spindle.max_rpm 24000
spindle.pwm_pin 2.5
spindle.pwm_period 340
spindle.switch_on_pin 1.22!

@Steven_Kirby
-So it’s the current not the voltage that’s responsible for the brightness of the diode and it’s intensity based not pulse based._
…Both determine the current through the led (I=E/R). The voltage on the led has to reach a ā€œforward voltageā€ to start conduction.The remainder of the supply voltage is dropped across the series resistor. The series resistor limits the LED’s current to a level suitable for the application and not to exceed the max rating.

The diagram looks correct…

The smoothies Mosfets can handle these PWM frequencies.

However the Magdeal’s range is ā€œ1 KHZ - 3 KHZā€, so stay under 3K hz.

:disappointed_relieved: Alas, @donkjr this was not the solution I’d hoped for. The frequency undulations persist.

But hey, on the bright side it’s another avenue explored, another question mark removed and another step closer to the right solution. :grinning:

Oh, and I learned a couple of things so cheers for that. :+1:

One thing I did notice and maybe you can explain when I measure the voltage at the inputs on the DAC I’m getting ~13V there’s definitely 24V coming out of the PSU so what’s the deal there?

So really, the only things I have left to try are:

A capacitor (This would go at the output of the DAC or the input of the VFD?)

Shielding the signal cables between the DAC and VFD

Moving those jumpers. The Diagram is indecipherable some things suggest it’s in 0-10v mode but I’m not sure, so the best way to find out is to try moving it and see what happens. Only problem is, could it be a risk to provide greater than 20mA to that circuit,if it does turn out that I’m switching it to the 0-20mA mode?

I’ll eliminate the first two but if they don’t fix it I’m out of ideas, aside from buying a different converter.