Shop OBEX P1 Docs P2 Docs Learn Events
Measuring Skateboard Tilt — Parallax Forums

Measuring Skateboard Tilt

I'm building my own electric skateboard from parts.
I'd like to add an electronic differential to the contraption. As described in this Youtube video, an electronic differential will adjust the motor speeds to aid in turning.
I haven't figured out how Bajaboard senses the tilt of the board. It might be an IMU. An IMU might work well but it seems to me there are several situations where an IMU could be confused. I doubt an IMU would be able to distinguish between tilting the board and riding on a slope.
I might try the IMU approach but I first thought I'd try measuring the distance from the truck to the board. I'd mount a LaserPING pointing down at the truck. Hopefully this will allow me to measure tilt by sensing the distance between the sensor and the truck.

Here's a sketch attempting to show my idea.

SkatePing.jpg

A different angle with only the truck shown.

SkatePing2.jpg

I'm using a dual VESC to control the motors. This should allow me to use a Propeller to set the speed of the individual wheels.

I'm adding the ESCs and motors to a longboard purchased off Amazon.

810mtB9SDzL._AC_SX679_.jpg

Do any of you see any obvious problems with this plan (besides the horrific bodily injuries it's likely to cause)?

Do any of you have suggestions on alternative ways to sense the tilt of the skateboard?
«13

Comments

  • Any chance of replacing those coil springs with a transverse leaf? Then you could put strain gauges on the leaf and have a real-time indicator of angle without the hassle of an optical system.
  • JRoark wrote: »
    without the hassle of an optical system.

    You must have skills I don't, to consider your alternative less hassle.

    I haven't seen transverse leaf springs used on skateboards though I admit I'm pretty new to this sort of thing.
  • JRoarkJRoark Posts: 1,214
    edited 2020-08-07 23:07
    No mad skills here. And I havent been on a skateboard in decades. But I raced a 1980’s era Vette with a transverse composite leaf system and I was harkening back to that instrumentation effort. We were easily able to measure body roll with just strain gauges and a ZWorld Z80-based DAQ. So I wondered if maybe this would be useful in the skateboard context. Its devilishly simple to do. We literally slapped four strain gauges on with JB Weld, wire-tied the harness to the frame and took it racing.

    Edit: if re-engineering the suspension isnt in the cards, a couple of string pots between the board and the trucks would give you the same data. Example: https://unimeasure.com
  • I'd repurpose a Servo 360 as just an encoder, as illustrated here:

    https://forums.parallax.com/discussion/167675/repurposing-a-broken-servo360

    Secure the body to the underside of the board and the shaft to the axle, such that the shaft and axle tilt axes are collinear.

    -Phil
  • Duane DegnDuane Degn Posts: 10,588
    edited 2020-08-08 01:25
    JRoark wrote: »
    a couple of string pots between the board and the trucks would give you the same data. Example: https://unimeasure.com

    Those are cool string pots but the Unimeasure ones are pretty expensive. I suppose I could do something similar with a ten turn pot and some string. I'm not sure I'll use it but thanks for the idea.
    I'd repurpose a Servo 360 as just an encoder

    I actually have a bunch of Hall effect encoders.

    As5050Small130724a.jpg

    I could rig up some sort of mount like you suggest. I now have a 3D printer to aid in building these sorts of contraptions.

    I'll see what sort of resolution I get from the LaserPING but then try one of the other ideas presented here if I don't like how the LaserPING works. The LaserPING just seems like it will be really easy to mount.

    As I think about how I want the final vehicle to look, I may want to use the encoder idea (it should look sleeker).

    I have a second set to motors and ESCs. I plan to make this a 4 wheel drive vehicle. I need all four wheels to be powered when I eventually make Mecanum skateboard wheels.

    I've heard of people being seriously hurt on electric skateboards but I've never heard of anyone being hurt riding a Mecanum wheeled electric skateboard. This must mean Mecanum wheeled electric skateboards are very safe. What could possibly go wrong?

  • Duane, you clearly are not self-insured! Lol.

    This is some grand mischief and I look forward to seeing the result.
  • Duane Degn wrote: »
    ...I've heard of people being seriously hurt on electric skateboards but I've never heard of anyone being hurt riding a Mecanum wheeled electric skateboard. This must mean Mecanum wheeled electric skateboards are very safe. What could possibly go wrong?

    :smile:

    Mike
  • Have you thought about using a rotary encoder on the pivot point?
  • Duane,
    I noticed you show the as5355 product in one of your photos. hos much more accurate do you want? print an enclosure and your off.
    Jim
  • One of the problems with using an encoder at the pivot point is the pivot point isn't securely attached to either board or the truck. The pivot point is a bolt which itself can rotate (though not easily).

    I'd need to rig up some way to hold the encoder PCB at the pivot point and the magnet at the pivot point without attaching either to the bolt.

    Supposedly this is an off road skateboard. I'm not crazy enough to try riding this off road, but someone might want to try riding the board off road. It would be nice if the tilt sensor weren't vulnerable to rocks and logs.

    I need to figure out how to get a Propeller to talk to the VESC before I do much of anything else.

  • Could you take a slightly different approach to Phil's idea, borrowing from the string pot?

    Mount a rotary encoder (Servo360?) on top of the board with the shaft along the midline of the board and the midpoint of a string secured at top dead centre of travel.
    The ends of the string can be secured in loops around the truck on each side, so that as the truck tilts, the encoder turns with it. When the suspension has to accommodate a bump the string may go slack momentarily, so you may need to account for that in the code, but if the string can never be pulled so tight that it stresses the bearing of the encoder it should be mechanically sound.
    This keeps the electronics out of the way of rocks and logs, and a suitable enclosure protects them from feet.
    Adding an accelerometer into the design could help detect those times where you've hit a bump.
  • AJL wrote: »
    Could you take a slightly different approach to Phil's idea, borrowing from the string pot?

    Thanks for all the good ideas.

    While the trucks kind of look like they have shocks, these only resist the pivoting of the trucks. The distance between the pivot and the top of the truck is constant. Here's a photo the top of the truck.

    3_676f3251-c0c5-4910-9558-34ccb9ab67c4_1800x1800.jpg

    There will likely be some rubber between the top of the truck and bottom of the board so the encoder should probably be mounted to the top section of the truck with with the string or equivalent passing down to the lower section of the truck. There's an opening in the top of the the trucks and openings in the board directly above the trucks. These opening could be use to route wires from the encoder.

    As mentioned earlier, I have several AMS5055 encoders with appropriate magnets. I'll likely try to use one or two of these to measure the pivot.

    I think your idea of using an encoder pivot point parallel (and above) the actual pivot, will make mounting the encoder easier than attempting to mount the encoder in line with the pivot point.
    AJL wrote: »
    Adding an accelerometer into the design could help detect those times where you've hit a bump.

    While I don't think bumps are going to cause the trouble you original where concerned about, I intend to load the board with all sorts of sensors. This will hopefully end up being able to autonomous at times. I don't plan to have a self driving skateboard (though that does sound cool). I think I'll keep humans off the board will under autonomous control.

  • Another wild possibility: mount a miniature air piston between the axle and the mount. Route the port to a pressure transducer. The pressure of the system indicates roll angle. For extra credit, use two cylinders per axle (one on either side) and use the difference in indicated pressures to wash-out changes in atmospherics, temperature, etc. This approach would also have a natural tendency to dampen oscillations in the data due to vibration/rough surfaces. And you could simultaneously apply pressure to these same cylinders from an on-board source to tune the roll stiffness.

  • Duane Degn wrote: »
    . . . I haven't figured out how Bajaboard senses the tilt of the board. It might be an IMU. An IMU might work well but it seems to me there are several situations where an IMU could be confused. I doubt an IMU would be able to distinguish between tilting the board and riding on a slope.
    . . .I might try the IMU approach but I first thought I'd try measuring the distance from the truck to the board. I'd mount a LaserPING pointing down at the truck. Hopefully this will allow me to measure tilt by sensing the distance between the sensor and the truck.
    . . .Do any of you have suggestions on alternative ways to sense the tilt of the skateboard?

    Duane,
    A IMU chip would gives you Euler roll angle, which indicates tilting.
    You are correct in pointing out the fact that riding on a slope will be seen as tilting, but would that not be the same with any sensor because on a slope you have to tilt to stay upright?
    The only foolproof way I can think of is two distance sensors, one on each edge of the board which measure the distance to the ground.
    I understand these boards have small wheels, so they will not really be ridden over uneven ground.

  • JRoark wrote: »
    For extra credit, use two cylinders per axle (one on either side) and use the difference in indicated pressures to wash-out changes in atmospherics, temperature, etc.

    Thanks for the fun ideas. While fun, they don't sound very easy to implement. I do like the idea of being able to tune the roll stiffness. These sorts of trucks are supposed to be mounted at around 30 degree away from the center of the board. Normally off road skateboards have angled nose and tail sections so the truck can be mounted directly to the board. Since I'm using a normal board, I need to add wedges to angle the trucks.

    The first set of wedges I added were much too small to produce the required 30 degree offset. The 13 degree wedges I used made the board very difficult to turn. This angle also make it hard just to balance on the board since the springs seemed so weak. It would have been nice to be able to stiffen the roll in this case.

    I'm headed to the hardware store to get longer bolts so I can use larger wedges.

    Again thanks for the fun ideas.

  • macrobeak wrote: »
    A IMU chip would gives you Euler roll angle, which indicates tilting.

    I think the Baha Board uses an IMU. I'll include an IMU in my contraption and see how well it works at determining the tilt. I wanted to try several different approaches. This thing will likely a robotics project as much as it is an electric skateboard project.
    macrobeak wrote: »
    The only foolproof way I can think of is two distance sensors, one on each edge of the board which measure the distance to the ground.
    I understand these boards have small wheels, so they will not really be ridden over uneven ground.

    The wheels which came with the motors and trucks are 8" (about 200mm). There's pneumatic (there are inner tubes in each tire) and should be able to handle rough terrain. While the wheels and truck can handle rough terrain, I'm too much of a chicken to go off roading with this thing myself.

    I've ordered a bunch of the laser sensors used in the LaserPING. I'm hoping the I2C interface will allow faster updates than the Parallax version (which is still faster than an ultrasound PING). I'll likely point a few of the I2C sensors at the ground and compare the data with sensors pointed at the truck axles.

    While I'll likely try to measure the distance to the ground from the board, I' think monitoring the distance between the board and one of the axles would produce a more reliable reading of how much the board is tilted.

    As I mentioned elsewhere in this thread, I'll likely use this contraption as excuse to try out all sorts of sensors.

    Thanks for the suggestions.
  • Considering they have self balancing boards these days and looking at a drone that fly by them selves I would thing a fused IMU should work just fine. They combine the different sensor to generate EULER angles that are used to determine NED or Roll, Pitch, and Yaw.

    Mike
  • iseries wrote: »
    a fused IMU should work just fine.

    I think you're right.

    An IMU would likely do the job. I think there's something wrong with me. I don't think I'll be able to stop myself from adding additional sensor even if they're not needed. My brain seems to think there's no such thing as too many sensors.

    It could be fun to compare the various sensor data. I'll likely add a SD card or flash chip to log the data.

    In case anyone is interested, these sorts of off road wheels and motors are usually used on boards which have their nose and tail angled up by 35 degrees. Here are a few images showing appropriate boards for this hardware.

    OffRoad3.PNG

    OffRoad1.PNG

    OffRoad2.PNG

    I assure you all, I spent much much less than the $3,600 price of board in the last two images. Those boards cost more than several cars I've owned.
    1470 x 830 - 4M
    1474 x 832 - 887K
    1470 x 830 - 524K
  • W9GFOW9GFO Posts: 4,010
    You would need two IMUs I think. One to tell you the orientation of the board and the other to tell you the orientation of the axle. Unless of course you will always use it on perfectly flat terrain.
  • Cluso99Cluso99 Posts: 18,066
    What about using a pair of the IMUs, one on the truck and one on the axle?
  • Duane DegnDuane Degn Posts: 10,588
    edited 2020-08-12 17:52
    W9GFO wrote: »
    You would need two IMUs I think. . .
    Cluso99 wrote: »
    What about using a pair of the IMUs, one on the truck and one on the axle?

    My gut says you guys are right but my gut doesn't have a good track record of being correct.

    As a way of an update on this project here's a photo of a couple 35 degree wedges (the two on the right are 35 degrees the one on the left is rubber and about 14 degrees). I'll likely not use these wedges.

    Wedge35.jpg

    The holes in either the board or the truck would need to be enlarged to ovals in order for the bolt to pass through everything. Neither the board nor the truck would likely survive being modified so drastically so I'm looking for a reasonably priced mountain board deck.

    BTW, It sure is fun being able to print a part with a 3D printer. I've had my 3D printer a few months and I have a hard time understanding how I managed life without it.
    1363 x 1022 - 310K
  • JRoarkJRoark Posts: 1,214
    edited 2020-08-12 19:25
    How about 3D printing a replacement wedge designed with strain gauges in it? That would put literally everything "inside" a protective cover except for the wires connecting it to the DAQ system.

    With two wedges (fore axle/aft axle) and 3 strains per wedge you could then calculate rider weight in addition to the roll angle. This means you could integrate it into the motor speed control loop such that moving your weight forward makes it accelerate, while moving body weight backwards slows it down. And if you fall/jump off, the board stops.

    Just thinking out loud here. :)
  • JRoark wrote: »
    How about 3D printing a replacement wedge designed with strain gauges in it?

    That sounds like a really interesting idea.

    I'm going to need to redesign my wedge. Before I print it, I'll post from CAD images here and maybe you could suggest where to place the strain gauges?
    I actually purchased a bunch of strain gauge amplifiers a few months ago. I never figured out which sensors I should purchase.

    These are the amplifiers I purchased.

    s-l640.jpg

    These were listed as: "HX 711 Module Weighing Sensor Pressure Sensor 24 Bit AD Module"


    Would something like this be appropriate for the skateboard application? Do you know of a better alternative for this application?

    640 x 640 - 28K
  • JRoarkJRoark Posts: 1,214
    edited 2020-08-13 14:16
    I’m not the worlds best mech designer (but I did stay at a Holiday Inn Express last week), so take this all with some cautious scepticism.

    I have used the Sparkfun version of that board. They work nicely. No issues there.

    Posting pictures from phone. Will edit post with explanation momentarily
    OK. I suck at drawing. :) Now that we have that out of the way...

    After thinking about it, I think you only want two strain gauges per axle. The idea is to make these gauges individually sensitive to roll, and collectively sensitive to total weight.

    The pictures give a (terrible) example of what I think would do that.
    Blue is the existing hardware (wheels, trucks, pivot, springs, etc).
    Green is the spacer you'll be printing anyway.
    Red is *another* spacer (a shim), about 1/4 inch thick, that you can print that contains the strain gauges (shown in black).

    The key bit is the two "buttons" (green spheres) that you would engineer into your wedge spacer. These create points of concentrated force during roll that press on the strain gauges in the red shim. The shim will need to be made to deform slightly, likely by mounting it by the edges and slightly spacing it away from the board (washers? 3d printed ledge? You decide. )

    You'll need to engineer some sort of floating pin-line system that will not allow the spacer/wedge/board to separate, but will allow roll inputs to flow without resistance.

    So your roll input is (Strain A - Strain B). Your weight-on-axle is (Strain A + Strain B), and your body position (ie, fore/aft) is the difference in (Front Strain A + Front Strain B) - (Aft Strain A + Front Strain B). And you could play all sorts of games too with torsional measurements. :)

    Anyway... that's all I got. Hopefully the concept is clear even if my art abilities suck. :) I'll let brighter minds critique it and add to the soup.

    EDIT2: You could make it so the "shim" could be quickly removed. That way you can actually ride the board between dev cycles without messing with cables and other Smile. Just bolt your wedge to the board as normal, sans shim.
  • ercoerco Posts: 20,244
    Cool project, Duane! You're doing much more high tech stuff than me these days. I'm regressing, just working on my 1967 Corvair. It's my Covid project, I finally pulled it out of the garage after letting it rot there for 20 years and now paying the price. I'm having a bit of fun adding some modern electronics: bluetooth radio, ignition, and I hacked this solid state flasher:



    On the other end of the fun scale, rust in the gas tank:

  • erco wrote:
    On the other end of the fun scale, rust in the gas tank
    Yow! Is naval jelly miscible with gasoline? :)

    -Phil
  • ercoerco Posts: 20,244
    2 gallons of Evapo-Rust to the rescue.
  • erco wrote:
    2 gallons of Evapo-Rust to the rescue.
    "Evapo-Rust" sounded like something you made up. So I looked it up. It's real!

    -Phil
  • ercoerco Posts: 20,244
    Q: Would I lie to my personal hero PhiPi?

    A: Never!
  • Cluso99Cluso99 Posts: 18,066
    Aha. I’ve just replaced the in tank fuel pump on my 1988 Toyota Supra. It was quite hunky but the tank appeared ok. It’s running but unregistered. I plan to register it as soon as COVID restrictions reduce.
Sign In or Register to comment.