How to get active parking brake

This is not annoying at all. It is cool and fascinating :smiley:

6 Likes

Have you tried using the PID control method?

1 Like

I believe that’s similar to duty cycle in that it’ll take in amperage to overcome obstacles so I haven’t tried it.

Ah yeah I agree with that statement

Derailing question, how do you know if a VESC is 4 or 6 if it doesn’t say? Is VESC 6 more reliable?

My VESC Flipsky 75100 doesn’t say and neither does this VESC I was looking at getting:

Go-FOC G300 100V 300A ESC - MakerX (makerx-tech.com)

This is my go to thread on esc info

2 Likes

Thanks for that.

@jaykup Is a beast, so much information!

I guess that means that the 75100 is VESC6 with modifications, so if I bought a remote it would be for VESC6?

I found a Flipsky remote/receiver for $40. It’ll take forever to get here though.

1 Like

Tons of folks (myself included) have several remotes lying around and would love to send you one for the price of shipping :wink:

1 Like

That’s sweet :pleading_face: But I’d feel bad honestly.

The dust bunnies won’t miss it too much. I have a few lying around that I will literally never use again. Plus, I have a good feeling about you in my heart of hearts.

Let me check and see.

3 Likes

That makes one of us.

If you’re sure :pleading_face: I can Venmo, Cashapp, or Zelle you. Any ol’ remote will do, just needs a receiver too and I have no idea if my 75100 takes a VESC4 or VESC6 receiver.

No worries though if you don’t have anything :pleading_face:

“VESC 6” receiver. The difference just the tx and rx wires are flipped between the v4 and v6 on the uart port, so either will work if you flip the wires.

1 Like

I have a dissected but functional enertion Nano x remote and a winning remote. I believe the receiver goes to the winning remote but I’m not 100% positive so I’ll send both just to be safe. Only thing missing is the cable but I may have an extra laying in the bottom of the box of parts. Pm me your info.

4 Likes

That’s hilarious.

Thanks, I will :pleading_face:

I’ve started working on some more efficient parking brakes. It just doesn’t make sense to have so many amps running through when the motor wouldn’t move anyway.

It’s a pain, but I’m sure I’ll have it working nicely eventually. This way, no worrying about hot wires and eating your battery life.

1 Like

It’s actually not that bad. It brakes when there’s force, it stops braking when there’s no force. However, it’s still far from ideal because the approach is somewhat flawed.

Basically, I’m countering any movement with an RPM speed of the opposite direction. The issue is that the function that dictates the RPM of the motor also asks for a certain amount of current. At 0RPM and, lets say, 40 amps, it acts just like a handbrake. Give an RPM value and it’ll spin.

The issue then becomes that 40 amps is strong! And any force that’s pushing you may not be able to overcome the 40 amps at all (let alone need to be countered by rotation), so it starts to not know if there’s any force pushing against it.

Another flaw is that if something can overcome that amperage at 0RPM, it’ll probably overcome it at any other RPM. If you set an RPM and tell it to take as much amps as it wants, it ruins the whole idea.

All that said, I’ve coded my way around these issues for the most part. But it’ll sometimes stop braking when there’s still force applied, and it takes it a few seconds to recognize that there’s no force so it can stop braking.

Testing was with my foot on the wheel, so still needs field testing to properly gauge it.

Possible Better Approach: Set handbrake when RPM is detected and keep lowering amperage. If you can reach 0 amps and stay at 0RPM, then no braking needed. If amperage goes down and wheel starts to move, keep desired amperage. This may jerk you, but if done fast and precisely enough may be unnoticeable.

2 Likes

That said, if you’re encountering force moving you to begin with, it’s reasonable to assume you’ll keep encountering it up until you try to move again.

Perhaps the best solution is a simple solution. If movement is detected, activate the brake indefinitely - until the user leaves the braking PPM/ADC range to start moving again.

This way, even if you only needed the brake for a short while, you can stop it from braking simply by leaving the PPM/ADC range for the handbrake and going back down to it. As long as you have some dead-zone the board won’t move when adjusting it.

If the code I have no works fine in practical application I’ll keep it and post it. If not, then this simple approach will have to do.

1 Like

