Mecanum Wheel Robot...
 
Notifications
Clear all

Mecanum Wheel Robot Car & ESP-NOW Remote

47 Posts
9 Users
7 Reactions
3,858 Views
(@andrewlaw)
Member
Joined: 2 years ago
Posts: 2
 

Hi Bill. Thanks for this project - I now have a very cute little car that the folk at work find hilarious.

That TTGO display is gorgeous - the resolution is simply stunning. I loaded another demo sketch onto it, and wow. I just might have to buy another. I'm using a pair of AA-size LiPo's on the car, and a single AA in the remote. They all claim to be 800mAh, and so far are going fine.

I had a hassle with the car program not wanting to compile, but after a good night's sleep, I cleaned out previous downloads of the sketches, reloaded and now it works perfectly. It also helps to have the appropriate board selected. Also, perceived problems with a non-responding controller were fixed by actually wiring up the joystick. Sigh.

Thanks again

Andrew


   
codecage reacted
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1040
 

I seem to have an issue getting my NEO_PIXEL LEDs to even light up.  I've included some test code based upon Bill's code for showing his LED test.  I'm using just one NEO_PIXEL LED.  If I can get one to light up then I'll move on to the string of five.

Here is my test code:

/*
  NeoPixel Test script
  2023/02/05
*/


//Include NeoPixel library
#include <Adafruit_NeoPixel.h>


// NeoPixel string output pin
#define NEOPIX_PORT 5


// Number of NeoPixels in string
#define NUMPIXELS 1


// Name each LED for easier reference
#define NEO_LED 0


//LED Color Definitions
#define LED_RED 255, 0, 0
#define LED_GREEN 0, 255, 0
#define LED_BLUE 0, 0, 255
#define LED_YELLOW 255, 255, 0


// Create "pixels" object representing NeoPixel string
Adafruit_NeoPixel pixels(NUMPIXELS, NEOPIX_PORT, NEO_RGB + NEO_KHZ800);



void setup() {


    // Set up Serial Monitor
  Serial.begin(9600);


    // Initialize NeoPixels
  pixels.begin();


}


void loop() {
 
  Serial.println("");
  Serial.println("Looping...");
  Serial.println("");


  // Turn NeoPixel RED
  pixels.clear();
  pixels.setPixelColor(NEO_LED, pixels.Color(LED_RED));
  pixels.show();
  Serial.println("LED should be RED");
  delay(2000);


  // Turn NeoPixel GREEN
  pixels.clear();
  pixels.setPixelColor(NEO_LED, pixels.Color(LED_GREEN));
  pixels.show();
  Serial.println("LED should be GREEN");
  delay(2000);


  // Turn NeoPixel BLUE
  pixels.clear();
  pixels.setPixelColor(NEO_LED, pixels.Color(LED_BLUE));
  pixels.show();
  Serial.println("LED should be BLUE");
  delay(2000);


  // Turn NeoPixel YELLOW
  pixels.clear();
  pixels.setPixelColor(NEO_LED, pixels.Color(LED_YELLOW));
  pixels.show();
  Serial.println("LED should be YELLOW");
  delay(2000);


}



It compiles with no errors, uploads, then runs with the serial monitor printing what color should be showing on the LED, but the LED has no color.  Have checked wiring and it appears to be wired as Bill's diagram shows, with the exception I'm using an Adafruit 4 Channel level converter instead of a 2 channel device as Bill has.  It seemed pretty straight forward wiring the 4 channel device as opposed to the 2 channel device, so I don't think that is my issue, but not 110% sure.  Any ideas greatly appreciated.

 

SteveG


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2552
 

@codecage 

Try using the literal values instead of the #define colours. For example ...

pixels.setPixelColor(i, pixels.Color(0, 150, 0));
 

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1040
 

@will 

I'll give that a shot.  Do you have any idea why the defines wouldn't work.  Maybe I'm not holding my mouth the same way Bill was!

SteveG


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2552
 

@codecage 

No idea why it wouldn't work. But I've used them before and always used the literals. So, one step at a time.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2552
 

@codecage 

I was just reading it in detail and you may want to set the brightness as well (just in case). In setup() add

pixels.setBrightness(128); // 128 out of 255

 

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1040
 

@will 

I'll give that a shot as well, thanks!  Will advise, but it may be tomorrow before I can get back to it.

SteveG


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2552
 

@codecage 

OK, then I'll shut up until tomorrow 🙂

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1040
 

@dronebot-workshop

Where did you mount the 330 ohm resistor driving the neo-pixel LEDS?  I didn't see it mounted on your perf board.

UPDATE:  After a closer look at the perf board from above before you actually start to explain the board, I finally spied the resistor between the ESP32 and the 5 neo-pixel connectors!

SteveG


   
ReplyQuote
(@tjblair1951)
Member
Joined: 1 year ago
Posts: 5
 

I'm trying to adapt this design to use a pair of L9110S H-Bridge modules.  Since they only have two control pins per motor and speed and direction are controlled by setting one pin LOW and the other pin to a PWM value corresponding to the motor speed, I'm having trouble figuring out how to adapt the mecanum-test.ino code to this design.

It would appear that I might need to use eight PWM channels instead of four.  Does that seem reasonable?

I have no experience with the PWM channels on the ESP32 but want to learn.

I have learned a lot from watching you on YouTube.  Thank you for your work.


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

@tjblair1951 Have a look at this https://bityl.co/O29G

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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@tjblair1951)
Member
Joined: 1 year ago
Posts: 5
 

Thanks, but the trouble I'm having is not how to make the L9110S work but how to use it with the ESP32 PWM channels.  I see what Bill did controlling the motor speed on the third pin of the H-Bridge he used in his design.  I need to adapt that to the fact that the L9110S sends PWM to both pins used for motor control.  In Bill's design you set the direction on two pins and the speed on a third. On the L9110S, you set one pin LOW, controlling the direction, and the other pin to a PWM value to determine the speed.  I'm not sure if I need to use a separate PWM channel on the ESP32 for each pin (hence eight channels) or if I am missing something in my understanding.


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

@tjblair1951 I am enclosing the datasheet (NOTE warnings re current). It is a poor quality datasheet. Why not consider the TB6612FNG (of course first checking current and voltage limitations)

Here are a few links that might help with the L9110

This is a great resource

adafruit basic info

A video I didn't watch

The First link is the best, just substitute menu control with whatever control mechanism you want. Also replace the two PWM values for Fast and Slow with whatever you want, maybe a pot or joystick.

 

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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@tjblair1951)
Member
Joined: 1 year ago
Posts: 5
 

@zander To answer your first question about using a different H-Bridge, I have two responses.  The first is that I already have the L9110S modules so I'd rather use them than buy something else. The second is that I'm trying to learn something new (to me) and just copying what Bill did gives me a working car but not the additional knowledge I will get from making something slightly different work.

I have a working setup with the L9110S as far as making the wheels turn using digitalWrite and analogWrite; however, I'm trying to figure out how to do the same thing using ledc and that's something I have never used before.

I do appreciate your interest in my little problem.  Thank you for taking the time to reply.


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

@tjblair1951 Ok, yes ledc is a handy way to control PWM. It is very straightforward. How do you plan on controlling the speed? A pot or maybe a joystick or even web based, I think Bill has done all of those.

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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Page 3 / 4