PeetR0ver: Difference between revisions

From RevSpace
Jump to navigation Jump to search
mNo edit summary
m (Fixed some typo's, and revived the ali link.)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
   {{Project
   {{Project
   |Name=PeetrR0ver
   |Name=PeetrR0ver
   |Picture=PeetR0ver_2018-08-11.jpg
   |Picture=PeetR0ver_2018-08-22_A.jpg
   |Omschrijving=I found an old RC car, and upgraded almost every component
   |Omschrijving=I found an old RC car, and upgraded almost every component.
   |Status=In progress
   |Status=In progress
   |Contact=Peetz0r
   |Contact=Peetz0r
Line 13: Line 13:


= The remote =
= The remote =
All of the tiny buttons are fake. It does not even have a power switch. The joysticks are also kinda fack. Each joystick is really just 2 buttons which you cannot press at the same time. It has an Silan TX-2B chip inside (the car has a matching RX-2B), and almost nothing else really. I modified the remote to have a micro USB port, so I could use it with a small USB power bank. It lasts forever and I never have to worry about batteries again. It runs fine on 5V.
[[File:PeetR0ver 2018-08-22 E.jpg|240px|thumb|left|The original remote, battery and charger.]]
All of the tiny buttons are fake. It does not even have a power switch. The joysticks are also kinda fake. Each joystick is really just 2 buttons which you cannot press at the same time. It has an Silan TX-2B chip inside (the car has a matching RX-2B), and almost nothing else really. I modified the remote to have a micro USB port, so I could use it with a small USB power bank. It lasts forever and I never have to worry about batteries again. It runs fine on 5V.


A datasheet was easy to find online: [[Media:PeetR0ver-TX-RX-2B.pdf]] (250 KB, 11 pages). Page 7 and 8 contain a schematic that almost exactly matches the remote and car. The biggest difference is the lack of a turbo button in my implementation. But that's okay. It goed fast enough as it is already. This datasheet is from 2005, but I have seen an almost identical datasheet of the Realtek TX2 and RX2 from 1998. For some unknown reason it's a [https://www.jbprojects.net/projects/wifirobot/TX2RX2.doc Word document] (336 KB, 8 pages).
A datasheet was easy to find online: [[Media:PeetR0ver-TX-RX-2B.pdf|TX-RX-2B.pdf]] (250 KB, 11 pages). Page 7 and 8 contain a schematic that almost exactly matches the remote and car. The biggest difference is the lack of a turbo button in my implementation. But that's okay. It goed fast enough as it is already. This datasheet is from 2005, but I have seen an almost identical datasheet of the Realtek TX2 and RX2 from 1998. For some unknown reason it's a [https://www.jbprojects.net/projects/wifirobot/TX2RX2.doc Word document] (336 KB, 8 pages).


= The car =
= The car =
It's a "1:12 monster truck". Since the battery was missing, I had to find a way to get around 9V from something bigger than a 9V alkaline battery and less crappy than anything NiCad or NiMH. It's 2018 after all. I didn't feel like building my own Li-Ion pack, but I could have done that. Instead, I went for my [https://www.anker.com/uk/products/variant/powercore-26800-pd/A1375011 big USB power bank] which supports Power Delivery 2.0 and a [https://nl.aliexpress.com/item/ZY12PD-USB-PD-type-C-fast-flip-flops-polling-detector-hardware-scheme/32810557770.html ZY12PD module] set to 9V, which I both happened to have already.
[[File:PeetR0ver 2018-08-22 C.jpg|350px|thumb|right|The car next to the original body.]]
It's a "1:12 monster truck". Since the battery was missing, I had to find a way to get around 9V from something bigger than a 9V alkaline battery and less crappy than anything NiCad or NiMH. It's 2018 after all. I didn't feel like building my own Li-Ion pack, but I could have done that. Instead, I went for my [https://www.anker.com/uk/products/variant/powercore-26800-pd/A1375011 big USB power bank] which supports Power Delivery 2.0 and a [https://aliexpress.com/snapshot/0.html?orderId=91182392977806&productId=32810557770 ZY12PD module] set to 9V, which I both happened to have already.


Inside the car is a large motor for driving which draws up to 3.5 A and a small motor for steering which draws around 500 mA. There is one PCB with the RX-2B chip and 2 H-bridge circuits.
Inside the car is a large motor for driving which draws up to 3 A and a small motor for steering which draws around 500 mA. There is one PCB with the RX-2B chip and 2 H-bridge circuits.


I removed the body because it didn't fit well with the power bank. The body did have LED's, but I replaced those with more powerful LED's which I hotglued to the base. With almost 100 Wh of energy taped to it, the car worked practically forever. Presumably sligtly better than before, becase the voltage does not drop when the battery drains like the original would have.
I removed the body because it didn't fit well with the power bank. The body did have LED's, but I replaced those with more powerful LED's which I hotglued to the base. With almost 100 Wh of energy taped to it, the car worked practically forever. Presumably sligtly better than before, because the voltage does not drop when the battery drains like the original would have.


But this was not good enough. The controls are still limited to "1 bit resolution" and the range wasn't great.
But this was not good enough. The controls are still limited to "1 bit resolution" and the range wasn't great.


= Killing transistors =
= Killing transistors =
So, that was when I grabbed a NodeMCU esp8266 module from one of our parts boxes, wrote a bit of µPython to make it do PWm stuff on 4 pins, and connected those directly to the existing electronics in the car. It worked. I could connect to the repl over wifi and type forward(0.5) and it would move at half speed. So I played around with this for a few minutes until I accidentally turned on 'left' and 'right' at the same time. Shortly thereafter I learned what an H-bridge is and how transistors die. Luckily we have the same type of transistors in stock, so replacing one would be easy. But for some reason more transistors died. I have replaced all of them at least twice. I started debugging the board, but the only thing I could find out was that it would short out no matter what I tried.
[[File:PeetR0ver 2018-08-22 D.jpg|240px|thumb|left|Bottom left: USB PD module set to 9v. Bottom right: USB micro breakout.]]
So, that was when I grabbed a NodeMCU esp8266 module from one of our parts boxes, wrote a bit of µPython to make it do PWM stuff on 4 pins, and connected those directly to the existing electronics in the car. It worked. I could connect to the repl over wifi and type forward(0.5) and it would move at half speed. So I played around with this for a few minutes until I accidentally turned on 'left' and 'right' at the same time. Shortly thereafter I learned what an H-bridge is and how transistors die. Luckily we have the same type of transistors in stock, so replacing one would be easy. But for some reason more transistors died. I have replaced all of them at least twice. I started debugging the board, but the only thing I could find out was that it would short out no matter what I tried.


The next morning another revspace participant gave me a motor driver module. Thisis based on the ST L298N chip, which has 2 integrated H-bridge circuits with protection against enabling both sides. I replaced all the electronics in the car with this board and the NodeMCU and called it a day.
The next morning another revspace participant gave me [https://www.sainsmart.com/products/sainsmart-l298n-dual-h-bridge-stepper-motor-driver-controller-board-module-for-arduino a motor driver module]. This is based on the [https://www.st.com/content/st_com/en/products/motor-drivers/brushed-dc-motor-drivers/l298.html ST L298N] chip, which has 2 integrated H-bridge circuits with protection against enabling both sides. I replaced all the electronics in the car with this board and the NodeMCU and called it a day.


= Sofware =
= Sofware =
I decided to switch from µPython to C/Arduino. The software on the arduino listens for udp packets on port 42 with messages like 'forward 1023'. It also broadcasts a packet with 'PeetR0ver' on port 4242 to facilitate autodetection.
I decided to switch from µPython to C/Arduino. The software on the arduino listens for udp packets on port 42 with messages like 'forward 1023'. It also broadcasts a packets on port 4242 to facilitate autodetection.


On my laptop I used a USB gamepad with 2 analog sticks and I wrote a Python script with pygame to translate joystick events into udp packets. This works great, but I wanted something more portable, so I decided to make a mobile app with flutter. At first I implemented conteol using accelerometer input, but it's pretty hard to use that poperly, so I also implemented touchscreen control.
On my laptop I used a USB gamepad with 2 analog sticks and I wrote a Python script with pygame to translate joystick events into udp packets. This works great, but I wanted something more portable, so I decided to make a mobile app with flutter. At first I implemented conteol using accelerometer input, but it's pretty hard to use that poperly, so I also implemented touchscreen control.
I have spent quite a lot of time to make it reliable (e.g. it does not continue to drive when you release the input device, even if the network is flaky and retransmitting old packets). The code is avaliable at https://gitlab.com/Peetz0r/PeetR0ver. Sorry for not including the early history in git :(
I also found a wiimote on the freestuff (sometime last year) and made my python code work with it, using [https://github.com/Oblomov/wiimote-pad wiimote-pad].


= Camera =
= Camera =
...coming soon(er or later)!
[[File:PeetR0ver 2018-08-22 B.jpg|350px|thumb|right|Say cheese!]]
I wanted to see what I was doing even while driving out of sight. So I needed a camera. At first I experimented with streaming video from a smartphone to my laptop, but a phone is expensive and fragile and I couln't get the latency down to usable levels.
 
So I went analog. I bought a [https://www.banggood.com/Eachine-TX02-Super-Mini-AIO-5_8G-40CH-200mW-VTX-600TVL-14-Cmos-FPV-Camera-p-1088368.html 5.8 ghz FPV camera] and [https://www.banggood.com/Eachine-ROTG01-UVC-OTG-5_8G-150CH-Full-Channel-FPV-Receiver-For-Android-Mobile-Phone-Smartphone-p-1147692.html USB UVC reciever]. Hotglued it into place and done! Really, I have spent much less time on the camera than any other part so far. I chopped of the supplied adapter cable and wired in a micro-usb breakout board, and that connects to another port on the same powerbank.
 
= Trailer =
[[File:PeetR0ver 2018-08-24.jpg|350px|thumb|left|Say cheers!]]
I decided that my car needed to become more useful. So I built a beverage trailer for it. The 'wood' is actually [https://www.ikea.com/nl/nl/catalog/products/90417527/ IKEA SLÄTTEN], which is actually 5,3 mm MDF with a nice fake wood pattern printed on it. I bought wheels at the DIY store nearby but they turned out to be way too small, and we had better wheels at the space, so I made a rev2. It it capable of carrying 6 full 500ml bottles of Club Mate, which are around 900g each, and the trailer itself is also around 900g. So the car can successfully carry over 6kg on top of it's own 2kg weight!

Latest revision as of 19:33, 14 March 2019

Project PeetrR0ver
PeetR0ver 2018-08-22 A.jpg
I found an old RC car, and upgraded almost every component.
Status In progress
Contact Peetz0r
Last Update 2019-03-14

Status when I found it

The batteries were missing, but everything worked fine. The remote had an old HEMA rechargable 9v battery, but it was very much empty. The car itself came with a 9,6v 8 cell NiCad pack, but it was missing. It's a 27 MHz system with a telescoping antenna on the remote and a wire in a plastic tube on the car. It only has binary control, so it's either full speed or nothing. This makes it hard to control on smooth surfaces, including almost any indoor floor.

The car is still available at some stores around the world for around €40 - €50, such as http://www.stuntzolder.nl/monster-truck-rampage-1-12.html

The remote

The original remote, battery and charger.

All of the tiny buttons are fake. It does not even have a power switch. The joysticks are also kinda fake. Each joystick is really just 2 buttons which you cannot press at the same time. It has an Silan TX-2B chip inside (the car has a matching RX-2B), and almost nothing else really. I modified the remote to have a micro USB port, so I could use it with a small USB power bank. It lasts forever and I never have to worry about batteries again. It runs fine on 5V.

A datasheet was easy to find online: TX-RX-2B.pdf (250 KB, 11 pages). Page 7 and 8 contain a schematic that almost exactly matches the remote and car. The biggest difference is the lack of a turbo button in my implementation. But that's okay. It goed fast enough as it is already. This datasheet is from 2005, but I have seen an almost identical datasheet of the Realtek TX2 and RX2 from 1998. For some unknown reason it's a Word document (336 KB, 8 pages).

The car

The car next to the original body.

It's a "1:12 monster truck". Since the battery was missing, I had to find a way to get around 9V from something bigger than a 9V alkaline battery and less crappy than anything NiCad or NiMH. It's 2018 after all. I didn't feel like building my own Li-Ion pack, but I could have done that. Instead, I went for my big USB power bank which supports Power Delivery 2.0 and a ZY12PD module set to 9V, which I both happened to have already.

Inside the car is a large motor for driving which draws up to 3 A and a small motor for steering which draws around 500 mA. There is one PCB with the RX-2B chip and 2 H-bridge circuits.

I removed the body because it didn't fit well with the power bank. The body did have LED's, but I replaced those with more powerful LED's which I hotglued to the base. With almost 100 Wh of energy taped to it, the car worked practically forever. Presumably sligtly better than before, because the voltage does not drop when the battery drains like the original would have.

But this was not good enough. The controls are still limited to "1 bit resolution" and the range wasn't great.

Killing transistors

Bottom left: USB PD module set to 9v. Bottom right: USB micro breakout.

So, that was when I grabbed a NodeMCU esp8266 module from one of our parts boxes, wrote a bit of µPython to make it do PWM stuff on 4 pins, and connected those directly to the existing electronics in the car. It worked. I could connect to the repl over wifi and type forward(0.5) and it would move at half speed. So I played around with this for a few minutes until I accidentally turned on 'left' and 'right' at the same time. Shortly thereafter I learned what an H-bridge is and how transistors die. Luckily we have the same type of transistors in stock, so replacing one would be easy. But for some reason more transistors died. I have replaced all of them at least twice. I started debugging the board, but the only thing I could find out was that it would short out no matter what I tried.

The next morning another revspace participant gave me a motor driver module. This is based on the ST L298N chip, which has 2 integrated H-bridge circuits with protection against enabling both sides. I replaced all the electronics in the car with this board and the NodeMCU and called it a day.

Sofware

I decided to switch from µPython to C/Arduino. The software on the arduino listens for udp packets on port 42 with messages like 'forward 1023'. It also broadcasts a packets on port 4242 to facilitate autodetection.

On my laptop I used a USB gamepad with 2 analog sticks and I wrote a Python script with pygame to translate joystick events into udp packets. This works great, but I wanted something more portable, so I decided to make a mobile app with flutter. At first I implemented conteol using accelerometer input, but it's pretty hard to use that poperly, so I also implemented touchscreen control.

I have spent quite a lot of time to make it reliable (e.g. it does not continue to drive when you release the input device, even if the network is flaky and retransmitting old packets). The code is avaliable at https://gitlab.com/Peetz0r/PeetR0ver. Sorry for not including the early history in git :(

I also found a wiimote on the freestuff (sometime last year) and made my python code work with it, using wiimote-pad.

Camera

Say cheese!

I wanted to see what I was doing even while driving out of sight. So I needed a camera. At first I experimented with streaming video from a smartphone to my laptop, but a phone is expensive and fragile and I couln't get the latency down to usable levels.

So I went analog. I bought a 5.8 ghz FPV camera and USB UVC reciever. Hotglued it into place and done! Really, I have spent much less time on the camera than any other part so far. I chopped of the supplied adapter cable and wired in a micro-usb breakout board, and that connects to another port on the same powerbank.

Trailer

Say cheers!

I decided that my car needed to become more useful. So I built a beverage trailer for it. The 'wood' is actually IKEA SLÄTTEN, which is actually 5,3 mm MDF with a nice fake wood pattern printed on it. I bought wheels at the DIY store nearby but they turned out to be way too small, and we had better wheels at the space, so I made a rev2. It it capable of carrying 6 full 500ml bottles of Club Mate, which are around 900g each, and the trailer itself is also around 900g. So the car can successfully carry over 6kg on top of it's own 2kg weight!