Overlander is right; with no load on the wheels you won't get much torque at all. Unless, of course, you put your foot on the brakes.
Your biggest challenge will be the power stage. If I were you, I'd concentrate on studying power electronics. Knowing how your power stage works will give you a better idea on what the CPU needs to do. There's all sorts of signals that the CPU needs to watch and act upon, eg gate driver undervoltage, gate desaturation, motor overcurrent, etc.
The program code also needs to be built very resiliently. For example, in real world applications, you can't even trust that the CPU is processing everything correctly 100% of the time.
- Add checks in your program code to see if your register values are sane.
- Double, or even triple check your complex math operations with different methods and compare the answers to ensure they are the same.
- A hardware watchdog timer is a necessity in this role.
- Your program code should be in the form of a finite state machine.
As others have suggested, use interrupt service routines for time dependent or important actions. The PWM library for the Arduino uses ISRs. This will allow your main program code to run asynchronously from timed tasks such as PWM. Critically fast actions such as shutting down the gate in the event of an overcurrent or gate desat should be done in hardware with logic gates or via an interrupt-on-change pin.
Lastly, your PWM control shouldn't be directly proportional to the throttle input (as you have done). PWM duty cycle represents the ratio of voltage from input to output of the controller. The throttle should control torque (current), not voltage.
The correct operation would be to read the pot value, scale it, read the current sensor, scale it, compare the current to the pot. This will give you an error value. Use this error value to feed into a PID control block. The output of the (correctly configured) PID block will be your PWM reload value. repeat this process ad infinitum.
The best place for the throttle control loop would be in an ISR, serviced by a timer every 100ms or so. You'll then be able to enable or disable throttle control by means of setting or clearing the respective interrupt enable flag.
Hope this helps.
Sam.