Notifications
Clear all

Reversing Brushless DC Motors - PWM

29 Posts
4 Users
4 Likes
272 Views
SpikeMJV
(@spikemjv)
Active Member
Joined: 3 months ago
Posts: 13
Topic starter  

I am currently working on a project to build a robotic controlled lawnmower, but I am having difficulty getting the motor to rotate in  an anti-clockwise direction using PWM on the Arduino. The motor works fine going forwards and at various speeds. The Basic components  of  my project are:

  • WORX Landroid Chasis with wheels,
  • 3 phase BLDC sensor-less motors – (see pic)
  • Arduino UNO
  • A BLDC controller (see pic)
  • 20V Worx battery

My question what is the correct method of connecting the controller board to the Arduino to make the motor forward and backwards when suing the Arduino and PWM to control the motor?

 

image
image

The connections on the low voltage side of the controller are:

5V

Signal

Z/F

VR

GND

From the documentation that comes with the controller the Z/F  pin controls the direction of the motor but I‘ve had not luck with trying to connect to it. The controller does not have a hall sensor.

 

Any ideas of what I need to do, or, what I am doing wrong ? Has anyone done a similar robotic lawnmower project? Any code snippets, etc.

 

I have read some of the related post on the site (AngeloB), I have also seen project that use a ESC or, a controller with a hall sensor,  but not with a sensor-less controller.

 

 


   
Quote
robotBuilder
(@robotbuilder)
Noble Member
Joined: 3 years ago
Posts: 1572
 

@spikemjv

AngeloB reference for anyone interested.
https://forum.dronebotworkshop.com/new-content/brushless-dc-motors/

I have no experience with brushless motors myself and have none to play with.

I see online that they say swapping any two of the three wires will reverse the direction of the motor.
If that is the case you just need a circuit that can swap two wires electronically to reverse the motor.
I see examples of using the Arduino to control the speed of brushless motors.
There is this project?
https://hackaday.io/project/6717-project-landlord

 

 


   
ReplyQuote
SpikeMJV
(@spikemjv)
Active Member
Joined: 3 months ago
Posts: 13
Topic starter  

Thank you for responding to my message.

As I indicated in my original request, I have looked at the post provided by AngeloB and others, I have also seen a number of BLDC motors reverse rotation by using an ESC, hall sensor and I can reverse the motor by swapping wires also. I can also get the motor to switch direction by using a potentiometer. My problem is getting the motor change direction using the Arduino, PWM and the BLDC controller shown in the picture. 

I don't think I known enough electronics to build a circuit to achieve this electronically. However I will look at the links you have provided.

 

Thanks,  Spike


   
ReplyQuote
SpikeMJV
(@spikemjv)
Active Member
Joined: 3 months ago
Posts: 13
Topic starter  

Hi robotBuilder

thanks for the link provided below, but the project is about Reverse Engineering the Mainboard of the WORX Landroid to provide additional functionality to the robot. Not reversing  the BLDC motor, however thanks for providing the link.

 

regards

 

https://hackaday.io/project/6717-project-landlord


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3464
 

@spikemjv I think you need what is c alled an H bridge. See this https://en.wikipedia.org/wiki/H-bridg e" target="_blank" rel="noopener">link, also see Bill's videos here and here

"Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon


   
ReplyQuote
robotBuilder
(@robotbuilder)
Noble Member
Joined: 3 years ago
Posts: 1572
 

@spikemjv 

Use of an acronym is always risky assuming the reader know what it stands for.

Electronic Speed Controller (ESC)

Ok I have read a bit more about these motors.  Haven't had time to work it all out to give a definitive suggestion but this seems to explain them well.

https://howtomechatronics.com/how-it-works/how-brushless-motor-and-esc-work/

https://howtomechatronics.com/tutorials/arduino/arduino-brushless-motor-control-tutorial-esc-bldc/

https://www.integrasources.com/blog/bldc-motor-controller-design-principles/

 

This post was modified 3 months ago 3 times by robotBuilder

   
ReplyQuote
robotBuilder
(@robotbuilder)
Noble Member
Joined: 3 years ago
Posts: 1572
 

@spikemjv 

From the documentation that comes with the controller the Z/F pin controls the direction of the motor but I‘ve had not luck with trying to connect to it.

Then is should work just a matter of figuring out why it isn't working. How do you "connect to it"? Connect what to it? A switch?

Although I haven't been any help so far it has certainly been an education for me researching brushless motors 🙂  Would be easier to actually have the hardware to play with. It has put me off ever using such motors in a robot base.

