Home Made Segway

I have been working on this idea for a while now, to build my own segway clone.

It hass been a while since I started this project and finally it is working as hoped.

 

I made a demo video, as for now it is only a Swedish version is available.

 

My idea is that I want hardware that doesn’t bring any model or programming limits. There should be no need for workarounds or mysterious functions to make the model work. There should be enough processor power so you don’t have to design your model according to hardware limitations.

The theory will seem more genuine if you are not too limited by the hardware. I have based the design on my ideas on how to best implement the simplest solution that still has more processor capabilities than needed.

My motto for this project was

Highly optimized controller and power boards give you freedom to implement more advanced model functions without the need of workarounds.

There is a loot of stuff in this machine, I will try to show the most interesting parts 🙂

The structure of the electronics

909

The MainBoard, MotorBoard and SensorBoard are housed inside the black box  you see above.

DSC05163 (Medium)
The black box contains 3 boards. Right now the box is made of wood, but it will be replaced by one made of aluminum soon for better shielding properties.

s10

 

MainBoard

MainBoart_Top (Medium) MainBoard_Back (Medium)

The main board is a separate board that holds the vital peripherals and has access to all the data of the system. This is the central processing unit of the segway. The main board is a separated board, and this enables a board design that is more resistant to external interference, such as the electrical noise generated by the motor board and motors. This is vital for a good signal to noise ratio on the ADC design that samples the sensors. Without this the sensor readings get noisy and precision is reduced. This is the board that holds the control system that makes the segway balance.

Communications between the main board and the motor board are trough SPI for the high speed data, and trough UART for the slower data instructions.

 

MotorBoard

MotorBoard_Back (Medium)MotorBoard_Top (Medium)

The motor board gets control data from the main board and interacts with the motor driver to adjust the motor power. The main reason this board has it’s own processor is that if the main board hangs due to code that are under development or for some other reason, the motor board can still actively control the motors. It can then ramp the power down if it senses that the periodic update from main board is lost. This gives you a better chance to get off the vehicle if the motors are stuck on high power or if there is a sudden loss of power to the motors.

Another reason is that motor board  can handle the motor power control loop with feedback from motor encoder in a dedicated processor instead of having to share the load on the main board processor. This means that I have a lot of processor power only for the motor control loop and I can implement more advanced algorithms without having to consider load regulations.

The board also have two current sensor inputs, sensing +- current to each motor driver. This means that the board can sense the power load on the motors.

 

SensorBoard

sensorBoard_V3 (Medium)

The board contains one  SPI Gyroscope ADXRS450 ±300°/sec, and two MXA2500G ±1.7 g (2 axis each) that has an angular offset of 45deg to each other.
The board is made so it is easy to make a new version. This way I could test various solutions. The current board is my third version.
My main goal with this project was to be able to test and learn control systems, and sensors are a big part of that.

 

Motor Driver

MotorDriver (Medium)

The motor driver is made of H-bridge driver HIP4081A controlling 12 FDP030N06 mosfets. Each mosfet is capable of 120A continuous and ~700A peak current. Each branch in the H-bridge holds 3 FDP030N06 and should be able to handle much more power then the 250W motors will need.

I have mounted a digital temp sensor on the heat sink with a resolution of 0.03125°C, so i can monitor the dissipated heat from the mosfets.

Power Distribution Board

PowerBoard (Medium)

This board regulates the battery voltage (24v) to 14.4v to motor drivers and 8v to the box with main/motor/sensor board.

Steering LCD unit

SteeringUnit

I made this of one of my test PCB boards. The LCD has touch functionality but it is not implemented in this version. On the screen I can monitor the angle of the segway as well as voltages, currents, consumed power, motor driver power and temperature. I can also see traveled distance and speed, but it is on a newer version of the software than the one used in this picture.

Charger

ChargerBoard (Medium)

I made a charger that I could place inside the segway so it would be easy to charge the batteries. The batteries are limited to 3A charge current, and the charger is using a 3 step charge mode. It holds information about charged Ah, and voltage, current and  temp can be requested trough the UART connector.

Motors

motors

The motors were one of the hardest parts of the segway to find. They needed to have the right specifications and be reasonable priced. Thanks to friends I got one motor for free and two more for a small price. The three motors became two after selecting the best parts. The motor power is about 250W and it is equipped with a worm gear that has an awful backlash. The motors were in used condition so I knew that I would have some problem with the control system due to the big backlash.

Currently I am using some nifty encoder from a camera for motor feedback. I must find a better suited encoder so I can use the encoder data in the motor control loop. But it is hard to find a well suited encoder that is small enough as well as reliable. I am still looking for one.

If I can use the encoder feedback I can almost completely eliminate the backlash problem – that would be really nice.

Debugging capabilities

099

 

I have created a PC logging program that I use for logging data in real time trough Bluetooth or USB. With the program I can read and set control values in the segway, even while it is running.

Ext1

 

Both the main board and motor board have JTAG and USB communication that can be used to debug processors and output data. JTAG is a direct bus to the processor and can be used to read out almost every step the processor makes as well as settings and data.

USB is mostly for sending log data that can be saved as a file or viewed in real-time through the pc program. It enables multi signal view with high detail, which can be saved in various data formats. The program can be used for sending data and commands to the target board with regulator settings etc. By saving logged data in a file and with a large number of formatting options the file can be used for many other purposes.

While the segway is running the radio communication can be used instead of the usb communication. The major difference is only the amount of data that can be logged.

 

My angle measurement jigg

s16

s15

Used for testing and calibrating the sensors

DSC04513 (Medium)

Testing and calibrating the motor driver.

Beta Boards

I did make a beta version of the solution at first.

Mainboard

S3

Motor Board + Motor Driver

S4

Sensors, also with the same “easy change” -concept

IMAG0126 (Medium)

I first made an external charger, but i changed my mind when i did realize I could fit the charger inside the segway instead.

S11

s12

 Other

I made some high speed PCB cad and soldering videos based on the segway mainboard and motorboard

Follow

Get every new post delivered to your Inbox

Join other followers: