servo component, with ESC motor controller?

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

servo component, with ESC motor controller?

Post by hyperion007 »

I read an old post on the V4 forum where BenJ said that you can use the servo component together with an ESC to control the speed of a BLDC (Brushless DC) motor.

Now I tried just that yesterday with the standard values of the servo component but I didn't get it to work. Even tried it with a small servo that I have used successfully with a V5 program a while back, and it didn't work either.

So, I'm wondering if anyone could share a small program for controlling the output (speed) to the ESC...

I also read on the Matrix Blog about BenJ's quadcopter and had a look at the code he posted but I could not see anything about speed control output to the ESC's but I might have missed something maybe?


Thanks for any help with this :)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: servo component, with ESC motor controller?

Post by Benj »

Hello,

In the quad article I was cheating a bit and using the signal from a transmitter receiver pair designed to control ESC's. The next step was to control the motors directly which I have done before. However the chassis was not up to the job so it's waiting for me to get interested again and redesign the chassis maybe with lighter motors and ESC's.

Now ESC's sometimes work with standard servo signals (50Hz) or sometimes require a much faster signal (400Hz). The Servo component in v6 should allow you to make this modification but lets keep things simple for now and try and get 50Hz working.

With my ESC's they worked with both 50Hz and 400Hz servo signals but 50Hz was a bit less stable. My ESCs were only cheap things from China so I think they are pretty standard.

To get the motors to work you have to do something called arming to get them to start. I did this by enabling the servo with a duty of around 10 and this should either startup the motor or if there is a problem the motor might beep. If the motor starts up ok then you can ramp up the speed and control the motor as usual. If the motor beeps then I had a piece of paper with my ESCs describing what the beeps meant.

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: servo component, with ESC motor controller?

Post by hyperion007 »

Ok, the motor does beep two or three times at power on. Which macro do you use to set the duty to "around 10" ?
I too have very cheap China ESC's. I am actually trying to get an HDD motor running.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: servo component, with ESC motor controller?

Post by Benj »

Hello,

Something like this should work.

Code: Select all

Servo Initialise

Servo SetPosition (0, 10)

Servo EnableServo (0)
Wait here until motor starts to spin, then we can increase the speed...

Code: Select all

Servo SetPosition (0, 40)
If the motor doesn't start spinning then try modifying the startup value from 10.

If this doesn't work then try setting the position to 0, enable the motor, wait a couple of seconds and then set the servo position to 10.

Code: Select all

Servo Initialise

Servo SetPosition (0, 0)

Servo EnableServo (0)

Delay Seconds (5)

Servo SetPosition (0, 10)
I can't remember if the servo needs to be enabled in the 0 position for a while before starting to ramp up the speed. Thinking about it this makes sense as I think there is a safety check that the control signal is at 0 before then doing anything else.

Hopefully one of these combinations will allow your ESC to work.

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: servo component, with ESC motor controller?

Post by hyperion007 »

Thanks! I'll try that when I get home and post the result.

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: servo component, with ESC motor controller?

Post by hyperion007 »

Well I can't seem to get this to work. Don't understand what the problem might be.

The ESC I am using is this: http://www.ebay.com/itm/141074839195?ss ... 1439.l2649

And the motor I'm using is a 4 wire one, known as a "wye" motor. The center connection point is not plugged into anything in my setup as that is what I've seen people do online.

Here's a picture of Delta and wye coil configuration: Image

As I wrote the above text, I thought "hmm maybe I should try to connect the middle point to GND on the motor. seems to work much better :) at least something is happening. Will test more and report back :)

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: servo component, with ESC motor controller?

Post by hyperion007 »

Still no go, it jerks the motor a bit, every so often (once per second or two) That's all it does.

Post Reply