Mecanum Wheel Robot...
 
Notifications
Clear all

Mecanum Wheel Robot Issues

58 Posts
7 Users
11 Likes
2,301 Views
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6662
 

@codecage @jrrobb Indeed, there can sometimes be a delay in notifying you that an update beit boards or libraries are pending. I bet it's possible to start a compile while an update is underway that could explain the original error.

I have a sketch called dummy that has no code in it other than an empty setup and loop. I leave the IDE and that sketch open on a permanent basis, that way, in the background, my IDE keeps up to date (that is MY theory, I do not know if it is the best, or even works) IF I have an error that makes no sense, then I first check for board and library updates. I then check the compiler warning levels. I normally run at ALL, but I have found several libraries with unfixed warnings which necessitates me to run at default.

Screenshot 2023 05 09 at 04.22.01
Screenshot 2023 05 09 at 04.22.16

 

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@jrrobb)
Member
Joined: 12 months ago
Posts: 10
 

@codecage 

Hi, I have had a couple of upgrades to boards and libraries but still get the same results. However I took your advice and changed all "analogWrite" to "ledcWrite" and this now compiles and uploads but I now get only some wheels moving , also when I disconnect the cable from the computer to the ESP32 the motors stopped. I then found that there was no 3.3v from the TB6612FNG. I have been trying for hours to find the reason but gave up and bought two more TB6612FNG drivers and found they gave the same result . I am now giving up on this project having tried five ESP32 and four TB6612FNG.

However I would still like to get my macanum wheels working and I have got a couple of spare 

L298N drivers I used on my Raspberry Pi robots so can anyone give me a wiring diagram and code so I can replace these TB6612FNG drivers.

Another thought, can the Windows 11 o/s I now have be causing all these problems, I would go back to Windows 10 but I understand this is to be discontinued soon.  

Regards,  Jim

This post was modified 11 months ago by jrrobb

   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1018
Topic starter  

@jrrobb 

Jim,

I'm actually planning on getting back to this project this weekend, maybe even a bit today.  My vision is vastly improved and ready for a workout.  Stick with me and I think together we can figured this out.

As far as not having 3.3V from the TB6612FNG when disconnecting the USB cable from the computer, that makes perfect sense to me.  The 3.3v supply is "TO" the TB6612FNG "FROM" the ESP32 and goes away if the 5v supply is removed from the ESP32 by removing the USB cable.

Have you implemented the power supply like the one shown at the 42:18 or so mark in Bill's video?  That 5v supply is what powers the ESP32 and and provides the 3.3v from the ESP32 to the TB6612FNG.

Your post above was your 9th post, so after one more post you will be able to do PMs (Private Messages), which might make it easier to handle back and forth traffic between us until we can begin making enough progress that it benefits the entire group.

And by the way, I believe the TB6612FNG is a better fit for this project than the LM298N.

Also Windows 11 is not the culprit as I have Win 10, Win 11, and Linux at my disposal and plan on making sure I can use any one of these O/S versions to make this project work.

Please stay in touch! 

 

SteveG


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1018
Topic starter  

@jrrobb

Jim,

I just wired up one channel of one TB6612FNG, the right front, according to Bill's diagram, and using the attached "4wd-test2.ino" file was able to run a test of the code.

This code originated from Bill's code but modified to use the "ledcWrite()" method instead of the "analogWrite()" method.  Right now it only works for the "right front" wheel and I have yet to add the code for the other three wheels and to actually wire the TB6612FNGs for those wheels.  I also have no separate 5v supply and am just using the USB cable to power the ESP32.  I do have a separate bench top supply for my motor power supply.

There are "Serial.println()" statements to make it easier to see what it is supposed to be doing.  Obviously you'll see this when you look at the code.  As soon as I can get my remaining three motors wired, the remaining motor drivers wired, and the code updated for all four wheels I'll send you an update as to my progress and if it's working a newer version of the "4wd-test2.ino" file.  Notice I had to "ZIP" the file as the forum software doesn't allow just the "ino" filetype.  Guess I could have imbedded the code, but found this method much easier.

 

These may seem like small steps, but I usually find this approach much simpler to handle if there are issues to be addressed.  Good luck!

SteveG


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6662
 

@jrrobb If analogueWrite isn't being found, then your IDE installation is damaged. I did what you did and it compiles fine.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1018
Topic starter  

@zander 

I believe there was an interim update to boards and/or libraries that broke analogWrite.  Mine was originally working, then when I went to look at the @jrrobb issue it wasn't, but now after a recent update of boards and libraries it is once again working fine.

SteveG


   
ReplyQuote
(@jrrobb)
Member
Joined: 12 months ago
Posts: 10
 

@codecage Hi SteveG,

Many thanks for your email and advice. I am new to Android and Arduino, up to recently I used Raspberry Pi projects. I have built eight robots from basic to autonomous using different controllers with cameras, line following and object sensors and basically had no problems that I couldn't solve by myself. Also the codes are easy for a dummy like me to understand, I find the Arduino quite different. By the way when I downloaded the code you gave I got the message that it had to be inserted into a folder named " 4wd-test2.ino" which I am unable to do.

