Showing posts with label Physical Robot Model. Show all posts
Showing posts with label Physical Robot Model. Show all posts

Thursday, May 16, 2013

The Real Model

After actually building the model, the real parameters had to be determined.

It was suspended so that it acts as a pendulum to measure the angular inertia. The gyroscope sensor attached to the robot continually fed the angle via blue tooth to my pc. In this way, the period was accurately determined. The angular inertia of the wheels was calculated based on a disk.

The motor constants were quite easy as well. The power (current and voltage) was measured under both no load and full (stall load).

torque = (stall power - no load power) / no load rotation
Km = torque / current
Km = 0.3745
Ke = volts / no load rotation
Ke = 0.5033

Mp = 0.666
Mw = 0.03
l = 0.097
r = 0.022
Ip = 0.0031
Iw = 0.00001363
R = 4.6



After plugging in the "real" values, multiple issues were found. To be more real world, a starting current is needed - the motor does not start turning until ~1.6V is applied and naturally, gravity and angular momentum also comes into play. The real world Ke and Km values are much larger than an earlier post due to the 1:48 gear ratio. The maximum volts also needed to be capped. 

More importantly, the dual PID controllers didn't really work that well if the starting angle and/or speed was not zero. It would seem to correct the angle and then stop at a low speed and stay there - the voltage shows this...


To correct this, a further pid controller was added ...

Note in both graphs the angle is accentuated. The first 0.4 (20 units) seconds represents the robot being pushed over after being already put at a speed and at an angle.



Monday, April 22, 2013

Bluetooth and the Physical Model

Being a mobile robot, radio communication is essential for both control and debug. 

It took me ages to integrate it (~ 4 hours). My first problem was not knowing about the protection for the non mask-able interrupt pin that is shared with the tx line for uart 2. The second was actually pairing the Bluetooth with my PC. I could pair, but it would immediately go offline. I did not realise that it would actually only pair correctly once I had opened the comm port. It did not help that there were a few weird errors in the windows event log either.

The model it self  has a training sled and is very top heavy, especially when the batteries are added. Essentially components have just been screwed onto a block of timber. The pcb on the bottom is the dc motor driver. It has a 5v dc regulator output so the logic components can either be powered from the usb jtag or battery with a flick of a switch.


The batteries will be NiMh and currently only 8 of 10 the battery slots will be used. The Lego motors will be powered by 9.6V! All good.