Mark's Antweight build

All things antweight

Moderators: petec, administrator, BeligerAnt

User avatar
MarkR
Posts: 117
Joined: Mon Dec 18, 2017 12:46 pm
Location: Reading Hackspace
Contact:

Mark's Antweight build

Post by MarkR » Fri Mar 09, 2018 12:23 pm

Hi,

My robot will probably be called "Unmitigated Disaster".

It is a semi-intelligent microprocessor driven 4wd flipper. It will use a total of 6 N20 gear motors - 4 for the drive and 2 for flipper.

It uses a Raspberry Pi Zero W as the main processor and radio receiver; a DasMikro ESC for the drive motors and voltage regulator, another (as yet unspecified) driver chip for the weapon motors, and a mpu6050 IMU (intertial measurement unit - sensor).

Some parts are 3d printed, others are cut out of various types of plastic.

Although the design has many problems, it's progressing, and still fits within the 4" cube and should meet the weight limit with some armour. I have most of the parts but I'm still trying to get it to fit together. Here are some (already out of date) design pictures and a wiring diagram :)
Attachments
unmitigated3.png
unmitigated3.png (18.15 KiB) Viewed 1253 times
unmitigated2.png
unmitigated2.png (27.47 KiB) Viewed 1253 times
unmitigated4.PNG
unmitigated4.PNG (24.52 KiB) Viewed 1253 times
Robot: Betsie - RaspberryPi controlled flipper bot with gyro stablisation - too clever for her own good?

User avatar
MarkR
Posts: 117
Joined: Mon Dec 18, 2017 12:46 pm
Location: Reading Hackspace
Contact:

Re: Mark's Antweight build

Post by MarkR » Fri Mar 09, 2018 12:26 pm

Wiring diagram
Attachments
disaster_wiring.PNG
disaster_wiring.PNG (217.07 KiB) Viewed 1250 times
Robot: Betsie - RaspberryPi controlled flipper bot with gyro stablisation - too clever for her own good?

Paulmchurd
Posts: 191
Joined: Sun Dec 10, 2017 4:39 pm

Re: Mark's Antweight build

Post by Paulmchurd » Fri Mar 09, 2018 2:28 pm

Looks awesome, will you be lacking armour with all the weight with chips and motors? Or are the microprocessor,h-bridge and esc not actually that heavy?

User avatar
MarkR
Posts: 117
Joined: Mon Dec 18, 2017 12:46 pm
Location: Reading Hackspace
Contact:

Re: Mark's Antweight build

Post by MarkR » Fri Mar 09, 2018 2:55 pm

There is not much weight in the electronics, but there is a little more than in a typical rx / esc combination. The Raspberry Pi Zero weighs 9g with sd card. I haven't quite worked it out yet, I expect there to be a lot of weight in "other" category (fastenings, tyres, wires, ) - also 6x motors - they are 10g each.

I am planning to bolt on some angled plastic (maybe aluminium in places if there is enough weight spare) in the sides and back for armour.

Also, did you know that B&Q sell robot armour? https://www.diy.com/departments/white-p ... 019_BQ.prd
Robot: Betsie - RaspberryPi controlled flipper bot with gyro stablisation - too clever for her own good?

Paulmchurd
Posts: 191
Joined: Sun Dec 10, 2017 4:39 pm

Re: Mark's Antweight build

Post by Paulmchurd » Fri Mar 09, 2018 4:20 pm

If you go for a Arduino pro mini. They are slightly smaller and lighter I think. Can pick them up for £5 with the usb module.

That’s cheap for B&Q!

I bought these.

https://www.ebay.co.uk/itm/JMT-10Ppcs-L ... 2749.l2649

Only took a month to arrive 🙈😂😂

User avatar
MarkR
Posts: 117
Joined: Mon Dec 18, 2017 12:46 pm
Location: Reading Hackspace
Contact:

Re: Mark's Antweight build

Post by MarkR » Fri Mar 09, 2018 4:41 pm

Arduino pro mini does not have a built in radio or wifi, it's going to be a pain to do what I want. I think the Pi is a good choice if I can make it work mechanically; it's perhaps a bit delicate, especially the sd card (I'm investigating whether it can run without the sd card).

Mark
Robot: Betsie - RaspberryPi controlled flipper bot with gyro stablisation - too clever for her own good?

User avatar
MarkR
Posts: 117
Joined: Mon Dec 18, 2017 12:46 pm
Location: Reading Hackspace
Contact:

Re: Mark's Antweight build

Post by MarkR » Sat Mar 10, 2018 11:53 pm

Update:

I wired up the battery, Raspberry Pi and DasMikro ESC, with a single motor (to test).

It powers the Pi just fine.

But I couldn't work out why it wasn't driving the motor. I did some investigation with an oscilloscope, but everything looked hunky-dory...

I tried various pulse widths on the outputs, but the motor didn't turn. I tried both channels (L and R?)

*BUT* then I realised the problem - the DasMikro has "tank mixing" built-in, so to drive the motor I need to set one channel (call it "steering") to the middle, then the other channel controls the speed. It won't drive the motor unless it receives pulses on both channels.

I did order the DasMikro without tank-mixing - because I want to do my own tank-mixing in the software - but this now doesn't seem to be an option. At least I have a way forward... now I need to work out how to make this gubbins fit in the robot.
Robot: Betsie - RaspberryPi controlled flipper bot with gyro stablisation - too clever for her own good?

Paulmchurd
Posts: 191
Joined: Sun Dec 10, 2017 4:39 pm

Re: Mark's Antweight build

Post by Paulmchurd » Sun Mar 11, 2018 2:05 pm

Did you get it working?

Some of the modules for the Arduino. You need to import a library to make the modules work.

User avatar
MarkR
Posts: 117
Joined: Mon Dec 18, 2017 12:46 pm
Location: Reading Hackspace
Contact:

Re: Mark's Antweight build

Post by MarkR » Sun Mar 11, 2018 7:09 pm

Hi,

I'm not using the Arduino environment, but yes, it's working so far, the DasMikro powers the Pi and drives a motor without making any smoke, no lipo-related incidents so far.

On the Raspberry Pi it's possible to program in any language - my code will be partially reused from a previous (non-combat) robot, reading the IMU data regularly and making steering adjustments using a PID control loop, and reading the controller data (via Bluetooth) and sending data to the motors accordingly.

On the Raspberry Pi there is a program called "pigpiod" which is a special daemon which can be programmed to generate PWM pulses, etc, either "servo pulses" or "duty cycle" pulses, depending on what kind of output we use. The DasMikro is intended to be driven from a RC receiver so it understands servo pulses. If I use a different controller, that will need "duty cycle" pulses.

Honestly I think the DasMikro is a bit too clever, I should have used the https://thepihut.com/products/motozero motozero instead, it looks quite hackable (can save a lot of weight by not using the screw terminals and IC socket, save space by using very low profile pin headers) but it doesn't include a voltage regulator, so I'd need a separate one.

One advantage of servo pulses is that you can drive both directions with variable speed using only one pin / wire, whereas a h-bridge circuit usually needs 3.
Robot: Betsie - RaspberryPi controlled flipper bot with gyro stablisation - too clever for her own good?

Paulmchurd
Posts: 191
Joined: Sun Dec 10, 2017 4:39 pm

Re: Mark's Antweight build

Post by Paulmchurd » Sun Mar 11, 2018 8:34 pm

Sorry I use an Arduino so I was just comparing how it could work. Never used a raspberry pi.

I’ve been using this for motors.

https://www.ebay.co.uk/itm/L9110S-H-bri ... 2749.l2649

Not sure of the amp draw of 2 dc motors in parallel. Might not actually be able to handle it.

User avatar
MarkR
Posts: 117
Joined: Mon Dec 18, 2017 12:46 pm
Location: Reading Hackspace
Contact:

Re: Mark's Antweight build

Post by MarkR » Mon Mar 12, 2018 8:23 am

That's quite a nice H-bridge board, it doesn't require a second 5v supply, could run directly from the Lipo voltage, which is nice. I'm not sure about the current capability though.

The h-bridge chip SN754410 is apparently quite good (and supports the 3.3v logic level, which is important) - but needs a 5v supply too (=more wires)

I spent some time last night shortening and heatshrinking wires to try to fit everything in. It almost fits (also I made the robot a bit bigger.. still ok for the 4 inch cube)
Robot: Betsie - RaspberryPi controlled flipper bot with gyro stablisation - too clever for her own good?

User avatar
MarkR
Posts: 117
Joined: Mon Dec 18, 2017 12:46 pm
Location: Reading Hackspace
Contact:

Re: Mark's Antweight build

Post by MarkR » Thu Mar 15, 2018 11:52 pm

Ok,

So the good news - the DasMikro did not melt, and runs the Raspberry Pi, and the Pi can drive the motors.

The Pi now sort-of fits in the robot (which fits in the cube, I think). The wheels stay on, the battery will fit.

I've got some 300mAh lipos which are clearly massively overspec, I would definitely try to get smaller packs in future.

Surprisingly, my remaining parts from China arrived about 2 weeks early, so I now have all of the 6x motors required. There is still a lot of fiddling to do with motor-mounts and wires.

I am honestly surprised at the amount of faffing around with wires involved. it seems mostly soldering heatshrinking and other kinds of fannying around to get small parts with tight tolerances to fit.

Still, keeps me off the street.

Software is another issue. I got the cheapo ripoff PS3 controller, and I can't make it speak Bluetooth to the Rapsberry Pi. This is not, however, a disaster, as I can employ a 2nd Raspberry Pi as a radio relay and use my own software on both sides.
Robot: Betsie - RaspberryPi controlled flipper bot with gyro stablisation - too clever for her own good?

Paulmchurd
Posts: 191
Joined: Sun Dec 10, 2017 4:39 pm

Re: Mark's Antweight build

Post by Paulmchurd » Fri Mar 16, 2018 7:44 am

Nice, maybe you’ve received my motors that I order 1 month ago now 😫...

Did the dasmikro work just like attaching a h-bridge. You just send it PWM and it worked?

Pictures?

Sounds a fun project. Feels more rewarding then attaching an esc and reciever together.

Paul

User avatar
MarkR
Posts: 117
Joined: Mon Dec 18, 2017 12:46 pm
Location: Reading Hackspace
Contact:

Re: Mark's Antweight build

Post by MarkR » Fri Mar 16, 2018 8:43 am

A really quite bad picture.

The white heatshrink is convering a MPU6050 IMU board. The Dasmikro is in black heatshrink stuffed underneath that. The white wires were the ones which came with Dasmikro ESC, but shortened a great deal.

The other wiring is basically invisible in this picture.

It will be 4wd, but only the rear wheels are fitted at the moment. The plate is to mount another pair of motors for the flipper. I've little idea how powerful it will be, but I'm hoping- very :)
Attachments
robot20180316.jpg
robot20180316.jpg (102.11 KiB) Viewed 976 times
Robot: Betsie - RaspberryPi controlled flipper bot with gyro stablisation - too clever for her own good?

User avatar
MarkR
Posts: 117
Joined: Mon Dec 18, 2017 12:46 pm
Location: Reading Hackspace
Contact:

Re: Mark's Antweight build

Post by MarkR » Mon Mar 19, 2018 1:42 pm

Not all good news, had a frustrating morning trying to diagnose a short circuit.

Discovered that one of the Chinese N20 gear motors had a dead-short circuit internally despite appearing normal otherwise.

My advice for anyone wiring up a robot with several motors in parallel on a ESC is:

* Check the ESC isn't a dead short before you start
* Check each motor isn't a short circuit (mine were 6.6 Ohm normally, < 0.7 short)
* Check your wiring loom for shorts after soldering but before power-on.

It saves a lot of time and possibly some destroyed electronics.

I didn't manage to destroy anything though. The microcontroller spontaneously rebooted (presumably due to overcurrent condition dropping the power out), which immediately turned off the power to the failed circuit.

Also, conveniently, I was testing it with a limited-current bench supply instead of a LiPo battery, that was good luck.
Robot: Betsie - RaspberryPi controlled flipper bot with gyro stablisation - too clever for her own good?

Post Reply