Can you change unlock pin after encrypting your phone? I'm using Android M and would like to turn on encryption.   

Am I going to be able to change my screen pin in the future after I enable encryption?
Yes. You can. Changing the PIN in turn changes the encryption password

From Android Security Internals: An In-Depth Guide to Android's Security :


  Android doesn’t have a dedicated setting to manage the encryption pass-
  word after the device is encrypted, and changing the screen lock password or
  PIN will also silently change the device encryption password. This is most
  probably a usability-driven decision: most users would be confused by having
  to remember and enter two different passwords at different times and would
  probably quickly forget the less frequently used, and possibly more complex,
  disk encryption password. While this design is good for usability, it effectively
  forces users to use a simple disk encryption password, because they have to
  enter it each time they unlock the device, usually dozens of times a day. No
  one wants to enter a complex password that many times, and thus most users
  opt for a simple numeric PIN (unless a device policy requires otherwise)