Here’s the “simple” approach code which is very simple. To change how sensitive it is, simply change minRPM. The higher the minRPM value, the faster the wheel has to travel before it activates the handbrake.

A value of 100 will pretty much activate at the slightest movement. A value of 1000 allows for a reasonable amount of play (at least with my 6" wheels) before activating. Lots of customizability with this value. Can even make it so that it only activates if you give the skateboard a nudge (as you can set the value to a higher RPM than an incline would invoke).

Also note that the safety feature of not activating the handbrake if you go to fast only checks if you’re going to fast when you enter the handbrake PPM/ADC range. Once you’ve slowed down enough and are in that range, the handbrake will activate at any RPM.

This only matters if you set the minRPM very high, the handbrake will engage at that minRPM no matter how fast.

Well, that was stupid, bed time.

; Only Change hz If You Need Faster Responsiveness
(define hz 100)
(define isBraking 0)

(define one 1)
(define zero 0)
; -------------------------------------------------

; RPM At Which To Activate HandBrake
(define minRPM 100)

; Braking Current  (CHANGE)
(define brakeVal 40)

; Input Range For Handbrake to engage
; inputTop is the top of the range, inputButtom is the bottom of the range

; Input Value Which AT/BELOW To Engage Handbrake (CHANGE)
; Negative Value Means Handbrake Will NEVER Engage
(define inputTop -0.975)

; Input Value Which AT/ABOVE To Engage Handbrake (CHANGE)
; Negative Value Means Handbrake Will Engage At Any Value Less Than inputTop
(define inputBottom -1.5)

; RPM At Which You'd Be Too Fast For Handbrake To Engage (CHANGE)
(define RPM 100)

; THIS IS FOR PPM INPUT
; FOR ADC, CHANGE ALL:
; (get-ppm) to (get-adc 0)


(print(get-ppm))
(print(get-rpm))

;(get-duty)
;(set-duty dutycycle)


;(get-rpm)
;(set-pos pos)
;(set-rpm rpm)
(defun brake()
    
  (progn
   (if (eq isBraking zero)
    (progn
       (app-disable-output -1)
       (define isBraking one)
    )
   )
   
   (define curRPM (abs (get-rpm)))
   
   (if (> curRPM minRPM)
     (set-handbrake brakeVal)
   )
   
  )
)

(defun unBrake()
     (progn
      
      (if (eq isBraking 1)
       (progn
        (set-handbrake 0)
        (app-disable-output 0)
        (define isBraking zero)
       )
      )
     )
)

(defun loop()

    (progn
        
        (define PPM (get-ppm))
        (if (and (< PPM inputTop) (> PPM inputBottom))
        
         (if (or (eq isBraking 1) (< (abs(get-rpm)) RPM)) 
          (brake)
         )
         
         (if (eq isBraking 1)
          (unBrake)
         )
         
        )
        
        (yield (/ 1000000 hz))
        (loop)
    )
)

(unBrake)
(loop)
2 Likes

Thanks @Venom121212 for the remote! It’ll be a big help, I appreciate it A LOT.

A personal update for anyone who cares, I’ll keep it snappy.

One foot pedal “works” but my original plan calls for 2-3 foot pedals (preferably pads) so that you can properly steer the board and not need constant pressure. However, it’ll have to wait as the remote is far easier and will help diagnose some minor issues with the board.

I’ve been working on other projects (the skateboard has always been the side project for me). With the money saved from buying a remote and getting my paycheck, I decided that I can no longer live without a 3D printer.

The amount of times a 3D printed part would have saved me hours if not days of headache with BETTER results is simply unbelievable. An example just this week, I went to Home Depot needing a 1-1/8" washer… doesn’t exist LMAO. I splurged and got the Ender 3 V2 - which is currently on sale for exactly $199 on their site. It’s usually nearly $300, couldn’t believe it and stole it right up. Worth it’s weight in gold.

Will have to wait on getting the ESC I need, but I can share ESCs with the skateboard while developing.

I don’t know when I turned this turned into a blog, but I’ll definitely stick to skateboard stuff on the forum from now on lmao. But a 3D printer is a godsend for any DIY project.

2 Likes

Just a heads up, if you live near a microcenter you can get an ender pro for $110 after tax with a deal they’re always running. But yes, 3d printers are the best. I’m on my 7th :muscle:

1 Like