Trex Jr

Hey Ben,

I think I finally came to the conclusion that my alkaline batteries do not deliver (?) enough current.I have done some reading in forums and websites and understood that NiCd batteries are the best for rc cars because they can deliver high current (up to 5 amp, so they say), which is more than NiMh batteries (1.5-2 amp), and needless to say, more than the alkalines.
I have also seen that tyco which is the manufacturer of rc cars (and the car I disassembled) use 6v NiCd batteries to run their cars.
I am trying to find where to buy NiCd batteries which is not so easy apperently (in Israel).

What do you think about that ?
can you approve ?

Sure, give it a shot. Unfortunately, I don’t really have any suggestions for where you can easily find such batteries. Don’t forget to get a charger, and you should charge them before you first use them.

- Ben

Hello Ben,

After testing everything in the circuit around the Trex Jr, I don’t have other explanation other that there is something wrong with my Trex.
The main thing that is not working proparely is that when I send command to the motors with my microcontroller, some times it effects the motor and sometimes not. I always see a green led flash which means th trex got the messege but sometimes the motor moves and sometimes not.
the only thing I didn’t try is connecting a capacitor to the motor because its a bit of a problem for me to reach close to the motor, but I dont thing that would solve the problem beacause when I am working with the configurator the motors respond well…

Nir.

I also see that when I send command with the configurator the green led (of the recieve line) keeps blinking
but when I send a command with the microcontroller there is only one blink… Is that how it suppose to be ?

I have no clue now, I am realy tired from this problem, I have the Trex for 2 months and it’s still not working with commands from the mcu…

Nir,

The TReX configurator communicates with the TReX via serial, so if the TReX works with the configurator, your serial issues are not being caused by the TReX. There must be something wrong with the way your MCU is trying to communicate with it, or a problem due to motor noise that is minimized by the way the configurator repeatedly sends commands.

The configurator is constantly updating the motor speeds and requesting the motor currents when you use it to control the motors, which is why you see the green light blinking. Your code is presumably only sending a single command, which is why you only see one blink. What happens if you repeatedly send your motor commands (i.e. place them in a loop)? If motor noise is interfering with TReX operation, perhaps this is one way you could get around the problem of the motors only intermittently working. You should also consider enabling acceleration and using acceleration motor commands, and I strongly urge you to put capacitors on your motors. I don’t think you appreciate just how significant of a problem motor noise can pose to digital control systems.

- Ben

a 0.1 uF will do the job for all kund of small/medium motor ?

Yes. Using three capacitors per motor as shown here will provide the greatest noise suppression, as will following the rest of the recommendations, such as routing power lines away from your signal lines and keeping your motor leads as short as possible. If you have access to an oscilloscope, you can us it to see just how noisy your motors are and determine if they are causing problems with your system.

Have you tried putting your motor speed commands in a loop?

- Ben

yes, I have and they work better, does it neccesery mean that I have a noise problem ?

It could be an indication of motor noise. Either that or your serial communication is noisy/problematic on its own. Something is clearly interfering with your serial signals in a way that causes the TReX to often get the wrong bytes. Do you have any communication issues when you send commands to the TReX that don’t involve the motors? If not, then I’d blame motor noise. If you do, then I’d blame the serial connection itself (e.g. maybe your microcontroller’s baud rate is slightly off.) Another thing you could try is lowering the TReX’s baud rate to something much slower (I’d recommend doing this with the configurator), which might make it more immune to noise, or might fix the problem if it’s being caused by a baud rate issue with your microcontroller.

- Ben

Hello Ben,

I put a capacitor between Vcc and GND of the mcu after trying everything (thinking it can cause a problem) and now it works GREAT , one command never misses (yet) !!!
I guess it is something you do always, isn’t it ?

Nir

Yeah, it’s always good to have noise-filtering capacitors near your logical components. Most MCU boards have lots of capacitors between VCC and ground spread throughout the board. It’s great to hear that things are working well for you now!

- Ben

I am really really thankful for all the help, I couldn’t do it without your support,
and I learned a lot on the way too,

Thank you very very much,

Nir.

Hi Ben,

I wanted you to see my project with the Trex Jr.

Nir.

Very nicely done! I’m glad you were able to get things working so well; thanks for sharing that with us!

- Ben