Joystick Shield with nRF24L01 driving a Zumo Robot


With the Joystick shield I have a convenient way to drive and control a Zumo Robot without a wired connection:

Joystick Shield with Robot

Joystick Shield with Robot

While things started promising, there was a power supply problem at the end to be solved…

Battery for Remote Controller

With a 3.3V DC-DC converter the supply voltage for the FRDM-KL25Z and Joystick shield is provided.

3.3 DC-DC Converter

3.3 DC-DC Converter

Because the battery pack was a bit to thick, it have it strapped with velcro to the bottom of the board:

Battery attached to board

Battery attached to board

Problem: No Wireless Communication with Motors Turned On

Well, things turned out not to be that easy. I was able to successfully to communicate between the Joystick shield and the robot. But as soon as I turned on the motors, communication was not functional any more. Observations:

  1. Communication works without the motors running
  2. As soon as the motors are turned on, communication failed: the robot nRF24L01+ did not receive any packets. Sometimes communication from the robot to the joystick shield worked.
  3. The motors actually had not to turn: even with a very low PWM duty cycle (1%) to the H-Bridge caused the failure.
  • First I was thinking that there might be some noise, so I extended the SPI cables of the robot nRF24L01+ module (to get it further away from the motors): this did not help.
  • The PWM signal itself was not a problem, because with the H-Bridge removed things were working even with a PWM signals on the line.
  • Changing the frequency of the H-Bridge PWM (from 100 kHz to a few kHz) did not help neither.
  • Changing nRF24L01+ modules sometimes showed better behaviour, but not consistently.

To inspect better the signals to the nRF24L01+ module, it has been mounted on the side of the robot:

Sidemounted nRF24L01+ Module

Side mounted nRF24L01+ Module

This is the output of the H-Bridge to the motor:

H-Bridge output to the motor

H-Bridge output to the motor

Same, but zoomed to see the signal change:

Zoom to Motor Signal

Zoom to Motor Signal

So this looks pretty good so far. But what does not look good is the 3.3V supply voltage to the RF module right after turning on the motors:

3.3V Supply Voltage

3.3V Supply Voltage

First, there is a voltage drop after turning on the motors. This seems not to be a problem as the nRF24L01+ should run down to 1.9V. The problem is the +/- 200 mV noise generated afterwards by the motors. So the ‘fix’ was simply to add stabilization of the supply voltage to the nRF24L01+ pins. So we added a filter with 4.7 µF + 1 µF plus 100 nF (on the module).

Added C's to nRF24L01+ Module

Added C’s to nRF24L01+ Module

This reduced the noise part enough to keep the RF module working:

Filtered supply voltage

Filtered supply voltage

With this, things were working well, as shown in the video below:

There is still a problem sometimes if going forward 100% and then pulling back 100% several times: this causes the battery supply voltage to drop for an extended period:

Multiple voltage drops

Multiple Battery voltage drops

The current PCB design is not able to cover that in a clean way. Workaround is to use an extra battery for the RF module which is rather ugly. We are preparing a new PCB board and design to address this issue. Keeping fingers crossed ;-).

Summary

Using the nRF24L01+ module requires good stabilization of the supply lines. With too much noise or unstable voltage, communication will fail. Adding C’s to the module supply pins are an easy fix for that situation. Repeated motor forward/backward causes a battery voltage drop which can cause the nRF24L01+ module to fail. So if you see problems with the nRF24L01+, then my tip is to check the supply voltage :-)

Happy Checking :-)

About these ads

3 thoughts on “Joystick Shield with nRF24L01 driving a Zumo Robot

  1. Hillbilly Injunear - B4 I starrded usig Freescale MCUs eye cudn't evan spal injunear. Now I ar one. on said:

    Would adding a much larger cap (440uF or 680uF or even 1KuF) along side the ones you already have provide enough DC stabilization? I have had to do that on occasion for certain prototype devices I’ve built from time to time.

    Like

    • Yes, that would helped somewhat, but probably not in all cases where the battery voltage can drop down for more than one second. For the transceiver alone: yes, as it uses around 20 mA while sending/receiving. But not enough for the whole system. In the next design we are going to have a 7.45V system voltage (generated from the batteries) and then generated down the needed 5V and 3.3V. The current way with 9V, 3.3V and 5V DC-DC converters has not enough stabilization built in neither, so it is good that do a redesign with all the things learned.

      Like

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s