RC ESC Brushless Motor/Spindle Question

More
13 Feb 2016 20:44 #70085 by Dean
Hello:
I'm trying to get Linuxcnc to control the brushless motor on my spindle. I'll be using an rc esc to drive the motor and it requires a somewhat unique PWM signal to operate. Most rc servos are driven with a pulse that ranges from 1.0ms to 2.0ms with a 1.5ms pulse length that is neutral or the midpoint of the servo travel. But the throttle control for brushless motors is a little different. The ranges of pulses are the same, but they represent a different control strategy for the motors. A 1.0ms pulse gives a 100% speed on the motor, while a 1.5ms pulse is 0% speed (neutral) and a 2.0ms pulse is 100% speed reverse.

So, the full motor (forward) speed control is a range of pulses from 1.5ms (0 RPM) to 1.0ms (24,000 RPM) running at 100hz. I tinkered with Kirk Wallace's RC Servo Test in the Wiki and have the pulse generation worked out. But here's where I'm stuck: I somehow need to invert the signal so that when the spindle speed increases, the pulse length decreases. Right now it's just the opposite. Here's my connection:

net spindle-speed-cmd motion.spindle-speed-out => pwmgen.0.value
net spindle-pwm pwmgen.0.pwm => parport.1.pin-16-out

I think I need to somehow invert pwmgen.0.value. It's probably something simple, but I'm in over my head as usual.

Any ideas?

Thanks,
Dean

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

More
13 Feb 2016 23:52 #70088 by cmorley
set the pwmgen.o.scale negative?

Chris M
The following user(s) said Thank You: Dean

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

More
14 Feb 2016 00:26 #70091 by Dean
I tried that Chris....didn't seem to make any difference.

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

More
14 Feb 2016 07:24 #70098 by perra_e
If you swap two vires from esc to motor it will run in the other direction and you dont have to change anything in the hal file.

--Per

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

More
14 Feb 2016 08:26 #70099 by Dean
Hi Per:
No, that's not the problem. the motor spins in the correct direction. The problem is that when Linuxcnc tells the spindle to increase speed it slows down and when it's commanded to slow down it speeds up.

Dean

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

More
14 Feb 2016 09:34 #70100 by perra_e
Ok, that was tricky.

Does it run in both directions with the same behavior?

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

More
14 Feb 2016 14:24 - 14 Feb 2016 14:26 #70108 by Dean

set the pwmgen.o.scale negative?


Chris:
I went back out and played some more this morning and found that making pwmgen.o.scale negative does invert the spindle output :blush:
Yesterday I had set the scale to 24000 to match the max RPM of the spindle and set that negative. When I did that the PWM didn't change as commanded. When I went out this morning, I changed the scale back to 1000 (as it was in Kirk's demo) and made it negative and the PWM changed as desired. I guess I don't understand the how the scale parameter really works.

Thanks Chris for the help.
Dean
Last edit: 14 Feb 2016 14:26 by Dean. Reason: typo

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

More
10 Jan 2024 17:13 #290384 by OBEY
Hi, I use it too bldc motor, could you please share the spindle configuration?

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

Time to create page: 0.075 seconds
Powered by Kunena Forum