When I started this project Bill should have given a big red warning about using TB6612FNG drivers. I found I could only source these with connecting pins requiring to be soldered. This is fine with a well equipped workshop. I soon found that each pin ( 8 to each side)had to be separately cleaned and the small PCB wiped clean. Then you have to support the pins in the board, I used a small piece of blue-tack stuck to the back of the board and jammed against the pins making sure the pins are at 90 deg. This then has to be fixed to a support, I have a small table-edge-vice . Then you need a small soldering iron with heat adjusted to just melt the solder, the iron and solder can only be applied for about 1 sec to avoid overheating the board. Each joint is only 1mm apart from the next. I have to use a head mounted magnifying glass. Each joint must then be tested to ensure the solder is good.  This has to be done with 32 pins. 

Not a job to be done by the faint hearted. Having done all this I still find problems even though I have mounted the TB6612FNG drivers and the ESP32 on pinch-screw connector strips to avoid using bread board connections. Then there is the problem with analogWrite, which has been solved using ledcWrite. Ron says the IDE must be corrupted but I have reinstalled it twice with no change in the results. Then the problem with no 3.3v from the TB6612FNG to the ESP32. I am having to use a phone power bank to supply the ESP32 when it disconnected from the computer. How does Bill get the 3.3v out of the TB6612FNG ? It seems there are too many problems with these drivers and I would like to change them with L298N drivers which I have used several times and they work.

Can anyone supply a wiring diagram for the L298N drivers?

regards,  Jim      


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1018
Topic starter  

@jrrobb, Jim

You are misunderstanding the 3.3v supply for the TB6612FNG.  It is not supplied from the motor driver board but to the motor driver board from the ESP32 itself.  In the diagram of Bill's wiring, see below, notice the top left pin of the ESP32 is labeled 3V3.  This is an output voltage that goes away when you unplug the USB cable from the computer.  Without the USB cable, the 5V would be supplied to the lower left pin in that same wiring diagram that is labeled 5V.  That input would come from the battery supply that I mention was shown at the 42:18 minute mark of Bill's video.  That has to be used if the USB cable is disconnected.

And yes you will need to just create a new folder name "4wd-test2", without the .ino extension in your sketch folder, then put the unzipped file I sent in that folder.  I apologize for not mentioning that before.  But it is almost impossible to completely understand someone else's level of understanding of all the intricacies needed to play around in this hobby.  Take for instance your comment about Bill should have warned about using the TB6612FNG.  I don't believe a warning was warranted, and I'm convinced this is a much better solution than the L298N drivers.  He had no idea that you might need to solder the pin headers to your boards.  Besides in one of his earlier videos he shows a method he uses to accomplish this task quite easily, and I now use it myself. And soldering components is a task needed quite often in this hobby.  I suggest you get a small soldering iron similar to the one in this link: Soldering Iron from Amazon US I'm not recommending this particular item, merely giving a example.  It just happens to be the first one that popped up when I went to Amazon and searched on soldering irons.  I've been soldering since the early 60's so it has become second nature to me and I forget how daunting it could be to someone new to soldering.

I'm no longer having an issue with analogWrite after my last boards/libraries update.  It originally worked for me, then when I first looked into your issue it gave the same error as you mentioned.  I believe there had to be some interim update of boards and/or drivers that broke analogWrite that has now been corrected, but you have as of yet gotten the latest updates.  I take it as a non-issue for the moment, just be aware of it as it pertains to the ESP32.

Here is a snapshot of Bill's wiring diagram:

MecnumMotorWiring

SteveG


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6662
 

@codecage That sounds pluasible and is a good suggestion to always do a board and library update check as the first step in troubleshooting. In case anyone seaches on troubleshooting or first steps I will include the screen pics of what a update check looks like.

 

Screenshot 2023 05 09 at 04.22.16
Screenshot 2023 05 09 at 04.22.01

#troubleshooting #first steps

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1018
Topic starter  

SteveG


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1018
Topic starter  

Interesting...  Why does a section of my code show up in red in the above post?

SteveG


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1608
 

Hi Steve @codecage,

Re: Why does a section of my code show up in red in the above post?

I could be completely wrong (again 🤨 ), but my first suspicion would be it is treating the asterisks as Markdown codes. Note, the affected text is not only red, but also 'bold'.

See https://www.markdownguide.org/basic-syntax/

which says:

image

----------

Good to see you are able to get back to your project!

Best wishes, Dave


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1018
Topic starter  

@davee 

Thanks for that!  Maybe that's it.

Don't really need those asterisks, I was just providing a "border" between each wheel in the code.

If anyone wants to see this monstrosity in action, here is a link to a YouTube video I posted.

Mecanum Wheel Testing

Enjoy my dilemma.

SteveG


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1608
 

Hi Steve @codecage,

  Regarding your real problem ... nothing obvious, though I am pretty hopeless at visually spotting code errors, but I think the offending section of code is the first time MR_BI2 is set HIGH.

Why that should be a problem, I have no idea, but it might be worth checking to see if there is some correlation between event and problem.

Maybe, change MR_BI2 to some other pin in both software and hardware, (so that the existing pin stays LOW) and see if it makes a difference?

Good luck, Dave


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1018
Topic starter  

@davee 

Yeah the act of changing BI1 and BI2 from HIGH and LOW to LOW and HIGH respectively is what reverses motor rotation direction.  What "talks" to the "pin" is the method "ledcWrite()".  It uses the parameter "mtrLRpwmchannel" to set the channel or pin, along with the speed parmeter, and the previous "Stop Motor" used the same parameter with a speed of 0, and BI1 and BI2 set to 0 to stop the motor.

You are correct though in that is the portion of code being executed when the Blue LED lights up.

Puzzled in Georgia, CodeCage

SteveG


   
ReplyQuote
Page 2 / 4