This shows a circuit to control a sensorless brushless motor but doesn't seem to have a reverse mode,
https://simple-circuit.com/arduino-sensorless-bldc-motor-controller-esc/

Another hits involving an Arduino which also shows how to make a ESC very educational,
https://www.instructables.com/BLDC-Motor-Control-with-Arduino-salvaged-HD-motor/

Let us know how you progress.

 


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3464
 

@spikemjv H bridge

"Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon


   
ReplyQuote
robotBuilder
(@robotbuilder)
Noble Member
Joined: 3 years ago
Posts: 1572
 
Posted by: @zander

@spikemjv H bridge

Which are probably in the controller.  If the reverse pin is there then surely it should work?

https://www.digikey.com/en/articles/how-to-power-and-control-brushless-dc-motors

 

This post was modified 3 months ago 2 times by robotBuilder

   
ReplyQuote
SpikeMJV
(@spikemjv)
Active Member
Joined: 3 months ago
Posts: 13
Topic starter  

Hi robotBuilder, thanks for your responses and link, so far (apologies for the use of acronyms...still learning here). I have previously visited some of the sites you suggested and they provide very good explanations. However, I am currently not looking for solutions that use the Electronic Speed Controller (ESC), or Hbridge. I currently use an H bridge to control brushed DC motors. 

I am really looking for a solution that use the controller in my original post.

Thanks

 


   
ReplyQuote
SpikeMJV
(@spikemjv)
Active Member
Joined: 3 months ago
Posts: 13
Topic starter  

Re: How I am connecting to the Z/F pin. 

As I understand it , a Pulse Width Modulation (PWM)  signal from the Arduino can be used to send a LOW or HIGH pulse to the Z/F pin (to mimic an ON/OFF switch )..... so I connect the Z/F pin from the controller board to a PWM pin on the Arduino. I set this pin on the Arduino to 'OUTPUT' then do a digitalWrite to the pin (LOW or HIGH) to try and change the direction of the motor.

It works if I include a potentiometer in the circuit and flick the forward/reverse switch between running the program but I want everything to be controlled by the Arduino... without having to flick switches...


   
ReplyQuote
Will
 Will
(@will)
Famed Member
Joined: 1 year ago
Posts: 2140
 

@spikemjv 

Don't use a PWM signal to the Z/F pin, try using a regular pin and set it to 5V or GND.

Experience is what you get when you don't get what you want.


   
ReplyQuote
robotBuilder
(@robotbuilder)
Noble Member
Joined: 3 years ago
Posts: 1572
 

@spikemjv 

(apologies for the use of acronyms...still learning here)

That is just me others do it all the time I just always forget what they stand for 🙂

I am really looking for a solution that use the controller in my original post.

And it should work and from your post you say it sort of does.

It works if I include a potentiometer in the circuit and flick the forward/reverse switch between running the program but I want everything to be controlled by the Arduino... without having to flick switches...

From what you just wrote I assume one output of the Arduino is pwm to some pin on the controller?

And that there is a  Z/F pin on the controller to which you have attached a mechanical switch to change its direction? If so you need another Arduino output pin to that  Z/F pin as per wills post.

Or is there no Arduino just a pot and switch connected to the controller?

A circuit showing the connections would probably make it clear.

To enlarge image, right click image and choose Open link in new window.

connections

This link given earlier only shows an Arduino pwm connection to control speed determined by the pot setting but I assume you need another Arduino output pin to the direction pin on the controller as pointed out by @will ?

https://howtomechatronics.com/tutorials/arduino/arduino-brushless-motor-control-tutorial-esc-bldc/

 

This post was modified 3 months ago 3 times by robotBuilder

   
ReplyQuote
SpikeMJV
(@spikemjv)
Active Member
Joined: 3 months ago
Posts: 13
Topic starter  

I guess it is difficult to explain clearly without seeing the project in front of you...

 

I can already get the motor to spin anticlockwise using the following methods:

a)  by switching any 2 wires'

b) by using a pot on its own,

c) by using a combination of the pot and the Arduino 

 

what I can't seem to do is to get it to change rotation by using the Arduino and the brushless controller in my original post. 

The robotic lawnmower which I am trying to build must be autonomous .... no POT or switches.... just Arduino, PWM, the controller and the relevant Arduino Sketch.....

 

.


   
ReplyQuote
SpikeMJV
(@spikemjv)
Active Member
Joined: 3 months ago
Posts: 13
Topic starter  

@will , I think I have tried that but I'll another go...


   
ReplyQuote
Page 1 / 2